Skip to content
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

Add MultiPolygon Support to Submission Shapes #127

Open
rajadain opened this issue Oct 13, 2022 · 0 comments
Open

Add MultiPolygon Support to Submission Shapes #127

rajadain opened this issue Oct 13, 2022 · 0 comments
Labels
Task 3.3 Django back-end

Comments

@rajadain
Copy link
Contributor

Overview

Currently, a submission is only allowed to have simple polygon shapes:

shape = gis_models.PolygonField(geography=True)

However, a number of real world utility boundaries are complex multipolygons. While we may not support drawing complex multipolygons at this stage, we should still allow users to upload shapefiles or geojsons created elsewhere. To store this, we'll need to change this field to be a MultiPolygon.

Also update any test data and tests to match this.

@rajadain rajadain added the Task 3.3 Django back-end label Oct 13, 2022
@rajadain rajadain mentioned this issue Oct 19, 2022
6 tasks
rajadain added a commit that referenced this issue Nov 2, 2022
If the payload's shape is a zipped shapefile or a geojson,
they will be parsed as shapes and added to the database. In
the case of geojson, the file is parsed and ingested directly.
In the case of zipped shapefiles, we save them to a temporary
directory, then load them via fiona and extract the shape from
within. fiona cannot read files from memory, and the uploaded
files could potentially be really heavy, so doing so helps
manage the load.

These are the only two formats we are supporting at the
moment, more may be added in the future.

This assumes a single Polygon input. Support for MultiPolygons
will be added in #127.
rajadain added a commit that referenced this issue Nov 2, 2022
If the payload's shape is a zipped shapefile or a geojson,
they will be parsed as shapes and added to the database. In
the case of geojson, the file is parsed and ingested directly.
In the case of zipped shapefiles, we save them to a temporary
directory, then load them via fiona and extract the shape from
within. fiona cannot read files from memory, and the uploaded
files could potentially be really heavy, so doing so helps
manage the load.

These are the only two formats we are supporting at the
moment, more may be added in the future.

This assumes a single Polygon input. Support for MultiPolygons
will be added in #127.
rajadain added a commit that referenced this issue Nov 2, 2022
If the payload's shape is a zipped shapefile or a geojson,
they will be parsed as shapes and added to the database. In
the case of geojson, the file is parsed and ingested directly.
In the case of zipped shapefiles, we save them to a temporary
directory, then load them via fiona and extract the shape from
within. fiona cannot read files from memory, and the uploaded
files could potentially be really heavy, so doing so helps
manage the load.

These are the only two formats we are supporting at the
moment, more may be added in the future.

This assumes a single Polygon input. Support for MultiPolygons
will be added in #127.
rajadain added a commit that referenced this issue Nov 4, 2022
If the payload's shape is a zipped shapefile or a geojson,
they will be parsed as shapes and added to the database. In
the case of geojson, the file is parsed and ingested directly.
In the case of zipped shapefiles, we save them to a temporary
directory, then load them via fiona and extract the shape from
within. fiona cannot read files from memory, and the uploaded
files could potentially be really heavy, so doing so helps
manage the load.

These are the only two formats we are supporting at the
moment, more may be added in the future.

This assumes a single Polygon input. Support for MultiPolygons
will be added in #127.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Task 3.3 Django back-end
Projects
None yet
Development

No branches or pull requests

1 participant