loicdtx / pygadm

Easy access to administrative boundary data with python
16 stars 2 forks source link

use geopandas dataframe as main output #3

Closed 12rambau closed 1 year ago

12rambau commented 2 years ago

In the current implementation of the lib, files are read by fiona and transformed into GeoJSON. On the other hand, GeoDataframe are starting to become widely used and they also support json outputs.

What would you think if the main output of the lib was a GDF and the json dict an extra format ?

loicdtx commented 2 years ago

I'm not really in favour of making that change, I'd rather keep the whole thing lightweight with minimal dependencies. Also I agree that geodataframes are a convenient and widely used data structure, but I assure you that the GeoJson based mapping returned by fiona isn't something exotic either :slightly_smiling_face:

My recommendation would be to indicate in the documentation how to convert a feature collection into a geodataframe (a simple gpd.GeoDataFrame.from_features(fc, crs='EPSG:4326') should do I think).

12rambau commented 2 years ago

I'll close the issue when the documentation will be running