-dev@lists.osgeo.org
Objet
Re: [gdal-dev] RE Python ogr GetFieldAsString problem
Selon steve.tout...@inspq.qc.ca:
> Hi Even,
> I don't understand why GetFieldAsString() truncates the valueShould
it
> reads the value as it is?
To be pedantic, GetFieldAsString() does no
Selon steve.tout...@inspq.qc.ca:
> Hi Even,
> I don't understand why GetFieldAsString() truncates the valueShould it
> reads the value as it is?
To be pedantic, GetFieldAsString() does not truncate the value. The value is
truncated before, in the GML reader, when inserting the value from the
d,
CPLAtof(psGMLProperty->papszSubProperties[0]) );
+ poOGRFeature->SetField( iDstField,
CPLAtofM(psGMLProperty->papszSubProperties[0]) );
}
break;
>
> thanks!
>
>
>
>
>
>
>
>
> Even Rouault
> 2015-05-13
rator there
must be a solution
What do you think, Does GetFieldAsDouble should be able to manage the ,''?
thanks!
Even Rouault
2015-05-13 17:02
A
steve.tout...@inspq.qc.ca
cc
gdal-dev@lists.osgeo.org
Objet
Re: [gdal-dev] RE Python ogr GetFieldAsString problem
Steve,
Steve,
I believe comma as decimal separator is invalid for a XML double. Hence the GML
driver only parses the value up to the comma. This could likely be improved to
accept comma, but technically I believe a XML validator would reject this GML.
Even
> More info.
> ogr2ogr --version = GDAL 1.
More info.
ogr2ogr --version = GDAL 1.10.1, released 2013/08/26
python --version = Python 2.7.3
I have modified my script to get the field type
while feat is not None:
feat_defn = layer.GetLayerDefn()
field_defn =
feat_defn.GetFieldDefn(feat_defn.GetFieldIndex(attribut))