Answer by Socci for Join CSV file to shapefile using gdal/ogr
Based on Eric's answer, this is an approach using the SQLite command instead of csvkit.If you're not already starting from a GeoPackage, convert to it first:ogr2ogr -f GPKG myjoinshp.gpkg...
View ArticleAnswer by eric brelsford for Join CSV file to shapefile using gdal/ogr
The accepted answer is really useful, but I found that it was slow with a large-ish database. I believe it also limits your options when joining the data.My method now is to pull everything into SQLite...
View ArticleAnswer by user2856 for Join CSV file to shapefile using gdal/ogr
The ogr2ogr utility supports a limited sql syntax. You can join your CSV to the shapefile using something like the following:ogr2ogr -sql "select inshape.*, joincsv.* from inshape left join...
View ArticleJoin CSV file to shapefile using gdal/ogr
I have a shapefile with several attributes, for example "YEAR", "COUNTY", and "AREA". I also have a CSV file with more fields that I want in the shapefile, such as "POPULATION". Both the shapefile and...
View Article