earthcube/stacIndexer

Transform the STAC Coordinates from X Y to Y X (aka lat lon) in the JSON-LD output

Closed this issue · 1 comments

Community is correct:
from stac spec:

Coordinates are specified in Longitude/Latitude or Longitude/Latitude/Elevation based on WGS 84.

Stacindexer needs to be output to match the expectation of our system (aka lat lon).
Change the STAC Coordinates from X Y to Y X (aka lat lon)

Fragment from the original metadata:

  "bbox": [-149.2133, 42.5369, -72.1727, 63.8758],
  "geometry": {
    "type": "MultiPoint",
    "coordinates": [
      [-72.1727, 42.5369],
      [-149.2133, 63.8758]
    ]
  },

Desired output (flip coords, add comma)

 "spatialCoverage": {
        "@type": "Place",
         "geo": {
            "@type": "GeoShape",
            "box": "42.5369,-149.2133 63.8758,-72.1727"
        },
      "additionalProperty": {
            "@type": "PropertyValue",
            "propertyID":"http://dbpedia.org/resource/Spatial_reference_system",
            "value": "http://www.w3.org/2003/01/geo/wgs84_pos#lat_long"
          }
}

original issue:

https://ecoforecast.geocodes-aws.earthcube.org/#/dataset/urn:gleaner.io:eco:neon4cast:data:6d93155475fb6f23307db529b3bbdb6fdb05083d

Think it is this 'dataset'
https://radiantearth.github.io/stac-browser/#/external/raw.githubusercontent.com/eco4cast/neon4cast-ci/main/catalog/scores/Phenology/Daily_Green_chromatic_coordinate/models/ChlorophyllCrusaders.json
This metadata
https://raw.githubusercontent.com/eco4cast/neon4cast-ci/main/catalog/scores/Phenology/Daily_Green_chromatic_coordinate/models/ChlorophyllCrusaders.json

bad coordinate conversion in stac indexer.

Fragment from the original metadata:

  "bbox": [-149.2133, 42.5369, -72.1727, 63.8758],
  "geometry": {
    "type": "MultiPoint",
    "coordinates": [
      [-72.1727, 42.5369],
      [-149.2133, 63.8758]
    ]
  },

Fragment from the JSON-LD:

 "spatialCoverage": {
        "@type": "Place",
          "geo": 
          {
          "@type": 
          "GeoShape",
          "box": 
          "-149.2133 42.5369 -72.1727 63.8758"
   }
}

also filed issue against facetsearch.
this will basically need to check if there is a coord specified, and also guess if coords appear out of order

earthcube/facetsearch#143