thinkingmachines / geowrangler

🌏 A python package for wrangling geospatial datasets
https://geowrangler.thinkingmachin.es/
MIT License
47 stars 14 forks source link

BingTileGridGenerator very slow for country-wide generations at high resolutions #212

Closed alronlam closed 1 month ago

alronlam commented 1 year ago

For PH Bing Tile Zoom Level 16, it takes ~24 hours to generate as reported by @tm-dafrose-bajaro using commit https://github.com/thinkingmachines/geowrangler/commits/4b6292354c16b8676f868b7d69e505930730687b

Here's a minimal code snippet to replicate:

!wget https://media.githubusercontent.com/media/wmgeolab/geoBoundaries/a6ef6576d347e3885a3ec4891b95b26e76668cbe/releaseData/gbOpen/PHL/ADM0/geoBoundaries-PHL-ADM0-all.zip 
!unzip geoBoundaries-PHL-ADM0-all.zip 

import geopandas as gpd
from geowrangler.grids import BingTileGridGenerator

gdf = gpd.read_file("geoBoundaries-PHL-ADM0_simplified.geojson").set_crs("epsg:4326")
grids_gdf = BingTileGridGenerator(16).generate_grid(gdf)

Is there any way we can speed this up?

joshuacortez commented 1 month ago

Addressed by #245

I did a test for the given dataset it only takes 3 seconds for FastBingTileGridGenerator

joshuacortez commented 1 month ago

@alronlam see sample usage here! The faster grid generator is merged to master already