-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: geodata reader #156
feat: geodata reader #156
Conversation
e17b569
to
6a12fdd
Compare
6a12fdd
to
be6b0d6
Compare
Codecov Report
@@ Coverage Diff @@
## main #156 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 18 19 +1
Lines 796 806 +10
=========================================
+ Hits 796 806 +10
Continue to review full report at Codecov.
|
peakina/helpers.py
Outdated
@@ -42,7 +43,7 @@ class TypeInfos(NamedTuple): | |||
|
|||
|
|||
# For files without MIME types, we make fake MIME types based on detected extension | |||
CUSTOM_MIMETYPES = {".parquet": "peakina/parquet"} | |||
CUSTOM_MIMETYPES = {".parquet": "peakina/parquet", ".geojson": "application/geo+json"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we okay with enforcing this extension for basemaps ? cf. my comment here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is application/geo+json
really a valid mimetype ? If not, I'd rather have peakina/geo
to make it explicit that this is a custom mimetype. And I agree with fred's comment, the extension for geo files should probably be free (if that's possible in peakina)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if that's possible in peakina
MimeType guessing is not working it seems :/
peakina/readers/geojson.py
Outdated
|
||
|
||
@wraps(gpd.read_file) | ||
def read_file( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe rename this function so it's explicit it's for geographic data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alright 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM overall, but I have a few remarks
peakina/helpers.py
Outdated
@@ -81,6 +86,7 @@ class TypeEnum(str, Enum): | |||
JSON = "json" | |||
PARQUET = "parquet" | |||
XML = "xml" | |||
GEOJSON = "geojson" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should have GEOJSON
here. I'd rather have something like GEODATA
, and let it be a wildcard for everything that can be read by geopandas (even if we only support geojson in laputa for now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay
peakina/helpers.py
Outdated
@@ -42,7 +43,7 @@ class TypeInfos(NamedTuple): | |||
|
|||
|
|||
# For files without MIME types, we make fake MIME types based on detected extension | |||
CUSTOM_MIMETYPES = {".parquet": "peakina/parquet"} | |||
CUSTOM_MIMETYPES = {".parquet": "peakina/parquet", ".geojson": "application/geo+json"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is application/geo+json
really a valid mimetype ? If not, I'd rather have peakina/geo
to make it explicit that this is a custom mimetype. And I agree with fred's comment, the extension for geo files should probably be free (if that's possible in peakina)
3c33f84
to
70c5b7f
Compare
70c5b7f
to
bd79b00
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add a new geojson reader