I have a shapefile with the following structure:
I'm trying using ogr2ogr to import the above shapefile inside my PostGIS database with the following code:
ogr2ogr -append -f "PostgreSQL" PG:"host=localhost dbname=vector_data
grid.shp -a_srs EPSG:4326 -skipfailures -lco FID=ID
-lco COLUMN_TYPES=ID=VARCHAR -lco GEOMETRY_NAME=geom
The problem is when I run the above code, I get the following error message:
ERROR 1: Wrong field type for ID
I've understood the problem is because my ID field is a String and not an Integer, however I put
COLUMN_TYPES=ID=VARCHAR on my script and ogr2ogr was not able to understand it.
I tried to import this shapefile using no field as FID and it worked, but I would like to import it in my database using ID as a primary key even it is a String.
Is there a way of doing it?
The shapefile is here: http://www.dpi.inpe.br/newcatalog/tmp/grades/grade_cbers4_mux.zip