Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#2491 closed defect (invalid)

GetGeometryType does not work on geometries retrieved from a VRT data source

Reported by: jbronn Owned by: warmerdam
Priority: normal Milestone:
Component: OGR_SF Version: 1.5.2
Severity: normal Keywords: vrt geometrytype


Given a VRT file (test.vrt):

<OGRVRTLayer name="test">                                                                                                                               
<SrcDataSource relativeToVRT="1">test.csv</SrcDataSource>                                                                                               
<GeometryField encoding="PointFromColumns" x="POINT_X" y="POINT_Y" z="NUM"/>                                                                            

With the following CSV data set (test.csv):


Any geometry pulled from this VRT data source will have an invalid geometry type number. This script demonstrates the problem:

from osgeo import ogr

ds = ogr.Open('test.vrt')
lyr = ds[0]
for feat in lyr:
    geom = feat.geometry()
    print geom.GetGeometryType(), geom.GetGeometryName()

The script produces the following output:

-2147483647 POINT
-2147483647 POINT
-2147483647 POINT

Change History (2)

comment:1 Changed 12 years ago by Even Rouault

Resolution: invalid
Status: newclosed

Actually, I don't think there is any problem. It just returns the (signed) integer corresponding to ogr.wkbPoint25D = 0x80000001. And as you defined a 'z' column, this result is consistant.

>>> print ogr.wkbPoint25D

comment:2 Changed 12 years ago by jbronn

Cc: jbronn@… removed

My bad, thanks for the clarification.

Note: See TracTickets for help on using tickets.