[gdal-dev] geometry overlap

Even Rouault even.rouault at mines-paris.org
Tue Sep 25 00:32:43 PDT 2012


Selon Neelima Emmani <neelima.emmani at iictechnologies.com>:

> Hi All,
> I am trying to check, if there is an overlap between two area
> featuretypes.Ex: LNDARE and OBSTRN. Actually in my dataset I have an overlap
> but my code pasted below is returning false value for overlap. Can anyone
> help me out. Here we are trying to code with C#.
>
>  while  ((featLNDARE = layerLNDARE.GetNextFeature()) != null)
>            {
>                geomLNDARE = featLNDARE.GetGeometryRef();
>  while ((featOBSTRN = layerOBSTRN.GetNextFeature()) != null)
>                {
>  geomOBSTRN = featOBSTRN.GetGeometryRef();
>
> bool checkforoverlap=sub_geomLNDARE.Overlaps(sub_geomOBSTRN);
> }
> }

Are you sure that Overlaps() is the right spatial primitive you want to use ?
Perhaps it should be Intersects(). If it is Overlaps(), as A.Overlaps(B) is not
equivalent to B.Overlaps(A), perhaps you could try inverting the object and the
argument.








More information about the gdal-dev mailing list