NASA-IMPACT / veda-ui

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

[Bug] Issues with EnA geojson/shapefiles upload #1267

Closed slesaad closed 5 days ago

slesaad commented 5 days ago

Context

URL: https://earth.gov/ghgcenter/exploration?datasets=%5B%7B%22id%22%3A%22micasa-co2-flux-npp-m%22%2C%22settings%22%3A%7B%22isVisible%22%3Atrue%2C%22opacity%22%3A100%2C%22analysisMetrics%22%3A%5B%7B%22id%22%3A%22mean%22%2C%22label%22%3A%22Average%22%2C%22chartLabel%22%3A%22Average%22%2C%22themeColor%22%3A%22infographicB%22%7D%5D%2C%22colorMap%22%3A%22purd%22%2C%22scale%22%3A%7B%22min%22%3A0%2C%22max%22%3A8%7D%7D%7D%5D&taxonomy=%7B%7D&search=&date=2023-12-01T06%3A00%3A00.000Z

Blocking a release? (y/n): n

Regression issue? (y/n): n [If yes, add Regression label]

Priority: P1/P2 (requested to fix before AGU)

Steps to reproduce the issue

Shapefile

  1. Go to the EnA page and select a dataset (link)
  2. Click the upload button from the AOI toolkit
  3. Upload the attached shapefile - ua_shp.zip
  4. Get the following error: Image Also, why does the error say "Invalid GeoJSON" when it knows it's a shapefile

The same shapefile zip works fine in https://mapshaper.org/

Geojson

  1. Go to the EnA page and select a dataset (link)
  2. Click the upload button from the AOI toolkit
  3. Upload the linked geojson Indianapolis geojson
  4. The following info is displayed Image
  5. Click "Add Area"
  6. The following shape is added: Image
  7. I think the "simplification" was so aggressive that it doesn't preserve the original shape which looks like this in geojson.io : Image
aboydnw commented 5 days ago

For the first issue, the problem is that the zip file contains many files, only some of which are shapefiles. From some quick testing, if they zip individual shape files, the upload works as intended.

For the second issue, there is an ongoing conversation here, so I'll close this one as duplicate.