BritishGeologicalSurvey / pyagsapi

pyagsapi - An AGS Utilities API with AGS v4.x Schema Validation & Converter for .ags<-->.xslx files
https://britishgeologicalsurvey.github.io/pyagsapi/
GNU Lesser General Public License v3.0
12 stars 2 forks source link

32 geojson extract #137

Closed volcan01010 closed 4 months ago

volcan01010 commented 4 months ago

Summary

This merge request adds backend functions that can be used in an /extract_geojson endpoint.

The extract_geojson function accepts a file Path and returns a dictionary representation of the GeoJSON FeatureCollection, raising a ValueError if there is a problem with the file. The concatenate_feature_collections function accepts a list of GeoJSON FeatureCollections and merges the features. It can be used where users have uploaded multiple files.

To test

volcan01010 commented 4 months ago

This merge request adds backend functions that can be used in an /extract_geojson endpoint.

Having said this, just calling the functions at the end of the validation process and including the results in the returned JSON saves the users having to upload the files twice and is probably the least-effort way to include the GeoJSON in any result.

I hadn't really thought about the extra effort in having to upload the files again for a separate endpoint.