kylebarron / demquery Goto Github PK
View Code? Open in Web Editor NEWWrapper around rasterio to query points on a Digital Elevation Model
License: MIT License
Wrapper around rasterio to query points on a Digital Elevation Model
License: MIT License
Add a couple tests with low resolution DEM data. Not sure what the lowest-resolution dem would be. An SRTM tile from here is 35MB zipped.
Something that size is probably a good size to download (and cache) for tests, but not to include in the repository.
Conda is still on 0.2.0 I believe
Trying to add elevation values to a map of Amsterdam using TIFs from pdok.nl. I'm confident that the TIF files actually cover all of the graph.
Here is the code I ran:
dem_paths = glob.glob("../data/netherlands_dem_5m/*.tif")
graph = ox.graph.graph_from_place(name, network_type="walk")
test_elev = add_node_elevations_from_dem(graph.nodes, dem_paths, interp_kind="linear")
t = dict((k, test_elev[k]['elevation']) for k in test_elev.keys())
nx.set_node_attributes(graph, name="elevation", values=t)
ox.save_graphml(G=graph, filepath=f"../data/{name}.graphml")
And the error message:
File "C:\Users\craig\Documents\Embarc\Coding\elevation_injector\src\netherlands_query.py", line 22, in <module>
test_elev = add_node_elevations_from_dem(graph.nodes, dem_paths, interp_kind="linear")
File "C:\Users\craig\Documents\Embarc\Coding\elevation_injector\src\dem_elevation.py", line 32, in add_node_elevations_from_dem
elevations = query.query_points(points)
File "C:\Users\craig\Anaconda3\envs\embarc\lib\site-packages\demquery\demquery.py", line 74, in query_points
self._check_bounds(dem, points, num_buffer=num_buffer)
File "C:\Users\craig\Anaconda3\envs\embarc\lib\site-packages\demquery\demquery.py", line 150, in _check_bounds
assert maxrow <= dem.height
AssertionError
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.