[postgis-devel] loadling gml data in to post gis with different geometry types

dustymugs dustymugs at gmail.com
Thu Jun 20 09:56:45 PDT 2013


Dave,

PostGIS doesn't require you to predefine the type for a geometry field.
I'm betting that ogr2ogr is doing that.

By the looks of ogr2ogr's docs, you should be able to use the "-nlt"
flag... ogr2ogr -nlt GEOMETRY

-bborie

On 06/20/2013 04:59 AM, Dave Potts wrote:
> Hi,
> 
> I am trying to load some gml data into a post gis database, the problem
> being that the gml data has linesstrings and points defined in it.
> 
> The problem being that postgis requires you to predefine the type of a
> geomtry field
> 
> What I would like to be able to do get a data table which has a shared
> geomtry column, failing that.  I like to have a data table with two
> geomtry columns in it
> 
> I have tried things like
> 
> 
> ogr2ogr -append  -where "OGR_GEOMETRY='Point'" -f PostgreSQL "PG:
> dbname='${DB_NAME}'" -lco  GEOMETRY_NAME=point_geom  ${GML_FILE}
> 
> 
> ogr2ogr -append  -where "OGR_GEOMETRY='LineString'" -f PostgreSQL "PG:
> dbname='${DB_NAME}'" -lco  GEOMETRY_NAME=line_geom  ${GML_FILE}
> But I get a volley of errors from ogr2ogr
>  Layer creation options ignored since an existing layer is  being
> appended to.
> 
> Any suggestions ?
> 
> Dave.
> 
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel
> 



More information about the postgis-devel mailing list