[gdal-dev] converting WideString to String in ogr2ogr

Russell McOrmond russell at flora.ca
Wed Apr 29 08:42:11 EDT 2009


   I'm trying to convert some data in ArcSDE that has WideStrings to an 
ESRI Shapefile.  The Data set has English and French text strings which 
are Unicode (WideString) encoded.   When I tried to convert:

ogr2ogr -f "ESRI Shapefile" SOIL_XDATA_PED_CA_SLC_SOIL_ORDER_15M_R2.shp 
"SDE:database,port:1234,sde,username,password,SOIL_XDATA.PED_CA_SLC_SOIL_ORDER_15M_R2"
ERROR 6: Can't create fields of type WideString on shapefile layers.

ERROR 6: Can't create fields of type WideString on shapefile layers.

ERROR 6: Can't create fields of type WideString on shapefile layers.


   The string fields are simply not created in the ESRI shapefile.  Is 
there a way to tell ogr2ogr to transcode these wide strings to whatever 
character encoding ESRI Shapefiles use for strings?


Note: I tried to do an export using ArcCatalog and ended up with a 
shapefile that when rendered as an image looks visually different.  I was 
told that ogr2ogr would give me a more accurate translation.  I note there 
is additional information such as SHAPE_AREA and SHAPE_LEN which the 
ArcCatalog export gave but ogr2ogr didn't.  Here is the ogrinfo first for 
the export and then the ogr2ogr:


$ ogrinfo -al -so soil_xapp/SOIL_XDATA_PED_CA_SLC_SOIL_ORDER_15M_R2.shp
INFO: Open of `soil_xapp/SOIL_XDATA_PED_CA_SLC_SOIL_ORDER_15M_R2.shp'
       using driver `ESRI Shapefile' successful.

Layer name: SOIL_XDATA_PED_CA_SLC_SOIL_ORDER_15M_R2
Geometry: Polygon
Feature Count: 13583
Extent: (-2341022.416100, -719755.272200) - (3009725.435700, 
3833267.122200)
Layer SRS WKT:
PROJCS["EPSG_42304_LCC",
     GEOGCS["GCS_North_American_1983",
         DATUM["North_American_Datum_1983",
             SPHEROID["GRS_1980",6378137.0,298.257222101]],
         PRIMEM["Greenwich",0.0],
         UNIT["Degree",0.0174532925199433]],
     PROJECTION["Lambert_Conformal_Conic_2SP"],
     PARAMETER["False_Easting",0.0],
     PARAMETER["False_Northing",0.0],
     PARAMETER["Central_Meridian",-95.0],
     PARAMETER["Standard_Parallel_1",49.0],
     PARAMETER["Standard_Parallel_2",77.0],
     PARAMETER["Latitude_Of_Origin",49.0],
     UNIT["Meter",1.0]]
SLC_SOIL_O: String (10.0)
SOIL_ORDER: String (30.0)
SOIL_ORD_1: String (30.0)
SOIL_ORD_2: Integer (5.0)
SHAPE_AREA: Real (19.11)
SHAPE_LEN: Real (19.11)


$ ogrinfo -al -so 
soil_xapp_ogr/SOIL_XDATA_PED_CA_SLC_SOIL_ORDER_15M_R2.shp
INFO: Open of `soil_xapp_ogr/SOIL_XDATA_PED_CA_SLC_SOIL_ORDER_15M_R2.shp'
       using driver `ESRI Shapefile' successful.

Layer name: SOIL_XDATA_PED_CA_SLC_SOIL_ORDER_15M_R2
Geometry: Polygon
Feature Count: 13583
Extent: (-2341022.416100, -719755.272200) - (3009725.435700, 
3833267.122200)
Layer SRS WKT:
PROJCS["EPSG_42304_LCC",
     GEOGCS["GCS_North_American_1983",
         DATUM["North_American_Datum_1983",
             SPHEROID["GRS_1980",6378137.0,298.257222101]],
         PRIMEM["Greenwich",0.0],
         UNIT["Degree",0.017453292519943295]],
     PROJECTION["Lambert_Conformal_Conic_2SP"],
     PARAMETER["False_Easting",0.0],
     PARAMETER["False_Northing",0.0],
     PARAMETER["Central_Meridian",-95.0],
     PARAMETER["Standard_Parallel_1",49.0],
     PARAMETER["Standard_Parallel_2",77.0],
     PARAMETER["Latitude_Of_Origin",49.0],
     UNIT["Meter",1.0]]
OBJECTID: Integer (10.0)
SOIL_ORDER: Integer (5.0)


-- 
  Russell McOrmond, Internet Consultant: <http://www.flora.ca/>
  Please help us tell the Canadian Parliament to protect our property
  rights as owners of Information Technology. Sign the petition!
  http://digital-copyright.ca/petition/ict/     http://KillBillC61.ca

  "The government, lobbied by legacy copyright holders and hardware
   manufacturers, can pry control over my camcorder, computer,
   home theatre, or portable media player from my cold dead hands!"


More information about the gdal-dev mailing list