Loading TOC...

MarkLogic Server 11.0 Product Documentation
cts:geospatial-region-path-reference

cts:geospatial-region-path-reference(
   $path-expression as xs:string,
   [$options as xs:string*],
   [$namespaces as map:map],
   [$geohash-precision as xs:integer?],
   [$units as xs:string?],
   [$invalid-values as xs:string?]
) as cts:reference

Summary

Create a reference to a geospatial region path index, for use as a parameter to cts:geospatial-region-query and other query operations on geospatial region indexes. This function throws an exception if the specified region path index does not exist.

Parameters
path-expression The XPath expression specified in the index configuration.
options Index configuration options. The default is (). These options should match the configuration used when creating the index. Available options:
"coordinate-system=string"
Use the given coordinate system. Valid values are:
wgs84
The WGS84 coordinate system with degrees as the angular unit.
wgs84/radians
The WGS84 coordinate system with radians as the angular unit.
wgs84/double
The WGS84 coordinate system at double precision with degrees as the angular unit.
wgs84/radians/double
The WGS84 coordinate system at double precision with radians as the angular unit.
etrs89
The ETRS89 coordinate system.
etrs89/double
The ETRS89 coordinate system at double precision.
raw
The raw (unmapped) coordinate system.
raw/double
The raw coordinate system at double precision.
"precision=value"
Use the coordinate system at the given precision. Allowed values: float (default) and double.
"unchecked"
Read the coordinate-system info only from the input. Do not check the definition against the context database.
namespaces A map of namespace bindings. The keys should be namespace prefixes and the values should be namespace URIs. These namespace bindings will be added to the in-scope namespace bindings in the interpretation of the path.
geohash-precision The geohash precision specified in the index configuration. Values between 1 and 12 inclusive are possible.
units The units specified in the index configuration. 'miles', 'km', 'feet', and 'meters' are valid.
invalid-values The invalid values setting specified in the index configuration. 'reject' and 'ignore' are valid.

Usage Notes

The value of the precision option takes precedence over that implied by the governing coordinate system name, including the value of the coordinate-system option. For example, if the governing coordinate system is "wgs84/double" and the precision option is "float", then the reference uses single precision. An exception is thrown if an index with the specified precision does not exist.

See Also

Example

cts:geospatial-region-path-reference("//item/region")

=> A region path index reference of the following form:

   cts:geospatial-region-path-reference(
     "//item/region",("coordinate-system=wgs84"))
  

Example

cts:geospatial-region-path-reference(
  "//item/region", ("precision=double", "coordinate-system=wgs84")

=> A region path index reference of the following form:

  cts:geospatial-region-path-reference(
    "//item/region",("coordinate-system=wgs84/double"))
  

Example

cts:geospatial-region-path-reference(
  "//item/region", ("precision=double", "coordinate-system=wgs84"), (), 4, "miles", "reject")

=> A region path index reference of the following form:

  cts:geospatial-region-path-reference(
    "//item/region",("coordinate-system=wgs84/double"),("geohash-precision=4"),("units=miles"),("invalid-values=0"))
  

Example

xquery version "1.0-ml";
let $namespaces := map:map()
let $_ := map:put($namespaces, "kml", "http://www.opengis.net/kml/2.2")
return cts:geospatial-region-path-reference(
  "//kml:LinearRing/kml:coordinates", (),$namespaces)

=> A region path index reference of the following form:

  cts:geospatial-region-path-reference(
    "//kml:LinearRing/kml:coordinates",("coordinate-system=wgs84"),map:map(...))
  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.