|
|
|
|
- Accessing spatial data: using spatial indexes
<Polygon2D variable>.Distance (Function) In french: <Variable Polygone2D>.Distance Calculates the distance between a 2D polygon and another geometry. For geometries other than points, this distance is calculated from the nearest points between the two geometries. Syntax
<Result> = <Geometry A>.Distance(<Geometry B>)
<Result>: Real Distance between nearest points of geometry A and geometry B. - For geometries defined with 2D coordinates, this distance is calculated using the Euclidean (Pythagorean) distance. The distance is returned in the same units as the point coordinates.
- For geometries defined using geographic coordinates, this distance is calculated using the WGS84 reference system, which takes into account the curvature of the earth. The distance is returned in meters.
<Geometry A>: Polygon2D variable Name of the Polygon2D variable to be used. <Geometry B>: Variable containing spatial data Second geometry used. This geometry can correspond to one of the following variable types: Remarks Accessing spatial data: using spatial indexes In a data file, you can apply a filter on spatial data and loop through the file. For example, the filter can be based on the result of <Polygon2D variable>.Distance. It is recommended to use the following syntax to apply a filter on spatial data: FOR EACH File WHERE WLanguage_function(File.Spatial_item, Spatial_variable) where: - WLanguage_function corresponds to <Polygon2D variable>.Distance.
- Spatial_item is a spatial item in the data file. This item must:
- be of type "Geographic data" or "Geometric data".
- be defined as a "Spatial key".
- Spatial_variable is a given spatial variable, used for comparison with the spatial item. This variable can be of type PolygonGeo, Polygon2D, etc.
Remark: The "FOR EACH File" syntax is available but not recommended, as it doesn't use spatial indexes and is therefore not optimized. In this case, the entire data file is looped through: spatial indexes are not used. FOR EACH File IF WLanguage_function(File.Spatial_item, Spatial_variable) = True THEN ... END END Business / UI classification: Business Logic
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|