NASA-IMPACT / veda-ui

Frontend for the Dashboard Evolution project
Other
25 stars 5 forks source link

fix: Polygon simplification on E&A page #1268

Open hanbyul-here opened 1 week ago

hanbyul-here commented 1 week ago

Close https://github.com/NASA-IMPACT/veda-ui/issues/1267, Close https://github.com/US-GHG-Center/veda-config-ghg/issues/648

Description of Changes

Increased the limit of the number of each polygon. Separated out a function that handles the aoi validation for an easy test and better readability. Fix error handling.

Notes & Questions About Changes

The number that I ended up with is an outcome of my experiment with our GHG endpoint, details are in : https://github.com/US-GHG-Center/veda-config-ghg/issues/648#issuecomment-2487390157

I think our current setup was more for multiple simple polygons - and this setup is more for 1 complicated polygon (which also hopefully covers the multiple simple polygons case.)

Validation / Testing

We should test with GHG endpoint because of AWS setup there, I made a preview link : https://deploy-preview-664--ghg-demo.netlify.app/exploration

netlify[bot] commented 1 week ago

Deploy Preview for veda-ui ready!

Name Link
Latest commit c3138aafc7b282e42963c8d703453313cd1f6865
Latest deploy log https://app.netlify.com/sites/veda-ui/deploys/6747cb021ec198000886758b
Deploy Preview https://deploy-preview-1268--veda-ui.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

aboydnw commented 1 week ago

hm, I'm not able to get anything to load. Here are the files I tried:

Alabama_State_Boundary-shp.zip bs.shp.zip alabama state geojson Indianapolis geojson

Each time I get this error: image

hanbyul-here commented 3 days ago

@aboydnw Thanks for testing and catching the bug that I pushed at the last minute 😓 Please test it again when you have a chance.

aboydnw commented 1 day ago

This seems to be working much better now! The shape for Indianapolis still doesn't show exactly accurate, but now it seems to be because rings are not supported, which I think is an acceptable limitation.

image

image

I was able to upload a fairly complex shapefile and it worked well. I think this should give folks at AGU more ability to find a shapefile that works @Jeanne-le-Roux @slesaad image