Opened 14 years ago
Last modified 9 years ago
#3754 closed defect
ogr2ogr: Oracle spatial layer type is not recognized — at Version 1
Reported by: | sumit321 | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 2.0.0 |
Component: | OGR_SF | Version: | 1.7.0 |
Severity: | normal | Keywords: | ogr2ogr oci |
Cc: | ilucena |
Description (last modified by )
Try to convert any point or line layer from oracle spatial to postgis.
They are always converted into polygon type.
After some more debugging I found that while opening oracle spatial layer Ogr is not reading its gtype and hence it is always wkbUnknown.
Thus when you create new layer in postgis its type is not persisted correctly. I am using GDAL 1.7.0 and I was able to replicate this bug with 1.7.2 as well. OS is windows 7. Command is ogr2ogr -f "PostgreSQL" PG:"host=192.168.1.87 user=postgres dbname=postgis password=hello123 port=5432" OCI:"mdsys/test@(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.10)(PORT = 1521))(CONNECT_DATA = (SERVICE_NAME = orcl)))" SUMITLINETEST -lco "LAUNDER=YES"
On further debugging I found that if source layer is from oracle spatial, Ogr never tries to read its data type. Thus when you push data from oracle to ESRI shape files, gType is always wkbUnkown. However while translating features function call of ResetGeomType fix geometry type of ESRI shape file.
Such handling is missing in case of PostGIS and may in other data formats as well (I am not sure).