-
Notifications
You must be signed in to change notification settings - Fork 0
Download GeoJSON and GeoPackage #124
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
Download GeoJSON and GeoPackage #124
Conversation
…data_as_GeoJSON_61
…all_geometries_and_metadata_as_GeoJSON_61
…all_geometries_and_metadata_as_GeoJSON_61
|
@BharatVe Please use pygdal functions for the tests, instead of importing from |
|
@BharatVe because we only use fiona in tests, you can instead add it to requirements-dev.txt, to reduce the footprint of the regular app. |
|
I can move it, but I was also using the Osgeo in the views.py file ( which was not causing any issues with the unit test earlier), so I didn't modify it. However, in the last unit test, it was also causing the error, so I can use Fiona in the views.py as well to solve this issue( and hence put it in requirements.txt) but I can move it to the dev file. |
nuest
left a comment
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.
Hi @BharatVe ! This is a solid first attempt but needs quite a bit more work before it can be merged.
|
Hi Daniel, I ran into the same import error in CI that I had locally avoided by falling back to Fiona: our unit tests on GitHub Actions can’t import osgeo because the GDAL C library and Python bindings aren’t installed in the runner environment by default. Locally GDAL is already present on my machine, so everything passes, but the CI environment needs an explicit setup step. I believe a solution for this is to add
in the GitHub Actions workflow. Would it be alright if I did that. The other option is to stick with the Fiona based approach. |
nuest
left a comment
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.
Please give another optiona a try: add gdal to the requirements.txt (see https://pypi.org/project/GDAL/) and remove the installation of python3-gdal from workflows/ci.yml. Maybe that installs GDAL successfully.
b7186f7 to
cc7994d
Compare
cc7994d to
939e0b8
Compare
|
@BharatVe There are many unresolved conversations up there, many of which are likely outdated. Please go through all of them an mark them as resolved so we can move on with the remaining 2-3 actual issues. Thanks! |
nuest
left a comment
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.
Just one more small change request, but I kindly ask you to fix that in a new PR, so we can finally get your first real contribution into the code. 🥳
| geopackage_size = humanize.naturalsize(os.path.getsize(gpkg_path), binary=True) | ||
| else: | ||
| geopackage_size = None | ||
| ts = os.path.getmtime(json_path) |
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.
You only take the time of one format here, which is fine because all files should be created at he same time. However, what if they are not?
Please load the times of all files here and compare them that they are about the same time, within an hour is fine. Add a log statement here with level warning if the difference is more than an hour.
The code can then proceed as it is, but at least we have a hint in the logs that something may be wrong.
Closes #61
Closes #105
Closes #48
download_geojsonview inpublications/views.pythat serializes Publication objects to GeoJSON./download/geojson/endpoint inpublications/urls.py.