Gridding tutorial boundary gotchas #140
Replies: 2 comments 14 replies
-
|
@joshuacortez -- just clarifying: in the
|
Beta Was this translation helpful? Give feedback.
-
|
Is addressed by #253
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In the gridding tutorial, the bounding box was directly computed from the epsg:4326 admin bounds
aoi_total_bounds = region3_gdf.total_boundsThese bounds were then passed to
SquareGridGeneratorgrid_generator1k = grids.SquareGridGenerator(1_000, boundary=aoi_total_bounds)In my own use case, I tried to make 100x100m grid cells across the entire Indonesian coastline. In the same way as the tutorial, I computed the bounding box on the epsg:4326 geodataframe, and passed them to
SquareGridGenerator.However I found that there was a significant number of missing grid cells on the northwestern side of Indonesia.

There are supposed to be tiles along Aceh's coast. The image below shows what should have been there. (tiles are smaller since they're from a separate run)

After some investigation, I found that it had to do with the bounding box. I should have computed the bounding box on the projected admin boundaries, not the epsg:4326 admin boundaries. Even if the
proj_crsis specified inSquareGridGenerator, we’ll still have this error because the bounding box (computed from epsg:4326) was already distorted to begin with.I resolved the issue by generating the bounding box from the projected admin bounds instead of the epsg:4326 admin bounds, and used
SquareGridBoundaryas followsboundary = grids.SquareGridBoundary(*proj_admin_bounds_bbox)After passing this
boundarytoSquareGridGenerator, tiles now show up along Aceh's coast.So technically this isn't a bug with geowrangler itself but it's definitely something to watch out for. Hopefully other people won't make the same mistake. I was thinking if we should be explicit about this in the tutorial. We could:
Let me know what you think! :)
Beta Was this translation helpful? Give feedback.
All reactions