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

chore(api): scenario cost surfaces shell #174

Merged
merged 5 commits into from
May 18, 2021
Merged

Conversation

kgajowy
Copy link
Contributor

@kgajowy kgajowy commented May 13, 2021

Proposal of flow/structures for cost surface shapefile upload

Overview

Please write a description. If the PR is hard to understand, provide a quick explanation of the code.

Designs

Link to the related design prototypes (if applicable)

Testing instructions

Please explain how to test the PR: ID of a dataset, steps to reach the feature, etc.

Feature relevant tickets

https://vizzuality.atlassian.net/browse/MARXAN-291


Checklist before submitting

  • Meaningful commits and code rebased on develop.
  • If this PR adds feature that should be tested for regressions when
    deploying to staging/production, please add brief testing instructions
    to the deploy checklist (docs/deployment-checklist.md)
  • Update CHANGELOG file

@vercel
Copy link

vercel bot commented May 13, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

marxan – ./app

🔍 Inspect: https://vercel.com/vizzuality1/marxan/FKPKyAo9rzG29zjvap36nBufq3Za
✅ Preview: https://marxan-git-chore-marxan-291-shell-vizzuality1.vercel.app

marxan-storybook – ./app

🔍 Inspect: https://vercel.com/vizzuality1/marxan-storybook/B7Jy7PuvtSFF4VFkNEwww45BHGue
✅ Preview: https://marxan-storybook-git-chore-marxan-291-shell-vizzuality1.vercel.app

@kgajowy kgajowy requested a review from hotzevzl May 13, 2021 12:58
Copy link
Member

@hotzevzl hotzevzl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kgajowy thank you. The shell looks ok. I would still prefer to have geo-jobs be self-contained in the geoprocessing service, especially where we don't need to send back anything to the API client, but between ApiEvents and other bits, it's true that there is quite some code we'd need to share or (heavens forbid) duplicate between API and geoprocessing service.

In this case, maybe we could simplify the process a bit by handling just a bit more than shp->geojson transformation in the geoprocessing service: we'll only need the id of each planning unit and the associated cost, so we can get the geoprocessing service to return that, and get back a (potentially) much smaller payload

api/src/decorators/shapefile.decorator.ts Outdated Show resolved Hide resolved
Comment on lines 28 to 31
geo: {
features: [],
type: 'FeatureCollection',
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could probably be a plain list of ids and associated cost value

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would refrain from putting more logic there. We already have analysis module which handles validation of integrity and persistence - the facade is "only" connecting those two pieces together (i.e. rest->shapefile->geo->process)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revisited in 1a12fbb

@kgajowy kgajowy deleted the chore/MARXAN-291-shell branch May 18, 2021 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants