|
|
|
|
- Parcours des données spatiales : utilisation des index spatiaux
Determines whether an Geometry A contains an Geometry B. Remarks: - If Geometry A contains Geometry B, this means that Geometry B is completely inside Geometry A.. In this case:
- There is no point of Geometry B outside Geometry A: any point on Geometry B is either inside Geometry A, or within its contour.
- There is at least one point inside Geometry B inside Geometry A.
- Difference from GeometryCover function : With the GeometryCover function, it is not necessary to have a point inside Geometry B inside Geometry A. An Polygon covers its contour, but does not contain it.
oPolygone2D_1 is Polygon2D
Linestring2DAddPoint(oPolygone2D_1.Outline, -4.00, -4.00)
Linestring2DAddPoint(oPolygone2D_1.Outline, -4.00, 2.00)
Linestring2DAddPoint(oPolygone2D_1.Outline, 5.00, 2.00)
Linestring2DAddPoint(oPolygone2D_1.Outline, 5.00, -4.00)
Linestring2DAddPoint(oPolygone2D_1.Outline, -4.00, -4.00)
oPolygone2D_2 is Polygon2D
Linestring2DAddPoint(oPolygone2D_2.Outline, -1.00, -2.00)
Linestring2DAddPoint(oPolygone2D_2.Outline, 2.00, 0.00)
Linestring2DAddPoint(oPolygone2D_2.Outline, 2.00, -2.00)
Linestring2DAddPoint(oPolygone2D_2.Outline, -1.00, -2.00)
let p2_dans_p1 = GeometryContain(oPolygone2D_1, oPolygone2D_2)
GeometryWithin(oPolygone2D_2, oPolygone2D_1)
Sintaxis
<Result> = GeometryContain(<Geometry A> , <Geometry B>)
<Result>: Boolean - if Geometry A contains Geometry B,
- False otherwise.
If an error occurs, the ErrorOccurred variable is set to True. To get more details on the error, use ErrorInfo with the errMessage constant.
<Geometry A>: Variable Receiver for spatial data Name of the variable corresponding to the Geometry we want to know if it contains the Geometry B. This Geometry can correspond to one of the following variable types: <Geometry B>: Variable Receiver for spatial data Name of the variable corresponding to the second Geometry handled. This Geometry can correspond to one of the following variable types: Observaciones Parcours des données spatiales : utilisation des index spatiaux Il est possible d'effectuer un parcours sur un fichier de données avec un filtre concernant des données spatiales. Par exemple, le filtre utilisé peut être basé sur le résultat de la fonction FormContains. Pour optimiser ce filtre sur des données spatiales, il est recommandé d'utiliser les index spatiaux via la syntaxe suivante : POUR TOUT Fichier AVEC Fonction_WLangage(Fichier.RubriqueSpatiale, variable_spatiale) où : - Fonction_WLangage correspond à la fonction FormContains.
- Rubrique_spatiale correspond à une rubrique spatiale du fichier de données. Cette rubrique doit :
- être de type "Données géographiques" ou de type "Données géométriques".
- être définie comme une "Clé spatiale".
- Variable_spatiale correspond à une variable spatiale donnée, utilisée pour la comparaison avec comparaison avec la rubrique spatiale. Cette variable est par exemple, une variable de type PolygoneGéo, Polygone2D, etc.
Remarque : Bien que disponible, la syntaxe "POUR TOUT Fichier" n'est pas recommandée car cette syntaxe n'utilisant pas les index spatiaux, ses performances ne sont pas optimisées. Effet, dans ce cas, tout le fichier de données est parcouru : les index spatiaux ne sont pas utilisés. POUR TOUT Fichier SI Fonction_WLangage(Fichier.Rubrique_spatiale, Variable_spatiale) = Vrai ALORS ... FIN FIN Example:
polyGeo is PolygonGeo
polyGeo.Contour.AjoutePoint(0n48.8187479172765, 0n1.9550104465229536)
polyGeo.Contour.AjoutePoint(0n48.685649220185574, 0n2.023674998054354)
polyGeo.Contour.AjoutePoint(0n48.82612543243871, 0n2.2106580854197566)
polyGeo = GeometryCorrect(polyGeo)
nbEnregs is int
FOR EACH DatasCommunes where GeometryContain(DatasCommunes.geometry, polyGeo)
Trace(DatasCommunes.NomCommune)
END
Clasificación Lógica de negocio / UI: Lógica de negocio
Esta página también está disponible para…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|