[Gdal-dev] Joining DBF to SHAPE: Unrecognised primary field

Frank Warmerdam warmerdam at pobox.com
Thu Nov 9 09:22:11 EST 2006


Markus Neteler wrote:
> Hi,
> 
> I received the CORINE landcover map and want to join text attributes
> from a DBF table to the landcover codes in the SHAPE file. Something
> goes wrong, however:
...

# The "join" columns are CLC_CODE in both files.
> 
> # doing it:
> ogr2ogr -sql "SELECT 100kmE44N25.*,clc2000leg.LABEL2 FROM 100kmE44N25 LEFT JOIN \
>         '/tmp/clc2000leg.dbf'.clc2000leg ON \
>         100kmE44N25.CLC_CODE = clc2000leg.CLC_CODE" \
>         100kmE44N25_leg.shp 100kmE44N25.shp
> 
> Is the string type a problem? If so, how to work around that?

Markus,

String fields should work, and your construction looks ok.  I'm not sure
why it isn't working.  Can I download these files to try it myself?

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list