[Qgis-user] mapinfo file to postgis

ibad raza ibadraza001 at gmail.com
Wed Sep 4 21:58:18 PDT 2013


thanks Bo victor Thomsen

I have tried this query and was able to add different types of geometries
into my postgis
however the geometry column of every tables reads as wkb_geometry
geometry(MultiLineString,900914),

can anyone explain to me that what does this means, a normal geometry table
only has only this argument wkb_geometry geometry,


best
Ibad Raza


On Thu, Sep 5, 2013 at 2:49 AM, Bo Victor Thomsen <
bo.victor.thomsen at gmail.com> wrote:

>  Ibad -
>
> The problem is that MapInfo tab files can contain several types of
> geometry object all mixed together - lines, polygons, points ... in a
> single file. This is not allowed in Postgis tables used by QGIS.
> You have to split your "multi-type" tab file into several postgis tables,
> where each table only contains one type of geoobject
>
> Try the following on a command line (in windows):
>
> *for %a in (multilinestring multipolygon linestring polygon point
> multipoint none) do ogr2ogr -where "OGR_GEOMETRY='%a'" -f "PostgreSQL"
> PG:"host=**myserver**** user=**myuser**** dbname=**mydatabase****password=
> **mypassword****" -nlt %a -nln **tablename****_%a **mytabfile.tab*
>
> - Replace italic text as needed
> - If the commandline is put into a .cmd file: Replace every occurence of
> %a with %%a
>
> The command will create 7 new layers for each tabfile. Each new table will
> only contain one type of object (Depending on the contents of the tabfile,
> some or most of the tables will be empty)
>
> Regards
> Bo Victor Thomsen
> Aestas-GIS
> Denmark
>
>
> Den 04-09-2013 21:03, ibad raza skrev:
>
> hello list
>
>  I am trying to add a mapinfo file to postgis
> I have tried the fwtool ogr2ogr function
> but the problem is that everytime I add the file, some records are missing
> these are the records with no geometry which do not get added in the final
> table
>
>
>  can anyone tell me that firstlly how can I add the rows without geometry
> in the table as well.
>
>  and is there another easy way to get mapinfo file into postgis
>
>  Thanks
> Ibad Raza
>
>
> _______________________________________________
> Qgis-user mailing listQgis-user at lists.osgeo.orghttp://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20130905/4634afcb/attachment.html>


More information about the Qgis-user mailing list