Skip to main content
fixed grammar
Source Link
whyzar
  • 12.1k
  • 23
  • 39
  • 72

I have a KML file called tracts.kml and a CSV called B01001A_007E_tract.csv in one directory.

I opened a command line in the folder and ran this...:

ogr2ogr -sql "select tracts.*, B01001A_007E_tract.* from tracts left join 'B01001A_007E_tract.csv'.B01001A_007E_tract on tracts.Id2 = B01001A_007E_tract.StateCountyTractID" dst_tracts.kml tracts.kml

I got this message and error...:

Warning: The target file has a 'kml' extension, which is normally used by the LIBKML, KML drivers,
 but the requested output driver is ESRI Shapefile. Is it really what you want ? 

ERROR 1: SELECT from table tracts failed, no such table/featureclass.

What am I doing wrong?

I have a KML file called tracts.kml and a CSV called B01001A_007E_tract.csv in one directory.

I opened a command line in the folder and ran this...

ogr2ogr -sql "select tracts.*, B01001A_007E_tract.* from tracts left join 'B01001A_007E_tract.csv'.B01001A_007E_tract on tracts.Id2 = B01001A_007E_tract.StateCountyTractID" dst_tracts.kml tracts.kml

I got this message and error...

Warning: The target file has a 'kml' extension, which is normally used by the LIBKML, KML drivers,
 but the requested output driver is ESRI Shapefile. Is it really what you want ?
ERROR 1: SELECT from table tracts failed, no such table/featureclass.

What am I doing wrong?

I have a KML file called tracts.kml and a CSV called B01001A_007E_tract.csv in one directory.

I opened a command line in the folder and ran this:

ogr2ogr -sql "select tracts.*, B01001A_007E_tract.* from tracts left join 'B01001A_007E_tract.csv'.B01001A_007E_tract on tracts.Id2 = B01001A_007E_tract.StateCountyTractID" dst_tracts.kml tracts.kml

I got this message and error:

Warning: The target file has a 'kml' extension, which is normally used by the LIBKML, KML drivers,but the requested output driver is ESRI Shapefile. Is it really what you want ? 

ERROR 1: SELECT from table tracts failed, no such table/featureclass.

What am I doing wrong?

edited title
Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

How do I merge a Merging CSV and KML in ogr2ogr?

Source Link
Username
  • 297
  • 3
  • 13

How do I merge a CSV and KML in ogr2ogr?

I have a KML file called tracts.kml and a CSV called B01001A_007E_tract.csv in one directory.

I opened a command line in the folder and ran this...

ogr2ogr -sql "select tracts.*, B01001A_007E_tract.* from tracts left join 'B01001A_007E_tract.csv'.B01001A_007E_tract on tracts.Id2 = B01001A_007E_tract.StateCountyTractID" dst_tracts.kml tracts.kml

I got this message and error...

Warning: The target file has a 'kml' extension, which is normally used by the LIBKML, KML drivers,
but the requested output driver is ESRI Shapefile. Is it really what you want ?
ERROR 1: SELECT from table tracts failed, no such table/featureclass.

What am I doing wrong?