The DISTCARTESIAN
field specifier allows you to find documents that contain fields that define a point (X and Y coordinates) or region that is within a specified distance from a specified point.
You can specify the document position fields either as a pair of fields (corresponding to X and Y coordinate fields), or a single field that uses POINT or POLYGON definitions (in Well-known text format) to specify position information (for example, a unified GeospatialType
field).
If your document location fields contain regions (in Well-known text POLYGON format), the DISTCARTESIAN
operator calculates distances from the geometric center of the region.
FieldText=DISTCARTESIAN{coordX,coordY,dist}:POSITION
where:
coordX
|
is the specified X coordinate. |
coordY
|
is the specified Y coordinate. |
dist
|
is the distance in kilometers from the specified coordinates. |
POSITION
|
The document field or fields that contain the position value. You can use one of the following options to specify location fields:
You can specify multiple options for the location fields, in form NOTE:
If you use multiple position fields or field pairs, IDOL Server cannot match documents where a pair of split geospatial fields occurs interleaved with other geospatial fields. For example, if you use In such cases, you can rewrite the query, in the form |
Example:
FieldText=DISTCARTESIAN{10,11,5}:X:Y
This example matches all documents whose (X,Y) position is within a distance of 5 units of the point (10,11). The position of a document in this example is contained in the fields X
and Y
.
FieldText=DISTCARTESIAN{10,11,5}:POSITION
This example matches all documents whose (X,Y) position is within a distance of 5 units of the point (10,11). The position of a document in this example is contained in the POSITION
field.
The DISTSPHERICAL
field specifier allows you to find documents that contain location fields that define a point (latitude and longitude) or region that is within a specified distance from a specified point.
You can specify the document location fields either as a pair of fields (corresponding to latitude and longitude fields), or a single field that uses POINT or POLYGON definitions (in Well-known text format) to specify location information (for example, a unified GeospatialType
field).
If your document location fields contain regions (in Well-known text POLYGON format), the DISTSPHERICAL
operator calculates distances from the geometric center of the region.
FieldText=DISTSPHERICAL{lat,long,dist}:LOCATION
where:
lat
|
is the latitude. Specify latitude positions south of the equator as negative. |
long
|
is the longitude. Specify longitude positions west of the Greenwich Meridian as negative. |
dist
|
is the distance in kilometers from the specified latitude and longitude. |
LOCATION
|
The document field or fields that contain the location value. You can use one of the following options to specify location fields:
You can specify multiple options for the location fields, in form NOTE:
If you use multiple position fields or field pairs, IDOL Server cannot match documents where a pair of split geospatial fields occurs interleaved with other geospatial fields. For example, if you use In such cases, you can rewrite the query, in the form |
Example:
FieldText=DISTSPHERICAL{37.75,-122.4,20}:LAT:LONG
This example matches all documents whose position is within a 20 kilometer radius of San Francisco (37.75N,122.4W). The latitude and longitude position of a document in this example is contained in the fields LAT
and LONG
, respectively.
FieldText=DISTSPHERICAL{52.2,0.1,20}:LOCATION
This example matches all documents whose position is within a 20 kilometer radius of Cambridge (52.2N,0.1W). The latitude and longitude position of a document in this example is contained in the LOCATION
field.
|