Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#236 closed defect (fixed)

the project crash

Reported by: aya Owned by: mloskot
Priority: major Milestone: 3.1.1
Component: Default Version: 3.0.3
Severity: Feature Request Keywords: GEOS, Distance, DistanceOp
Cc:

Description (last modified by mloskot)

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;

Attachments (1)

main.cpp (1.6 KB ) - added by aya 15 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 by mloskot, 15 years ago

Description: modified (diff)

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

comment:2 by mloskot, 15 years ago

(sorry for incomplete comment, here is second part)

  1. You do not show us how you create polygon objects.
  1. Why don't you present complete program:
// headers you include

int main()
{
// what is WKT of your polygons
 const char* wkt = "...";
// how you create polygon objects using GEOS
...
// what operations you run exactly on polygon objects
...
}

The bug report like you've submitted is incomplete and you may expect it will be closed as "invalid".

-- Mateusz

by aya, 15 years ago

Attachment: main.cpp added

comment:3 by mloskot, 15 years ago

From Aya (#237)

Thank for the reply of Mateusz. I have updated the source codes. Now I need to find the nearest points (maybe not vertex) of two polygons and the related distance.

comment:4 by mloskot, 15 years ago

Owner: changed from geos-devel@… to mloskot
Status: newassigned

Aya, I confirm there is a bug in GEOS. I've submitted explanation-by-code and corresponding test case for the unit tests package to SVN trunk (r2276). You may see log message and comments to understand where is the bug.

GEOS Team, any ideas for proper fix? Is the one I proposed in the log OK?

comment:5 by mloskot, 15 years ago

Milestone: 3.1.0

comment:6 by pramsey, 15 years ago

Milestone: 3.1.1

comment:7 by strk, 15 years ago

Resolution: fixed
Status: assignedclosed

Found and fixed in r2496. Now working on the unit test.

comment:8 by strk, 15 years ago

Was r2495 sorry (I start to like trac)

Note: See TracTickets for help on using tickets.