-
Notifications
You must be signed in to change notification settings - Fork 5
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
Feature shapefile upload #445
Conversation
This pull request is being automatically deployed with Vercel (learn more). marxan – ./app🔍 Inspect: https://vercel.com/vizzuality1/marxan/9FaFDs7aPnBc7AvkLpTiFZyh5JF5 marxan-storybook – ./app🔍 Inspect: https://vercel.com/vizzuality1/marxan-storybook/A3SAfAS5aKsVUo2NKqgekoM5Je1t |
@@ -258,4 +269,91 @@ export class GeoFeaturesService extends AppBaseService< | |||
): Promise<GeoFeature> { | |||
return entity; | |||
} | |||
|
|||
public async createFeaturesForShapefile( |
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.
transactions here are little bit sketchy, since I'm writing data to 2 separate DBs 🤔 if you think of a better solution let me know 😄
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.
yes, it occurred to me with a huge 🤦🏼 when I saw your PR while trying to help with the makevalid bit - I think what you do here will be fine in most circumstances. if we do run into issues in a substantive way I'd think about a final check both in case of success or failure, but since I'm thinking about a grim reaper/garbage collection feature that we will need in any case to be able to invalidate stuff when users edit settings earlier on in the workflow, this - if needed at all - could be done when we implement that.
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.
Thanks @ikas! Epic PR, thanks so much for your dedication this week 🙇🏼
I'd ask @aagm to please cross check that there are no blind spots (which, if any, would mainly be due to blind spots in my specification, tbh) before merging, though I'm itching to merge RIGHT NOW so that I can use this feature via bots I'm working on 😅
oh well I hadn't notice the test failures - though they all seem to be identical and only due to an import lookup issue, so this should be easy to fix (if you get stuck, probably Dominik can help fixing this while blindfolded) |
55acf0e
to
fc227e8
Compare
api/apps/api/src/modules/geo-features/geo-feature.geo.entity.ts
Outdated
Show resolved
Hide resolved
6f63202
to
0d35639
Compare
0d35639
to
6c5b589
Compare
6c5b589
to
08b203e
Compare
Feature shapefile upload
Overview
This PR adds a new endpoint
POST /api/v1/projects/:id/features/shapefile
that allows users to upload feature shapefiles.To use this endpoint, you'll need to provide a
.zip
file containing the different format files that compose a shapefile, and send it asmultipart/form-data
to the endpoint specified above.The upload happens synchronously, so once you receive the response, the data should already be available in the database. Also, keep in mind there's a limit on the maximum size of the uploaded file, currently set to 100MB (this limit is configurable via env vars).
Designs
Figma
This PR does not contain the implementation of the UI for this feature, just the BE side of things.
Testing instructions
Use the new endpoint and check that data gets correctly imported to the databases (API and geo) - check the JIRA ticket below for more details on where the data should be placed.
Feature relevant tickets
MARXAN-543
Checklist before submitting
develop
.deploying to staging/production, please add brief testing instructions
to the deploy checklist (
docs/deployment-checklist.md
)