Ticket #236 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

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) (diff)

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

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

Change History

Changed 3 years ago by mloskot

  • 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

Changed 3 years ago by mloskot

(sorry for incomplete comment, here is second part)

2. You do not show us how you create polygon objects.

3. 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

Changed 3 years ago by aya

Changed 3 years ago by mloskot

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.

Changed 3 years ago by mloskot

  • owner changed from geos-devel@… to mloskot
  • status changed from new to assigned

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?

Changed 3 years ago by mloskot

  • milestone 3.1.0 deleted

Changed 3 years ago by pramsey

  • milestone set to 3.1.1

Changed 3 years ago by strk

  • status changed from assigned to closed
  • resolution set to fixed

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

Changed 3 years ago by strk

Was r2495 sorry (I start to like trac)

Note: See TracTickets for help on using tickets.