[geos-devel] linearRing relation
strk at refractions.net
strk at refractions.net
Wed May 24 04:18:29 EDT 2006
A LinearRing is considered a LineString. If you construct
two polygon with those linearrings as shell you'd get the
expected result.
--strk;
On Wed, May 24, 2006 at 11:32:04AM +0800, zhangjing wrote:
> hi,
>
> Does LinearRing support relational operator? , i have the following code which gives wrong result.
>
>
>
> double xmin,ymin,xmax,ymax;
>
> GEOSCoordSeq seq1=GEOSCoordSeq_create(5,2);
> xmin=0,0,ymin=0.0,xmax=5.0,ymax=5.0;
> GEOSCoordSeq_setX(seq1,0,xmin),GEOSCoordSeq_setY(seq1,0,ymin);
> GEOSCoordSeq_setX(seq1,1,xmax),GEOSCoordSeq_setY(seq1,1,ymin);
> GEOSCoordSeq_setX(seq1,2,xmax),GEOSCoordSeq_setY(seq1,2,ymax);
> GEOSCoordSeq_setX(seq1,3,xmin),GEOSCoordSeq_setY(seq1,3,ymax);
> GEOSCoordSeq_setX(seq1,4,xmin),GEOSCoordSeq_setY(seq1,4,ymin);
> GEOSGeom g1=GEOSGeom_createLinearRing(seq1);
>
> GEOSCoordSeq seq2=GEOSCoordSeq_create(5,2);
> xmin=2,0,ymin=2.0,xmax=3.0,ymax=3.0;
> GEOSCoordSeq_setX(seq2,0,xmin),GEOSCoordSeq_setY(seq2,0,ymin);
> GEOSCoordSeq_setX(seq2,1,xmax),GEOSCoordSeq_setY(seq2,1,ymin);
> GEOSCoordSeq_setX(seq2,2,xmax),GEOSCoordSeq_setY(seq2,2,ymax);
> GEOSCoordSeq_setX(seq2,3,xmin),GEOSCoordSeq_setY(seq2,3,ymax);
> GEOSCoordSeq_setX(seq2,4,xmin),GEOSCoordSeq_setY(seq2,4,ymin);
> GEOSGeom g2=GEOSGeom_createLinearRing(seq2);
>
> char ch=GEOSContains(g1,g2);
>
> //ch == 0
>
> Thanks
> Jing Zhang
More information about the geos-devel
mailing list