Closed volcan01010 closed 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.
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. Theconcatenate_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