esciencecenter-digital-skills / geospatial-python

Introduction to Geospatial Raster and Vector Data with Python
https://esciencecenter-digital-skills.github.io/geospatial-python/
Other
3 stars 0 forks source link

EP7: Add description on how to get the bounding box RD coordinates #51

Closed rogerkuou closed 1 year ago

rogerkuou commented 1 year ago

In EP7, we start directly from a pre-defined bounding box with RD coordinates. It would be good to add some explanation on how we end up in those coordinates.

A possible solution:

  1. Get the coverage and CRS info of the gpkg file without reading.
  2. Using the rough sense of the location of northern Amsterdam, define a rough bbox with a percentile on x/y axes.
  3. Plot out the selected region. See where the AoI is.
  4. Use finer coordinates to Zoom more into the AoI
rogerkuou commented 1 year ago

It turned out that there is no easy way in geopandas to perform file inspection without loading. An alternative can be fiona, which is the backend of geopandas:

import fiona
with fiona.open('data/brpgewaspercelen_definitief_2020.gpkg') as file:
    print(file.bounds)
    print(file.crs)

However to avoid the complexity of the course, we will not show this in the course, but only mention:

  1. we assume an a-priori knowledge of the scope
  2. there are ways like fiona to inspect the file coverage and CRS without loading