#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 )
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)
Change History (9)
comment:1 by , 15 years ago
Description: | modified (diff) |
---|
comment:2 by , 15 years ago
(sorry for incomplete comment, here is second part)
- You do not show us how you create polygon objects.
- 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 , 15 years ago
comment:3 by , 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 , 15 years ago
Owner: | changed from | to
---|---|
Status: | new → 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?
comment:5 by , 15 years ago
Milestone: | 3.1.0 |
---|
comment:6 by , 15 years ago
Milestone: | → 3.1.1 |
---|
comment:7 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Found and fixed in r2496. Now working on the unit test.
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.