Skip to content

Commit

Permalink
typos
Browse files Browse the repository at this point in the history
  • Loading branch information
ChHarding committed Sep 7, 2020
1 parent 60f13fd commit 90af0f5
Showing 1 changed file with 21 additions and 75 deletions.
96 changes: 21 additions & 75 deletions TouchTerrain_standalone_jupyter_notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,11 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {
"tags": []
},
"outputs": [
{
"output_type": "stream",
"name": "stderr",
"text": "INFO:root:EE init() worked with .config/earthengine/credentials\n"
}
],
"outputs": [],
"source": [
"# import packages\n",
"import os, sys\n",
Expand Down Expand Up @@ -136,17 +130,11 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"metadata": {
"tags": []
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": "settings stored, ready to process\n"
}
],
"outputs": [],
"source": [
"args = {\n",
" # DEM/Area to print\n",
Expand Down Expand Up @@ -225,17 +213,11 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {
"tags": []
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": "{'importedDEM': None, 'DEM_name': 'USGS/NED', 'bllat': 39.32205105794382, 'bllon': -120.37497608519418, 'trlat': 39.45763749030933, 'trlon': -120.2002248034559, 'tilewidth': 200, 'printres': 0.4, 'ntilesx': 1, 'ntilesy': 1, 'basethick': 0.5, 'zscale': 1, 'fileformat': 'STLb', 'zip_file_name': 'myterrain', 'tile_centered': False, 'CPU_cores_to_use': 0, 'max_cells_for_memory_only': 5002, 'no_bottom': False, 'no_normal': True, 'bottom_image': None, 'ignore_leq': None, 'lower_leq': None, 'unprojected': False, 'projection': None, 'only': None, 'importedGPX': ['stuff/gpx-test/DLRTnML.gpx', 'stuff/gpx-test/DonnerToFrog.gpx', 'stuff/gpx-test/CinTwistToFrog.gpx', 'stuff/gpx-test/sagehen.gpx', 'stuff/gpx-test/dd-to-prosser.gpx', 'stuff/gpx-test/alder-creek-to-crabtree-canyon.gpx', 'stuff/gpx-test/ugly-pop-without-solvang.gpx', 'stuff/gpx-test/tomstrail.gpx'], 'gpxPathHeight': 10, 'gpxPixelsBetweenPoints': 20, 'gpxPathThickness': 5}\n"
}
],
"outputs": [],
"source": [
"# Note: you must uncomment the last line in this cell to actually use these gpx settings!\n",
"from touchterrain.common.TouchTerrainGPX import *\n",
Expand Down Expand Up @@ -276,12 +258,12 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Optional: Show map and digitize print area (box, circle or polygon)\n",
"- the next 2 cells will show you a map and will let you manually define a shape, either a rectangle (box), a circle or a polygon\n",
"### Optional: Show map and digitize print area shape (box, circle or polygon)\n",
"- the next 2 cells will show you a hillshaded Google map and will let you manually define a shape, either a rectangle (box), a circle or a polygon\n",
"- it will show you a red box of the area defined earlier (with bllat, etc.) in case you want to digitize inside it. However, you're free to digitize anywhere on the map! Your digitized shape will always override the red box.\n",
"- Digitizing on a map, requires the `geemap` module\n",
"- to install it, type `pip install geemap` into a OS terminal\n",
"- Run the next cell to see a Google map in the next cell with the hillshaded DEM and your bounding box in red\n",
"- This requires the `geemap` module. To install it, type `pip install geemap` into a OS terminal\n",
"\n",
"- Run the next cell to see the Google map\n",
"- ignore any Exceptions with with oauth2client >= 4.0.0 or google-auth, they are bogus \n",
"- On the left, use the __Draw a Rectangle__, __Draw a Circle__ or __Draw a Polygon__ to define the shape of your print area\n",
"- Run the cell below the Map to make a GeoJSON polygon and add it to args. (If you don't want to use the shape (or didn't digitize any) and want to use the red bounding box, just skip this step.)\n",
Expand All @@ -290,29 +272,11 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {
"tags": []
},
"outputs": [
{
"output_type": "stream",
"name": "stderr",
"text": "WARNING:googleapiclient.discovery_cache:file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth\nTraceback (most recent call last):\n File \"C:\\Users\\charding\\anaconda3_3.7\\lib\\site-packages\\googleapiclient\\discovery_cache\\file_cache.py\", line 33, in <module>\n from oauth2client.contrib.locked_file import LockedFile\nModuleNotFoundError: No module named 'oauth2client.contrib.locked_file'\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"C:\\Users\\charding\\anaconda3_3.7\\lib\\site-packages\\googleapiclient\\discovery_cache\\file_cache.py\", line 37, in <module>\n from oauth2client.locked_file import LockedFile\nModuleNotFoundError: No module named 'oauth2client.locked_file'\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"C:\\Users\\charding\\anaconda3_3.7\\lib\\site-packages\\googleapiclient\\discovery_cache\\__init__.py\", line 44, in autodetect\n from . import file_cache\n File \"C:\\Users\\charding\\anaconda3_3.7\\lib\\site-packages\\googleapiclient\\discovery_cache\\file_cache.py\", line 41, in <module>\n \"file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth\"\nImportError: file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth\nWARNING:googleapiclient.discovery_cache:file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth\nTraceback (most recent call last):\n File \"C:\\Users\\charding\\anaconda3_3.7\\lib\\site-packages\\googleapiclient\\discovery_cache\\file_cache.py\", line 33, in <module>\n from oauth2client.contrib.locked_file import LockedFile\nModuleNotFoundError: No module named 'oauth2client.contrib.locked_file'\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"C:\\Users\\charding\\anaconda3_3.7\\lib\\site-packages\\googleapiclient\\discovery_cache\\file_cache.py\", line 37, in <module>\n from oauth2client.locked_file import LockedFile\nModuleNotFoundError: No module named 'oauth2client.locked_file'\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"C:\\Users\\charding\\anaconda3_3.7\\lib\\site-packages\\googleapiclient\\discovery_cache\\__init__.py\", line 44, in autodetect\n from . import file_cache\n File \"C:\\Users\\charding\\anaconda3_3.7\\lib\\site-packages\\googleapiclient\\discovery_cache\\file_cache.py\", line 41, in <module>\n \"file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth\"\nImportError: file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth\n"
},
{
"output_type": "display_data",
"data": {
"text/plain": "Map(center=[44.599634867901756, -108.11694999999997], controls=(WidgetControl(options=['position'], widget=HBo…",
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "15edddfa638f4ac7a1f3d6ce3f4335c7"
}
},
"metadata": {}
}
],
"outputs": [],
"source": [
"import geemap\n",
"center_lat = (args[\"trlat\"] + args[\"bllat\"]) / 2\n",
Expand Down Expand Up @@ -340,25 +304,19 @@
"if len(args[\"importedGPX\"]) > 0: \n",
" multi_line_string = convert_to_GeoJSON(args[\"importedGPX\"])\n",
" mls_feature = ee.Feature(multi_line_string)\n",
" Map.addLayer(mls_feature, {\"color\":'0000FF', \"strokeWidth\":\"1\"}, \"GPX line\", opacity=0.9)\n",
" Map.addLayer(mls_feature, {\"color\":'00FFFF', \"strokeWidth\":\"1\"}, \"GPX line\", opacity=0.9)\n",
"\n",
"Map # makes the interactive map show up as output of this cell\n",
"# Note: ignore exceptions with oauth2client >= 4.0.0 or google-auth"
]
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": null,
"metadata": {
"tags": []
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": "Using digitized polygon with 15 points\n"
}
],
"outputs": [],
"source": [
"# in the map GUI above, digitze a rectangle, circle or polygon, then run this cell\n",
"# (if you screw up, just digitize a new shape and run this cell again, it will always use\n",
Expand Down Expand Up @@ -386,18 +344,12 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": null,
"metadata": {
"scrolled": true,
"tags": []
},
"outputs": [
{
"output_type": "stream",
"name": "stderr",
"text": "INFO:root:Using GeoJSON polygon for masking with 15 points\nINFO:root:Log for creating 3D model tile(s) for NED_-93.92_42.04 \n \nINFO:root:DEM_name = USGS/NED \nINFO:root:trlat = 42.16927002 \nINFO:root:trlon = -93.82342745999999 \nINFO:root:bllat = 41.90345598 \nINFO:root:bllon = -94.01463054 \nINFO:root:printres = 0.4 \nINFO:root:ntilesx = 1 \nINFO:root:ntilesy = 1 \nINFO:root:tilewidth = 200 \nINFO:root:basethick = 0 \nINFO:root:zscale = 1 \nINFO:root:fileformat = STLb \nINFO:root:no_bottom = False \nINFO:root:unprojected = False \nINFO:root:no_normals = True \nINFO:root:\nprocess started: 17:04:50.152405 \nINFO:root:\nRegion (lat/lon):\n 42.16927002 -93.82342745999999 (top right)\n 41.90345598 -94.01463054 (bottom left) \nINFO:root:center at [-93.919029, 42.036362999999994] UTM 15 N , EPSG:32615 \nINFO:root:lon/lat size in degrees: [0.19120308000000819, 0.2658140400000022] \nLog for creating 3D model tile(s) for NED_-93.92_42.04 \n \nDEM_name = USGS/NED \ntrlat = 42.16927002 \ntrlon = -93.82342745999999 \nbllat = 41.90345598 \nbllon = -94.01463054 \nprintres = 0.4 \nntilesx = 1 \nntilesy = 1 \ntilewidth = 200 \nbasethick = 0 \nzscale = 1 \nfileformat = STLb \nno_bottom = False \nunprojected = False \nno_normals = True \n\nprocess started: 17:04:50.152405 \n\nRegion (lat/lon):\n 42.16927002 -93.82342745999999 (top right)\n 41.90345598 -94.01463054 (bottom left) \ncenter at [-93.919029, 42.036362999999994] UTM 15 N , EPSG:32615 \nlon/lat size in degrees: [0.19120308000000819, 0.2658140400000022] \nrequesting 31.664585834253515 m resolution from EarthEngine\nINFO:root:Earth Engine raster: USGS/NED \nINFO:root: USGS National Elevation Dataset 1/3 arc-second \nEarth Engine raster: USGS/NED \n USGS National Elevation Dataset 1/3 arc-second \nINFO:root:URL for geotiff is: https://earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/thumbnails/941da68d7c70f5874b8c9cf87a49ca91-370dcae846f9fe9c9f2d3dcaee7feb8a:getPixels \nURL for geotiff is: https://earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/thumbnails/941da68d7c70f5874b8c9cf87a49ca91-370dcae846f9fe9c9f2d3dcaee7feb8a:getPixels \nINFO:root: geotiff size: 0.701390266418457 Mb \nINFO:root: cell size 31.664585834253515 m, upper left corner (x/y): 416262.6453770967 4668753.1937456755 \nINFO:root:Time to add GPX paths:0.002991914749145508 \nINFO:root:omitting cells with elevation < -16384 \nINFO:root:full (untiled) raster (height,width): (918, 484) float64 \nINFO:root:cell size: 31.664585834253515 m \nINFO:root:adjusted print res from the requested 0.4 mm to 0.4132231404958678 mm to ensure correct model dimensions \nINFO:root:total model size in mm: 200 x 379.3388429752066 \nINFO:root:map scale is 1 : 76628.2977188935 \nINFO:root:Cells per tile (x/y) 484 x 918 \nINFO:root:using single-core only \n geotiff size: 0.701390266418457 Mb \n cell size 31.664585834253515 m, upper left corner (x/y): 416262.6453770967 4668753.1937456755 \nTime to add GPX paths:0.002991914749145508 \nomitting cells with elevation < -16384 \nfull (untiled) raster (height,width): (918, 484) float64 \ncell size: 31.664585834253515 m \nadjusted print res from the requested 0.4 mm to 0.4132231404958678 mm to ensure correct model dimensions \ntotal model size in mm: 200 x 379.3388429752066 \nmap scale is 1 : 76628.2977188935 \nelev min/max : 255.85 to 367.50\nCells per tile (x/y) 484 x 918 \nusing single-core only \nprocessing tile: 1 1\ntop min/max: 0.5 1.9571362114978865\ncreating internal triangle data structure for <_MainProcess(MainProcess, started)>\nException ignored in: <socket.socket fd=1352, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('10.24.220.56', 53459), raddr=('172.217.4.205', 443)>\nResourceWarning: unclosed <socket.socket fd=1352, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('10.24.220.56', 53459), raddr=('172.217.4.205', 443)>\nException ignored in: <socket.socket fd=2148, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('10.24.220.56', 53460), raddr=('172.217.4.42', 443)>\nResourceWarning: unclosed <socket.socket fd=2148, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('10.24.220.56', 53460), raddr=('172.217.4.42', 443)>\nException ignored in: <socket.socket fd=572, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('10.24.220.56', 53461), raddr=('172.217.4.42', 443)>\nResourceWarning: unclosed <socket.socket fd=572, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('10.24.220.56', 53461), raddr=('172.217.4.42', 443)>\nException ignored in: <socket.socket fd=1368, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('10.24.220.56', 55662), raddr=('172.217.1.45', 443)>\nResourceWarning: unclosed <socket.socket fd=1368, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('10.24.220.56', 55662), raddr=('172.217.1.45', 443)>\nException ignored in: <socket.socket fd=1060, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('10.24.220.56', 55663), raddr=('216.58.192.138', 443)>\nResourceWarning: unclosed <socket.socket fd=1060, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('10.24.220.56', 55663), raddr=('216.58.192.138', 443)>\nException ignored in: <socket.socket fd=3784, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('10.24.220.56', 55664), raddr=('216.58.192.138', 443)>\nResourceWarning: unclosed <socket.socket fd=3784, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('10.24.220.56', 55664), raddr=('216.58.192.138', 443)>\nException ignored in: <socket.socket fd=3808, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('10.24.220.56', 55698), raddr=('216.58.192.138', 443)>\nResourceWarning: unclosed <socket.socket fd=3808, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('10.24.220.56', 55698), raddr=('216.58.192.138', 443)>\n10 % <_MainProcess(MainProcess, started)>\n20 % <_MainProcess(MainProcess, started)>\n30 % <_MainProcess(MainProcess, started)>\n40 % <_MainProcess(MainProcess, started)>\n50 % <_MainProcess(MainProcess, started)>\n60 % <_MainProcess(MainProcess, started)>\n70 % <_MainProcess(MainProcess, started)>\n80 % <_MainProcess(MainProcess, started)>\n90 % <_MainProcess(MainProcess, started)>\n100% <_MainProcess(MainProcess, started)> \n\nWriting tile into temp. file c:\\Users\\charding\\Box\\TouchTerrain\\TouchTerrain_for_CAGEO\\tmp\\myterrain11.tmp\nassembling binary stl from 906556 triangles\n10 %, 20 %,30 %, 40 %,50 %, 60 %,70 %, 80 %,90 %, 100 %,\n\ntile 1 1 STLb 43.2280387878418 Mb \nINFO:root:\n1 x 1 tiles, tile size 200.00 x 379.34 mm\n \n\n1 x 1 tiles, tile size 200.00 x 379.34 mm\n \nINFO:root:tile 1 1 : height: 0.5 - 1.9571362114978865 mm , file size: 43 Mb \nINFO:root:\ntotal size for all tiles: 43 Mb \nINFO:root:added full geotiff as NED_-93.92_42.04.tif \nINFO:root:\nprocessing finished: 17:05:15.942335 \ntile 1 1 : height: 0.5 - 1.9571362114978865 mm , file size: 43 Mb \n\ntotal size for all tiles: 43 Mb \nzip finished: 17:05:15.921391\nadded full geotiff as NED_-93.92_42.04.tif \n\nprocessing finished: 17:05:15.942335 \n\nDONE!\n\nCreated zip file tmp\\myterrain.zip 43.93 Mb\nError removing tmp\\myterrain_dem.tif [WinError 32] The process cannot access the file because it is being used by another process: 'tmp\\\\myterrain_dem.tif'\nError removing logfile tmp\\myterrain.log [WinError 32] The process cannot access the file because it is being used by another process: 'tmp\\\\myterrain.log'\n"
}
],
"outputs": [],
"source": [
"\n",
"totalsize, full_zip_file_name = TouchTerrain.get_zipped_tiles(**args) # args are in a dict\n",
Expand All @@ -406,18 +358,12 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": null,
"metadata": {
"scrolled": true,
"tags": []
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": "unzipped files from tmp\\myterrain.zip into the folder tmp\\myterrain\ntmp\\myterrain contains these files:\n tmp\\myterrain\\logfile.txt\n tmp\\myterrain\\NED_-108.14_44.61.tif\n tmp\\myterrain\\NED_-108.14_44.61_tile_1_1.STL\n tmp\\myterrain\\NED_-93.92_42.04.tif\n tmp\\myterrain\\NED_-93.92_42.04_tile_1_1.STL\n"
}
],
"outputs": [],
"source": [
"# If you want to unzip the zip file, run this cell\n",
"# (You will need to do this before using k3d for visualization)\n",
Expand Down Expand Up @@ -483,7 +429,7 @@
"kernelspec": {
"display_name": "Python 3.7.3 64-bit ('base': conda)",
"language": "python",
"name": "python_defaultSpec_1599507001018"
"name": "python_defaultSpec_1599516359090"
},
"language_info": {
"codemirror_mode": {
Expand Down

0 comments on commit 90af0f5

Please sign in to comment.