#236: the project crash
--------------------------------------+-------------------------------------
 Reporter:  aya                       |        Owner:  
[email protected]
     Type:  defect                    |       Status:  new                      
 
 Priority:  major                     |    Milestone:  3.1.0                    
 
Component:  Default                   |      Version:  3.0.3                    
 
 Severity:  Feature Request           |   Resolution:                           
 
 Keywords:  GEOS,Distance,DistanceOp  |  
--------------------------------------+-------------------------------------
Old description:

> I have built two polygons named PG1 and PG2. One is
> (0,0),(1,0),(1,1),(0,1), the other is
> (0.25,0.25),(0.75,0.25),(0.75,0.75),(0.25,0.75). At this time the
> distance returned is 0.25 and closestPoints() returns successfully.
> However, if I move PG2 out of PG1 and run it aggin. The project crashed
> in closestPoints(). The package I use is geos-3.1.0rc2. Now I need to
> find the nearest points of two polygons and the related distance. If
> there is something wrong in my codes or other solution, please tell me in
> time. Thanks.
>
> CoordinateSequence *cs;
>
> cout<<PG1->distance(PG2)<<endl;
> cout<<PG2->distance(PG1)<<endl;
>
> typedef geos::operation::distance::DistanceOp DOP;
>
> DOP *Dis = new DOP(PG1, PG2);
>
> cout<<"in"<<endl;
> cs=Dis->closestPoints();
> cout<<"out"<<endl;

New description:

 I have built two polygons named PG1 and PG2. One is
 (0,0),(1,0),(1,1),(0,1), the other is
 (0.25,0.25),(0.75,0.25),(0.75,0.75),(0.25,0.75). At this time the distance
 returned is 0.25 and closestPoints() returns successfully. However, if I
 move PG2 out of PG1 and run it aggin. The project crashed in
 closestPoints(). The package I use is geos-3.1.0rc2. Now I need to find
 the nearest points of two polygons and the related distance. If there is
 something wrong in my codes or other solution, please tell me in time.
 Thanks.

 {{{
 CoordinateSequence *cs;

 cout<<PG1->distance(PG2)<<endl;
 cout<<PG2->distance(PG1)<<endl;

 typedef geos::operation::distance::DistanceOp DOP;

 DOP *Dis = new DOP(PG1, PG2);

 cout<<"in"<<endl;
 cs=Dis->closestPoints();
 cout<<"out"<<endl;
 }}}

Comment (by mloskot):

 First of all, you have not provided us with complete, compilable and
 runnable code. So, it's hard to answer if there is anything wrong with
 your code.

 1. The polygons you specified (numbers on braces) are in unknown format.
 2. You do not show us how you

-- 
Ticket URL: <http://trac.osgeo.org/geos/ticket/236#comment:1>
GEOS <http://geos.refractions.net/>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite 
(JTS).
_______________________________________________
geos-devel mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/geos-devel

Reply via email to