[geos-devel] Inconsistent result of "intersection" function

ritesh.s at intech-dmls.in ritesh.s at intech-dmls.in
Wed Jul 24 01:54:38 PDT 2019


Hello,

 

We have found the reason behind the mismatch of results its due to following peace of code

 

PrecisionModel* pm = new PrecisionModel(2.0, 0, 0);

 

 

We have changed it to

 

PrecisionModel* pm = new PrecisionModel();

 

Now are getting the correct result.

 

Thanks,

Ritesh

 

 

From: ritesh.s at intech-dmls.in <ritesh.s at intech-dmls.in> 
Sent: 24 July 2019 11:19
To: 'GEOS Development List' <geos-devel at lists.osgeo.org>
Subject: RE: [geos-devel] Inconsistent result of "intersection" function

 

Hello,

 

Thanks for quick reply, here I am attaching the sample code we have created for interaction function

 

Thanks,

Ritesh

 

From: geos-devel <geos-devel-bounces at lists.osgeo.org <mailto:geos-devel-bounces at lists.osgeo.org> > On Behalf Of Martin Davis
Sent: 23 July 2019 22:54
To: GEOS Development List <geos-devel at lists.osgeo.org <mailto:geos-devel at lists.osgeo.org> >
Subject: Re: [geos-devel] Inconsistent result of "intersection" function

 

It would be easier to see what is going on if you post some code that reproduces the problem.

 

 

On Tue, Jul 23, 2019 at 3:35 AM <ritesh.s at intech-dmls.in <mailto:ritesh.s at intech-dmls.in> > wrote:

Hi,

We are created polygon and line. After performing the intersection function we are getting different values. 

This is the sample code we have implemented using GEOS API (GEOS 3.7.2) .

       Rect = c1.createPolygon(10.78, 10.34, 18.89, 16.64);

      

      line = c1.makeLine(10.78 , 12.34 ,18.89 , 12.34);

 

      point = Rect->intersection (line)

 

1. If given line lies on the polygon we are getting the Expected result.

 

Input: Polygon(10.78, 10.34, 18.89, 16.64);

Input:  makeLine (10.78 , 12.34 ,18.89 , 12.34)

Current  Output from intersection API :  (10.78 , 12.34) (18.89 , 12.34)

Expected Output :  (10.78 , 12.34) (18.89 , 12.34)

 

2.  If given line lies away the polygon we are getting the different result.

Input:  makeLine (8.78 , 12.34 ,20.89 , 12.34)

Current  Output from intersection API:    (11 , 12.3.4) (19 , 12.34)

Expected Output :  (10.78 , 12.34) (18.89 , 12.34)

 

Can you please suggest why this behaviour diffrence is there in API output.

Please let me know any additional information needed from my side.

 

Thanks,

Ritesh

_______________________________________________
geos-devel mailing list
geos-devel at lists.osgeo.org <mailto:geos-devel at lists.osgeo.org> 
https://lists.osgeo.org/mailman/listinfo/geos-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geos-devel/attachments/20190724/d210e342/attachment-0001.html>


More information about the geos-devel mailing list