-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test code: how to download data for a bounding box #1
Comments
Hey @cbeddow! I have a couple of questions:
Why do we need to check if the features exist within the bbox again here?
|
So there are 22 zoom levels on a web map. Zoom level=1 (or maybe 0) is a world map scale, which zoom level 14 is roughly a city-level. Check out this link: https://mapsam.com/map/#14/41.0016/29.0348 In this URL, the format is map/#ZOOM/LONGITUDE/LATITUDE. When you load it, the zoom is at level 14. See the red squares on the map, each of these is a level 14 tile. If you zoom in or out it changes, so test how it looks with a level 5 tile, and a level 18 tile. When we access the raw data of the tile for this Python package, it will always be at level 14 (or the server may reject the call and say no data exists). So If we want to download all data for Istanbul city, we need to probably download data from multiple tiles, each at level 14 size. For example, we can download the geojson here, which has a polygon representing Istanbul: https://spelunker.whosonfirst.org/id/85679237/ Or we can use the bounding box of Istanbul: [27.972623,40.801277,29.915492,41.585109] Either of this should be given to the function, so we can say:
Then we would have a returned function that is a geojson point data format.
For example, in this image if the red is out bounding box, then the tiles with color are the ones which intersect it. We only want to keep point features that fall inside the yellow area, and not the orange area despite those tiles intersecting the bbox, so this second check would filter the partially intersecting tile features. |
Acknowledged and read. I watched the lecture you mentioned above and got through that as well. For now, all this makes sense to me, but I'll definitely ask if I have more questions. Thank you! |
@cbeddow All clear now. Thank you for the thorough answers! |
@OmarMuhammedAli should I close this? |
|
Closing. |
Please take a look at the below Python code and ask any questions or make suggestions to improve the code. This is not our real code, but we will want to make a function that appears like:
get_data(bbox,type,filter)
In this case bbox is the geographic bounding area, type is the API endpoint (points, traffic signs, images, sequences), and filter would likely want to use a format with an operator (>=, ==, <, contains, etc) for the properties of the returned data, for example a map feature in the example code matching the value for a street light, but we could filter also by date > than a given input.
We also want to consider a function that would save the data to file, maybe like
saveGeoJSON(path)
.The text was updated successfully, but these errors were encountered: