Re: [gdal-dev] [python-ogr] GetNumPoints from geometry

2011-02-10 Thread Ari Jolma
On 02/10/2011 10:28 AM, Frank Broniewski wrote: Hi Ari, thanks for your answer. I am not sure what you mean with return a geometry in scalar context, and I don't have a sound understanding of perl, SWIG and the impacts of it on the objects created by the bindings. A very quick google search

Re: [gdal-dev] [python-ogr] GetNumPoints from geometry

2011-02-10 Thread Frank Broniewski
Hi Ari, thanks for your answer. I am not sure what you mean with return a geometry in scalar context, and I don't have a sound understanding of perl, SWIG and the impacts of it on the objects created by the bindings. A very quick google search didn't reveal a good explanation of what a scala

Re: [gdal-dev] [python-ogr] GetNumPoints from geometry

2011-02-09 Thread Ari Jolma
On 02/09/2011 05:36 PM, Frank Broniewski wrote: Yes, thank you. GetPointCount() works. Another thing I noticed: point = geometry.GetPoint(point_index) point is of type tuple(x, y, z), not as one would guess an OGRPoint() geometry. At least for me this was unexpected. And the python GetPoint m

Re: [gdal-dev] [python-ogr] GetNumPoints from geometry

2011-02-09 Thread Frank Broniewski
Yes, thank you. GetPointCount() works. Another thing I noticed: point = geometry.GetPoint(point_index) point is of type tuple(x, y, z), not as one would guess an OGRPoint() geometry. At least for me this was unexpected. And the python GetPoint method does not take a OGRPoint geometry, like it

Re: [gdal-dev] [python-ogr] GetNumPoints from geometry

2011-02-09 Thread Paolo Corti
> > There are OGR_G_GetPointCount in ogr_api.h and GetPointCount method in the > Geometry class in Swig bindings. > Right, I was also trying to figure out this, this is my test code: lineshp = driver.Open('/home/pcorti/data/shapefile/line.shp') linelyr = lineshp.GetLayer(0) feat = linelyr.GetNext

Re: [gdal-dev] [python-ogr] GetNumPoints from geometry

2011-02-09 Thread Ari Jolma
On 02/09/2011 04:19 PM, Frank Broniewski wrote: Hi, just a quick question: isn't GetNumPoints implemented on a geometry in ogr python? There are OGR_G_GetPointCount in ogr_api.h and GetPointCount method in the Geometry class in Swig bindings. Hm. It seems that NumPoints is the name of the

[gdal-dev] [python-ogr] GetNumPoints from geometry

2011-02-09 Thread Frank Broniewski
Hi, just a quick question: isn't GetNumPoints implemented on a geometry in ogr python? Neither GetNumPoints() nor getNumPoints() (small g) work. The passed in geometry is a geometry object from a geometry = feature.GetGeometryRef() call and the geometry is of type 'LINESTRING' taken from geo