subsurface icon indicating copy to clipboard operation
subsurface copied to clipboard

Loading GIS data

Open Leguark opened this issue 5 years ago • 4 comments

  • [ ] cpg -> https://github.com/GeospatialPython/pyshp
  • [ ] dbf -> https://dbfread.readthedocs.io/en/latest/
  • [ ] prj -> ?
  • [ ] qpj
  • [ ] shp -> https://github.com/GeospatialPython/pyshp
  • [ ] shx
  • [ ] ers https://gdal.org/drivers/raster/ers.html

Leguark avatar Sep 17 '20 12:09 Leguark

@AlexanderJuestel of these formats which ones are you already able to read in gemgis?

Leguark avatar Sep 17 '20 12:09 Leguark

Hey,

  • [x] cpg, dbf, prj, shx und shp are vector files and belong together. What we read with geopandas is the shape file (shp) with all associated files.

shp - shape format - the feature geometry itself shx - shape index format - a positional index of the feature to allow seeking forwards and backwards quickly dbf - attribute format - columnar attributes for each shape cpg - used to specify the code page prj - projection description

Here how one set of files look like image

  • [ ] ers - have not tested them yet as I did not have sample data in that format. But as rasterio is based on GDAL, it should be able to read it.

AlexanderJuestel avatar Sep 17 '20 12:09 AlexanderJuestel

So technically we "only" need geopandas for this formats? For subsurface I am trying to keep all those libraries optional (i.e. you only need to install them if you want to load that specific type of data).

@AlexanderJuestel if I prepare you the module and test do you want to give a go to this issue?

Leguark avatar Sep 21 '20 07:09 Leguark

Sorry for the late reply.

Geopandas should be sufficient. Lately, I have worked much more with shapely though. Each GeoSeries in a GeoDataFrame consists of a shapely object and you can do all sorts of operations on these objects. The data is usually opened with Fiona. So what I usually do now is to build a GeoDataFrame as last step of each working process to have a better visualization for the user :)

AlexanderJuestel avatar Nov 21 '20 13:11 AlexanderJuestel