Opened 15 years ago

Closed 15 years ago

#294 closed defect (fixed)

reserving to much memory inPolygon::GetCoordinates

Reported by: jaapdekker Owned by: strk
Priority: major Milestone:
Component: Default Version: 3.0.3
Severity: Unassigned Keywords:
Cc:

Description

A length error exception is thrown when Polygon.GetCoordinates() is called with a polygon(sea area around Scotland) with 1396535 coordinates where the shell has size 411057 and that contains 7998 holes (Islands in the sea) the error is caused in Polygon.cpp where a reserve is done with the wrong size the error is on line 123 in Polygon.cpp

npts=shellCoords->getSize();

/*

  • reserve space in the vector as if all holes have the same
  • amount of points. Holes usually have less, so this should
  • be a good compromise */

cl->reserve((nholes+1)*npts);

causing 3,287,633,886 Coordinates to be allocated

Change History (2)

comment:1 by strk, 15 years ago

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

Confirmed. Fixing...

comment:2 by strk, 15 years ago

Resolution: fixed
Status: assignedclosed

Fixed in r2677 (trunk). Anyone willing to fix this in 3.0 and 3.1 branches ?

Note: See TracTickets for help on using tickets.