Επεξεργασία

Κοινή χρήση μέσω


ST_ISVALID (NoSQL query)

APPLIES TO: NoSQL

Returns a boolean value indicating whether the specified GeoJSON Point, Polygon, MultiPolygon, or LineString expression is valid.

Syntax

ST_ISVALID(<spatial_expr>)  

Arguments

Description
spatial_expr Any valid GeoJSON Point, Polygon, MultiPolygon, or LineString expression.

Return types

Returns a boolean value.

Examples

The following example how to check validity of multiple objects.

SELECT VALUE {
    valid: ST_ISVALID({ 
        "type": "Point",
        "coordinates": [-84.38876194345323, 33.75682784306348] 
    }),
    invalid: ST_ISVALID({ 
        "type": "Point",
        "coordinates": [133.75682784306348, -184.38876194345323] 
    })
}
[
  {
    "valid": true,
    "invalid": false
  }
]

Remarks

  • The GeoJSON specification requires that points within a Polygon be specified in counter-clockwise order. A Polygon specified in clockwise order represents the inverse of the region within it.