[gdal-dev] Generating GML from Database - Problem: No decimal values

Gregor Fikoczek gregor.fikoczek at wheregroup.com
Tue Feb 10 04:22:07 EST 2009



Hi list,

i got a problem by generating a GML-File from the Oracle- and MySQL-DB using 
ogr2ogr, so I alway getting in MySQL/oracle instead of a float-value an 
rounded integer-value (mostly 0) without any decimal numbers. 

Some Info:

#################################

Structure MySQL:

	ID  	smallint(6)  	
	col1 	float 		
	col2 	float(8,4) 	
	col3 	double 		
	col4 	double(8,4) 	
	col5 	decimal(10,0) 
	col6 	decimal(6,4)

using ogrinfo/ogr2ogr with MySQL:

ogrinfo MYSQL:******** -sql "SELECT * from test_decimal_values"

OGRFeature(sql_statement):3
  ID (Integer) = 3
  col1 (Real) =  12
  col2 (Real) =  12
  col3 (Real) =  12
  col4 (Real) =  12
  col5 (Real) =  12
  col6 (Real) =  12.1234

Real Value (every column) in the databese: 12.1234

=> Only the values of column col6 [	decimal(6,4)] are right interprated, what 
about the other decimal value in ogr ????
=> My real column is like the col1-column [float]

#################################

Structure Oracle:

ID		NUMBER(2,0)
COL1		NUMBER
COL2		NUMBER(6,4)


using ogrinfo/ogr2ogr with Oracle:

ogrinfo OCI:********** -sql "SELECT * from test_decimal_values"

Feature Count: 1
Layer SRS WKT:
(unknown)
ID: Integer (2.0)
COL1: Real (0.0)
COL2: Real (6.4)

OGRFeature(SELECT * from test_decimal_values):0
  ID (Integer) = 1
  COL1 (Real) = 12
  COL2 (Real) = 12.0000

Real Value (every column) in the databese: 12.3456


=> No column-values are right interprated, so what about the decimal value in 
ogr ????
=> My real column is like the col1-column [NUMBER]


#################################

So is there any option i got to set or a workaround for that problem, 
aspacialy in oracle?


Best regards, 
Greq



---------------------------------------
WhereGroup GmbH & Co. KG
Siemensstraße 8
53121 Bonn
Germany

Gregor Fikoczek
Email: gregor.fikoczek at wheregroup.com
Fon: +49 (0)228 / 90 90 38 - 25
Fax: +49 (0)228 / 90 90 38 - 11

info at wheregroup.com
www.wheregroup.com
Amtsgericht Bonn, HRA 6788
-------------------------------
Komplementärin:
WhereGroup Verwaltungs GmbH
vertreten durch:
Olaf Knopp, Peter Stamm
---------------------------------------


More information about the gdal-dev mailing list