[Qgis-user] Qgis 2.13 on windows 7: ogr2ogr oracle to shape does not keep decimals.

Even Rouault even.rouault at spatialys.com
Mon Jan 11 07:38:43 PST 2016


Le lundi 11 janvier 2016 11:29:59, Lopez Agostini, Diana a écrit :
> Hi,
> 
> We've got a vector layer in a spatial oracle repository.
> We need to export it (both geometry and attributes) to a shape file.
> 
> We cannot use "save as shape" directly from qgis, because the oracle layer
> has a blob field that prevent this operation. And we cannot drop the blob
> field because it is needed for other purposes.
> 
> So we're using OGR2OGR instead.
> The oracle layer have several fields  tipus 'double':
> 
> [cid:image001.png at 01D14C63.67A05890]
> 
> After de conversion, the shape file keeps  the double format, but we've
> lost the decimal data. For exemple:
> 
> Before conversion: AREA_HA = 3379.88378172
> After conversion:    AREA_HA=  3379
> 
> We have repeated the conversion applying different "locale" configurations,
> in case the problem was originated by the decimal separation character
> used: "." or ",". However, the results are equally bad.
> 
> Do you know any workaround for this issue ?

From http://gdal.org/drv_oci.html :

"""It might be necessary to define the environment variable NLS_LANG to 
"American_America.UTF8" to avoid issues with floating point numbers being 
truncated to integer on non-English environments."""


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com



More information about the Qgis-user mailing list