Quantcast
Channel: Question and Answer » gdal
Viewing all articles
Browse latest Browse all 397

Join CSV using gdal/ogr

$
0
0

I’m trying to use gdal/ogr to join a shapefile called myshape.shp with a csv called mycsv.csv.
The join field in the shape in joinshp and the join field in the csv is joincsv.

I’ve found this command on other post(link) :

ogr2ogr -sql "select inshape.*, joincsv.* from inshape left join 'joincsv.csv'.joincsv on inshape.GISJOIN = joincsv.GISJOIN" shape_join.shp inshape.shp

I tried this but I can not get it to work:

ogr2ogr -sql "select myshape.*, mycsv.* from myshape left join 'mycsv.csv'.mycsv on myshape.joinshp = mycsv.joincsv" shape_join.shp myshape.shp

Can someone help me write this command for my example ?


Viewing all articles
Browse latest Browse all 397

Trending Articles