Ticket #116 (defect)
Opened 1 year ago
Last modified 1 year ago
Shapely: segfault with null point (points without coordinates)
Status: closed (wontfix)
| Reported by: | fredj | Assigned to: | seang |
|---|---|---|---|
| Priority: | major | Milestone: | Shapely 1.0 |
| Component: | Shapely | Version: | |
| Keywords: | Cc: | ||
With the SVN version:
>>> from shapely.geometry import Point >>> a = Point() >>> a.x Segmentation fault
The same problem happens when setting the value:
>>> from shapely.geometry import Point >>> a = Point() >>> a.x = 6.0 Segmentation fault
Attachments
Change History
07/12/07 06:37:47: Modified by fredj
- attachment shapely.geometry.point.116.patch added.
07/12/07 06:44:41: Modified by fredj
11/06/07 10:46:41: Modified by seang
- status changed from new to assigned.
- milestone set to Shapely 1.0.
11/06/07 10:47:03: Modified by seang
- component changed from Data Stores and Sources to Shapely.
11/19/07 20:20:41: Modified by seang
- status changed from assigned to closed.
- resolution set to wontfix.
On closer inspection, this is a "won't fix". The x and y properties of a Point have been read only for some time now. The proper way to set the coordinates is via:
p = Point() p.coords = (0.0, 0.0)

shapely.geometry.point.116.patch:
According to the geos_c documentation, GEOSGeom_getCoordSeq returns NULL on exception , this is the case when the Point is constructed without coordinates, in the ctypes world, NULL == False so this patch checks the returned value.