[gdal-dev] ogr 1.6 and ArcSDE 9.3sp1: not reading varchar2 fields

Michael Smith michael.smith at usace.army.mil
Fri Mar 27 06:22:00 EDT 2009


Duarte,

Why not create a view that has the TRANSLATE and TO_CHAR and then use that
in OGR. 

Mike


-- 
Michael Smith
RSGIS Center
ERDC - CRREL
US Army Corps of Engineers





On 3/27/09  5:44 AM, "Duarte Carreira" <DCarreira at edia.pt> wrote:

> I'm correcting the subject of the message - the problem is with NVARCHAR
> fields (not varchar2).
> It seems this relates to utf issues/limitations in ogr.
> 
> If I could use SQL functions this could be solved by the database itself. Like
> using TO_CHAR(field_name) or TRANSLATE(field_name USING CS_CHAR). But it seems
> ogr does not support these sql functions/operators...
> 
> Any additional suggestions?
> 
> Thanks,
> Duarte
> 
> -----Mensagem original-----
> De: Duarte Carreira [mailto:DCarreira at edia.pt]
> Enviada: quinta-feira, 26 de Março de 2009 23:54
> Para: gdal-dev at lists.osgeo.org
> Assunto: [gdal-dev] ogr 1.6 and ArcSDE 9.3sp1: not reading varchar2 fields
> 
> Hello.
> 
> As always trying to coerce these two to work together nicely...
> 
> The situation: exporting ArcSDE feature class to <anything>, shapefile, gpx...
> server: Oracle xe (10), ArcSDE 9.3 sp1, Win2003 Std x32
> client: Vista x32, GDAL/OGR 1.6 build 1500 from Tamas site, sde dll's from 9.3
> sp1
> 
> As you can see below, Oracle describes several fields as being number and
> nvarchar2, and ogrinfo only identifies numeric fields. All text fields come
> out as unknown.
> 
> Now, what could this be due to? Anyone facing the same issue? I tried to use
> SQL to cast a nvarchar to character without success...
> 
> Thanks,
> Duarte
> 
> Feature class description in Oracle:
> Column Name     Data Type       Nullable        Default Primary Key
> OBJECTID        NUMBER  No      -       -
> IDPERC  NVARCHAR2(6)    Yes     -       -
> NOME    NVARCHAR2(150)  Yes     -       -
> DESCRICAO       NVARCHAR2(255)  Yes     -       -
> IDPONTO NVARCHAR2(10)   Yes     -       -
> IDSIG   NUMBER  Yes     -       -
> XCOORD  NUMBER(38,8)    Yes     -       -
> YCOORD  NUMBER(38,8)    Yes     -       -
> MORADA_COMPLETA NVARCHAR2(255)  Yes     -       -
> CONCELHO        NVARCHAR2(50)   Yes     -       -
> FREGUESIA       NVARCHAR2(50)   Yes     -       -
> CODPOSTAL       NVARCHAR2(10)   Yes     -       -
> TELEFONE        NVARCHAR2(10)   Yes     -       -
> DESCRICAOPT     NVARCHAR2(255)  Yes     -       -
> NOMEPT  NVARCHAR2(150)  Yes     -       -
> SHAPE   ST_GEOMETRY     Yes     -       -
>                 1 - 16
> 
> ogrinfo output:
> Layer name: <user>.<table>
> Geometry: Unknown (any)
> ERROR 1: SE_layer_get_statistics: -51/Underlying DBMS error
> Feature Count: -1
> Extent: (6177.862000, -123296.045000) - (63997.354000, -91245.397000)
> Layer SRS WKT:
> PROJCS["Datum_73_Hayford_Gauss_IPCC",
>     GEOGCS["GCS_Datum_73",
>         DATUM["Datum_73",
>             SPHEROID["International_1924",6378388.0,297.0]],
>         PRIMEM["Greenwich",0.0],
>         UNIT["Degree",0.0174532925199433]],
>     PROJECTION["Transverse_Mercator"],
>     PARAMETER["False_Easting",180.598],
>     PARAMETER["False_Northing",-86.99],
>     PARAMETER["Central_Meridian",-8.131906111111112],
>     PARAMETER["Scale_Factor",1.0],
>     PARAMETER["Latitude_Of_Origin",39.66666666666666],
>     UNIT["Meter",1.0]]
> OBJECTID: Integer (10.0)
> IDPERC: (unknown) (6.0)
> NOME: (unknown) (50.0)
> DESCRICAO: (unknown) (50.0)
> IDLINHA: (unknown) (5.0)
> SHAPE_LENG: Real (38.8)
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev



More information about the gdal-dev mailing list