[Gdal-dev] date fields truncated using ogr2ogr to load shpfile into
psql
John.C.Cartwright at noaa.gov
John.C.Cartwright at noaa.gov
Sun Dec 10 19:28:19 EST 2006
Hello All,
I'm trying to use ogr2ogr to load a shapefile into a postgis database,
and having trouble w/ the date filelds. The shapefile describes OK, but
the SQL generated by ogr2ogr seems to be truncating the date field.
lynx:/usr/local/shapefiles jcc$ ogr2ogr -f postgresql -a_srs EPSG:4326
PG:dbname=jcc -overwrite osmc.shp
ERROR 1: INSERT command for new feature failed.
ERROR: invalid input syntax for type date: "2006/12/"
Command: INSERT INTO "osmc" (wkb_geometry , "platform_i", "max_observ",
"observatio", "platform_t", "num_observ", "objectid") VALUES
(GeomFromEWKT('SRID=4326;POINT (-29.30999999999991
-41.889999999999972)'::TEXT) , '33627', '2006/12/', '2006/12/',
'DRIFTING BUOY', 133, 7469241)
ERROR 1: Terminating translation prematurely after failed
translation of layer osmc
Can anyone tell me what I'm doing wrong here?
Listed below is a ogrinfo listing of the shapefile and record in question.
Thanks!
-- john
lynx:/usr/local/shapefiles jcc$ ogrinfo -al osmc.shp
INFO: Open of `osmc.shp'
using driver `ESRI Shapefile' successful.
Layer name: osmc
Geometry: Point
Feature Count: 4435
Extent: (-179.964000, -70.400000) - (179.980000, 86.010000)
Layer SRS WKT:
GEOGCS["Longitude / Latitude (WGS 84)",
DATUM["WGS 84",
SPHEROID["WGS 84",6378137.0,298.257223563]],
PRIMEM["Greenwich",0.0],
UNIT["Decimal Degree",0.0174532925199433]]
PLATFORM_I: String (9.0)
MAX_OBSERV: Date (8.0)
OBSERVATIO: Date (8.0)
PLATFORM_T: String (20.0)
NUM_OBSERV: Integer (10.0)
OBJECTID: Integer (10.0)
OGRFeature(osmc):0
PLATFORM_I (String) = 33627
MAX_OBSERV (Date) = 2006/12/08
OBSERVATIO (Date) = 2006/12/08
PLATFORM_T (String) = DRIFTING BUOY
NUM_OBSERV (Integer) = 133
OBJECTID (Integer) = 7469241
POINT (-29.30999999999991 -41.889999999999972)
More information about the Gdal-dev
mailing list