[Gdal-dev] Problem using OGR and join-functionality: column names gone when creating a new shapefile?

wqual wolfgang.qual at gmx.net
Wed Sep 13 04:46:53 EDT 2006


Hi list,
yesterday, I found a very interesting page on the internet - manpage of OGR 
SQL [1]. Wow, I thought - I can perfom JOINs on the command line. Using 
the join-command as described in this manual combinded to the ogrinfo-command 
clearly showed, that a join was performed.
*But could I make this permanent?* 
Within the next step, I used ogr2ogr with the same sql-expression. A new 
shapefile was created, the desired column of the second theme was appended to 
the table (ogr2ogr -f "ESRI Shapefile" testfile.shp ./ -sql "select ...."

However, I realised, that all the column names were gone, or to be more 
precise, lost their names in favour of a new one. All column names of the 
first shapefile "Flurstck_test.shp" were (re)-named to "flurstck_t" and the 
new column of the second theme "flurstck_nr.shp" is named "flurstck_n" now.
Also, the column definitions were all converted to "Real" except the column 
that was appended (joined) to the table. This column is of type "String".

Is this a common (known problem)? I would be most grateful for some comments, 
as I really would like to use this feature of ogr! Thanks in advance!

I am using gdal 1.3.2-2 on a Debian machine.

Best regards,
Wolfgang

[1] www.remotesensing.org/gdal/ogr/ogr_sql.html



More information about the Gdal-dev mailing list