[postgis-users] problems with mapinfo file export to postgis

Paragon Corporation lr at pcorp.us
Fri Sep 25 21:30:28 PDT 2009


Karina,

Richard is right ogr2ogr defaults the geometry name to wkb_geometry unless
you override that behavior.  shp2pgpsql happens to default to the_geom
unless you override that with -g option.
The names are just convention and you can name the geometry field anything
you want.

You can use the -lco GEOMETRY_NAME=the_geom  in ogr2ogr to override its
default naming as I recall.

ogr2ogr if you prefer the PostGIS to shp2pgsql default name. 

Hope that helps,
Regina

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Richard
Greenwood
Sent: Friday, September 25, 2009 8:45 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] problems with mapinfo file export to postgis

On Fri, Sep 25, 2009 at 4:19 PM, Karina Guardado <kguardado at gmail.com>
wrote:
> Hi all,
>
> I have exported a Mapinfo file into postgres using the following
statement:
>
> ogr2ogr  -f  "PostgreSQL" -a_srs "EPSG:8913" PG:"host=localhost 
> user=mysusername dbname=mydatabase password=mypass"  mytabfile.TAB
>
> but when I want to access by mapserver layer I just don't know how to 
> make que query for the geometry information because I found examples 
> using select the_geom from mytable but this work fine with a shapefile  
> but with mapinfo have no idea about the geometry part, so please if 
> someone has an example or solution let me know

Unless you use the -nln (New Layer Name) option, ogr2ogr will name the
geometry column "wkb_geometry". So just use wkb_geometry instead of
the_geom. Hope that gets you started.

--
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users






More information about the postgis-users mailing list