Loading TOC...

cts:circle

cts:circle(
   $radius as xs:double,
   $center as cts:point
) as cts:circle

Summary

Returns a geospatial circle value.

Parameters
$radius The radius of the circle. The units for the radius is determined at runtime by the query options (miles is currently the only option).
$center A point representing the center of the circle.

See Also

Example

cts:circle(20, cts:point(37.655983, -122.425525))

=> @20 37.655983,-122.42552 (as a cts:circle)

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

Comments

The commenting feature on this page is enabled by a third party. Comments posted to this page are publicly visible.
  • you can use circles in a cts:search to return a series of points sorted by weight based upon how far away it is from circle center, The following "or query" shows how this can be done by setting the weight of each geospatial query (10, 5, 1). cts:search(collection('somecoll'), cts:or-query( ( cts:element-pair-geospatial-query( xs:QName("row"), xs:QName("x"), xs:QName("y"), cts:circle(10,cts:point($x,$y)), ("coordinate-system=raw"), 10 ), cts:element-pair-geospatial-query( xs:QName("row"), xs:QName("x"), xs:QName("y"), cts:circle(100,cts:point($x,$y)), ("coordinate-system=raw"), 5 ), cts:element-pair-geospatial-query( xs:QName("row"), xs:QName("x"), xs:QName("y"), cts:circle(1000,cts:point($x,$y)), ("coordinate-system=raw"), 1 ) )) )