I want to import a few .gpx files to postgresql using ogr2ogr. The data in each .gpx looks like this:
<trkpt lat="41.842607000" lon="12.490628000"><ele>40.5</ele><time>2010-05-31T14:12:11Z</time> </trkpt>
Firstly, I create a new table in postgresql
CREATE TABLE test ( fid serial NOT NULL, -- geom geometry(Point,4326), ele double precision, "time" timestamp with time zone, CONSTRAINT activities_pk PRIMARY KEY (fid) );
Then when I run the ogr2ogr script:
ogr2ogr -update -append -f "PostgreSQL" PG:"host="xx" user="xx" dbname="xx" password="xx"" 1st.gpx -nln test
However, the script failed due to geometry type mismatch.
Warning 1: Geometry to be inserted is of type Multi Line String, whereas the layer geometry type is Point. Insertion is likely to fail ERROR 1: ERROR: Geometry type (MultiLineString) does not match column type (Point)
ERROR 1: INSERT command for new feature failed. ERROR: Geometry type (MultiLineString) does not match column type (Point)
Can anyone help with this?