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

sbJson 2.0 spatial #74

Closed
2 tasks done
stansmith907 opened this issue Mar 9, 2017 · 4 comments
Closed
2 tasks done

sbJson 2.0 spatial #74

stansmith907 opened this issue Mar 9, 2017 · 4 comments

Comments

@stansmith907
Copy link
Contributor

stansmith907 commented Mar 9, 2017

Mapping of sbJson spatial to mdTranslator internal data structure:

  • reader complete
  • writer complete
{
   "spatial": {
      "representationalPoint": [123,23],
      "representationalPointIsDerived": false,
      "boundingBox": {
         "maxY": 23.22,
         "maxX": 12.12,
         "minX": 23.21,
         "minY": 43
      }
   }
}

Definition: This is the spatial representation of the item.

Mapping...

  • representationalPoint: A collection of two points (saved as Doubles). The first value is latitude and must be within -180 & +180. The second value is the longitude and must be within -90 & 90.
    Map to: [schema][metadata][resourceInfo][extents][n][geographicExtents][n][geographicElement][n][geographicElements][n].type = 'Feature'
    view mdTools
    Map to: [schema][metadata][resourceInfo][extents][n][geographicExtents][n][geographicElement][n][geographicElements][n].id= 'representationalPoint'
    view mdTools
    Map to: [schema][metadata][resourceInfo][extents][n][geographicExtents][n][geographicElement][n][geographicElements][n][geometryObject].type= 'Point'
    view mdTools
    Map to: [schema][metadata][resourceInfo][extents][n][geographicExtents][n][geographicElement][n][geographicElements][n][geometryObject].coordinates
    view mdTools
  • representationalPointIsDerived: Whether or not the representational point is derived. This is generally false.
    Map to: [schema][metadata][resourceInfo][extents][n][geographicExtents][n][geographicElement][n][geographicElements][n][properties].acquisitionMethod = 'notDerived'
    view mdTools
  • boundingBox: The bounding box of an item. The maxY, minY, maxX, minX represent the four corners of the bounding box.
    Map to: **[schema][metadata][resourceInfo][extents][n][geographicExtents][n][geographicElement][n][geographicElements][n].bbox
    view mdTools

Mapping to mdTranslator

   def newBase
      intObj = {
         metadata: {
            resourceInfo: {
               extents: [
                  {
                     description: nil,
                     geographicExtents: [
                        {
                           containsData: true,
                           identifier: {},
                           boundingBox: {},
                           geographicElement: [
                              {
                                 nativeGeoJson: [],
                                 geographicElements: [
                                    {
                                       type: 'Feature',
                                       id: 'representationalPoint',
                                       bbox: [12.12, 43, 23.21, 23.22],
                                       geometryObject: {
                                          type: 'Point',
                                          coordinates: [123, 23]
                                       },
                                       properties: {
                                          featureNames: [],
                                          description: nil,
                                          identifiers: [],
                                          featureScope: nil,
                                          acquisitionMethod: 'notDerived'
                                       },
                                       computedBbox: []
                                    }
                                 ],
                                 computedBbox: {}
                              }
                           ]
                        }
                     ],
                     temporalExtents: [],
                     verticalExtents: []
                  }
               ]
            }
         }
      }
   end

Translation to mdJson

{
   "metadata": {
      "resourceInfo": {
         "extent": [
            {
               "geographicExtent": [
                  {
                     "containsData": true,
                     "identifier": {},
                     "boundingBox": {},
                     "geographicElement": [
                        {
                           "type": "Feature",
                           "id": "representationalPoint",
                           "bbox": [12.12, 43, 23.21, 23.22],
                           "geometry": {
                              "type": "Point",
                              "coordinates": [123, 23]
                           },
                           "properties": {
                              "featureName": [],
                              "description": "",
                              "includesData": true,
                              "temporalElement": {},
                              "verticalElement": [],
                              "identifier": [],
                              "featureScope": "",
                              "featureAcquisitionMethod": "notDerived"
                           }
                        }
                     ]
                  }
               ]
            }
         ]
      }
   }
}
@stansmith907
Copy link
Contributor Author

Spatial objects in mdJson are encoded in the GeoJSON standard. I have represented the spatial object as a single GeoJSON Feature class. This translation can be seen in the 'Translation to mdJson' section above. The same 'GeoJson' object will be inserted into the geographicElements's 'nativeGeoJson' object so that it can be used by other writers such as the html writer.

Since the derivation method is Boolean I coded the 'featureAcquisitionMethod' to be either 'derived' or 'notDerived'.

@stansmith907
Copy link
Contributor Author

I need to know the order of the bounding box coordinates. min and max are possibly ambiguous. Is maxX the most East or West? Is maxY always the most North regardless of hemisphere?

@jlblcc
Copy link
Member

jlblcc commented Mar 28, 2017

boundingBox should map to http://mdtools.adiwg.org/#viewer-page?v=1-0-5-0-3-2-2-0-1-0-2

spatial->boundingBox in sbJSON output will need to include ALL geometries for the entire mdJSON record.

@stansmith907
Copy link
Contributor Author

stansmith907 commented Jun 8, 2017

mdTranslator readers compute a bbox for each geographic extent. For sbJson compute a new single bbox using all the computed bbox as geometries.
Ignore representational point.
If a geographic extent has only a user provided bounding box and not geometries, accept the user bbox.
If an extent has both geographic extents with objects and at least one geographic extent with only a bbox, include the user provided bbox in the computation for a single sbJson bbox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants