I have a CSV with many points and attributes that I'm trying to convert into a shapefile but I'm having no luck. I have installed gdal-bin and can use my terminal environment to create a shapefile with
ogr2ogr, but I'm not getting the desired outcome. I'm running the following:
ogr2ogr -f "ESRI Shapefile" 5_2834k2-25_FAST.shp 5_2834K2-25_DataCompiled_K2.csv -progress -skipfailures -a_srs EPSG:4326 -nlt POINT
And I get:
"5_2834k2-25_FAST.prj" 1 KB "5_2834k2-25_FAST.shp" 8 KB "5_2834k2-25_FAST.shx" 6 KB "5_2834k2-25_FAST.dbf" 7,625 KB
but despite having all my objects and all the features, my SHP has no geometry. It's extent is 0 and recalculating gives me NaN errors in Arc. Now my source CSV does have a lat and lon column (two separate columns) and I've tried to glean from other answers how to get ogr2ogr to see and interpret these values but I cannot.
For example, perhaps using this bit of sqlite to choose the columns:
-dialect sqlite -sql "SELECT easting_col as long, northing_col as lat, geometry FROM input"
and "SELECT lon as long [...]" from input where input is my CSV... but nope. I tried a two-step cheat, thinking I could provide the dbf or shp from the incomplete output of the first as that input in the second but no...
I've tried as well
GEOMETRY=AS_XY and I'm reading the man pages, the
--long-usage help file as well as the GDAL ogr2ogr page but I just can't come up with the proper syntax.
How can I do this? I'm very frustrated because my columns don't have elaborate names ('Lat' and 'Lon') so I figured it would be very straightforward.