[gdal-dev] OGR: Why not GetPoint() under win32?

Iván Sánchez Ortega ivan at sanchezortega.es
Tue Dec 22 22:34:52 EST 2009


Hi all,

I've been recently learning Python and OGR in order to code ogr2osm. See 
http://lists.openstreetmap.org/pipermail/dev/2009-December/017864.html


Problem is, this script doesn't work when in a win32 box. I'm testing it with 
FWTools 2.4.6. It runs OK wiht python-gdal 1.6.3 in my Debian box.

"ogrinfo --version" says 1.7.0dev for FWTools, 1.6.3 for the Debian 
python-gdal package.


I've hunted down the bug, and it seems that it's because of a mismatch between 
the implementations of the wkbLineString class.


See, I'm doing this:
	print geometry
	print dir(geometry)

Under Debian, I get this:

LINESTRING (459974 4605130,459974 4605130)
['AddGeometry', 'AddGeometryDirectly', 'AddPoint', 'AddPoint_2D', 
'AssignSpatialReference', 'Buffer', 'Centroid', 'Clone', 'CloseRings',
 'Contains', 'ConvexHull', 'Crosses', 'Destroy', 'Difference', 'Disjoint',
 'Distance', 'Empty', 'Equal', 'ExportToGML', 'ExportToJson', 'ExportToKML',
 'ExportToWkb', 'ExportToWkt', 'FlattenTo2D', 'GetArea', 'GetBoundary',
 'GetCoordinateDimension', 'GetDimension', 'GetEnvelope', 'GetGeometryCount',
 'GetGeometryName', 'GetGeometryRef', 'GetGeometryType', 'GetPoint',
 'GetPointCount', 'GetPoint_2D', 'GetSpatialReference', 'GetX', 'GetY', 'GetZ',
 'Intersect', 'Intersection', 'IsEmpty', 'IsRing', 'IsSimple', 'IsValid',
 'Overlaps', 'SetCoordinateDimension', 'SetPoint', 'SetPoint_2D',
 'SymmetricDifference', 'Touches', 'Transform', 'TransformTo', 'Union',
 'Within', 'WkbSize', '__class__', '__del__', '__delattr__', '__dict__',
 '__doc__', '__getattr__', '__getattribute__', '__hash__', '__init__',
 '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__',
 '__setattr__', '__setstate__', '__str__', '__swig_destroy__',
 '__swig_getmethods__', '__swig_setmethods__', '__weakref__', 'this']


But, under win32 + FWTools, I get this instead:

LINESTRING (459974 4605130,459974 4605130)
['AddGeometry', 'AddGeometryDirectly', 'AddPoint', 'AddPoint_2D',
 'AssignSpatialReference', 'Buffer', 'Centroid', 'Clone', 'CloseRings',
 'Contains', 'ConvexHull', 'Crosses', 'Destroy', 'Difference', 'Disjoint',
 'Distance', 'Empty', 'Equal', 'ExportToGML', 'ExportToWkb', 'ExportToWkt',
 'FlattenTo2D', 'GetArea', 'GetBoundary', 'GetCoordinateDimension',
 'GetDimension', 'GetEnvelope', 'GetGeometryCount', 'GetGeometryName',
 'GetGeometryRef', 'GetGeometryType', 'GetPointCount', 'GetSpatialReference',
 'GetX', 'GetY', 'GetZ', 'Intersect', 'Intersection', 'Overlaps',
 'SetCoordinateDimension', 'SetPoint', 'SetPoint_2D', 'SymmetricDifference',
 'Touches', 'Transform', 'TransformTo', 'Union', 'Within', 'WkbSize',
 '__copy__', '__del__', '__doc__', '__init__', '__module__', '__str__',
 '_o', 'thisown']



So, why do I have a GetPoint() method in one implementation but not in the 
other?



Cheers,
-- 
----------------------------------
Iván Sánchez Ortega <ivan at sanchezortega.es>

Your reasoning is excellent -- it's only your basic assumptions that are 
wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20091223/11ca4148/attachment.bin


More information about the gdal-dev mailing list