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.
-
In the gridding tutorial, the bounding box was directly computed from the epsg:4326 admin bounds
aoi_total_bounds = region3_gdf.total_bounds
These bounds were then passed to
SquareGridGenerator
grid_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.
![uncaptured portion](https://user-images.githubusercontent.com/7113605/186683316-f92eac95-4643-4caf-a632-b640fe637101.PNG)
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)
![missing coastline grids](https://user-images.githubusercontent.com/7113605/186683574-e1cdcbca-eaa5-417d-88ac-bed7e4dcd200.PNG)
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_crs
is 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
SquareGridBoundary
as followsboundary = grids.SquareGridBoundary(*proj_admin_bounds_bbox)
After passing this
boundary
toSquareGridGenerator
, 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