<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Ibad -<br>
<br>
First: The wkb_geometry geometry(MultiLineString,900914) part
means that your table contains multiline geoobject in the
projection EPSG:900914<br>
<br>
I suspect you have run two errors in ogr2ogr.<br>
<br>
I've done some digging into the problem:<br>
<br>
I've attached a tab-file in projection epsg:25832 (that's
utm32/etrs89). It contains 7 rows: one row each of geotype POINT,
MULTIPOINT ..,MULTIPOLYGON, NONE. When I use the ogr2ogr command
from my previous post 2 things happens:<br>
<br>
<ol>
<li>I get 6 - not 7 - new tables into my database. The table
with geometry type 'NONE' is missing. That means the <b>
-where "OGR_GEOMETRY='%a' </b>command option fails for
geometry type "none" <br>
</li>
<li>The 6 tables has all the projection epsg:900915 (AFAIK this
is "Google spherical mercator" projection). It's not
epsg:25832. This means that ogr2ogr can't reliably transfer
the projection of the tabfile into postgis.<br>
<br>
</li>
</ol>
add 1) Sorry, at the moment you can't use my method to transfer
rows with no geometry from a tab file into postgresql.<br>
<br>
add 2) As a workaround, you can manually define the projection by
using the -a_srs option in the ogr2ogr. Change the command to:<br>
<br>
<b>for %a in (multilinestring multipolygon linestring polygon
point multipoint none) do ogr2ogr -where "OGR_GEOMETRY='%a'"
-a_srs EPSG:<i>nnnn </i>-f "PostgreSQL" PG:"host=</b><b><i>myserver</i></b><b>
user=</b><b><i>myuser</i></b><b> dbname=</b><b><i>mydatabase</i></b><b>
password=</b><b><i>mypassword</i></b><b>" -nlt %a -nln </b><b><i>tablename</i></b><b>_%a
</b><b><i>mytabfile.tab</i></b><br>
<br>
<b><i>nnnn </i></b>must be the epsg number for the projection
used in your mapinfo table.<br>
<br>
I will file two bug reports for the ogr2ogr errors.<br>
<br>
Regards<br>
Bo Victor Thomsen<br>
Aestas-GIS<br>
<br>
Den 05-09-2013 06:58, ibad raza skrev:<br>
</div>
<blockquote
cite="mid:CAD0k_teLO=m=+PYhWw3c7pK7Ukk1C2Gqptvy7+vkwbS+Rw7=kw@mail.gmail.com"
type="cite">
<div dir="ltr">thanks Bo victor <span
style="font-family:arial,sans-serif;font-size:13px">Thomsen</span>
<div><br>
</div>
<div>I have tried this query and was able to add different types
of geometries into my postgis</div>
<div>
however the geometry column of every tables reads
as wkb_geometry geometry(MultiLineString,900914),</div>
<div><br>
</div>
<div>can anyone explain to me that what does this means, a
normal geometry table only has only this argument wkb_geometry
geometry,</div>
<div><br>
</div>
<div><br>
</div>
<div>best</div>
<div>Ibad Raza</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Thu, Sep 5, 2013 at 2:49 AM, Bo
Victor Thomsen <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:bo.victor.thomsen@gmail.com" target="_blank">bo.victor.thomsen@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div>Ibad -<br>
<br>
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.<br>
You have to split your "multi-type" tab file into
several postgis tables, where each table only contains
one type of geoobject<br>
<br>
Try the following on a command line (in windows):<br>
<br>
<b>for %a in (multilinestring multipolygon linestring
polygon point multipoint none) do ogr2ogr -where
"OGR_GEOMETRY='%a'" -f "PostgreSQL" PG:"host=</b><b><i>myserver</i></b><b>
user=</b><b><i>myuser</i></b><b> dbname=</b><b><i>mydatabase</i></b><b>
password=</b><b><i>mypassword</i></b><b>" -nlt %a -nln
</b><b><i>tablename</i></b><b>_%a </b><b><i>mytabfile.tab</i></b><br>
<br>
- Replace italic text as needed<br>
- If the commandline is put into a .cmd file: Replace
every occurence of %a with %%a<br>
<br>
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) <br>
<br>
Regards<br>
Bo Victor Thomsen<br>
Aestas-GIS<br>
Denmark<br>
<br>
<br>
Den 04-09-2013 21:03, ibad raza skrev:<br>
</div>
<blockquote type="cite">
<div>
<div class="h5">
<div dir="ltr">hello list
<div><br>
</div>
<div>I am trying to add a mapinfo file to postgis</div>
<div>I have tried the fwtool ogr2ogr function</div>
<div>but the problem is that everytime I add the
file, some records are missing</div>
<div>these are the records with no geometry which
do not get added in the final table</div>
<div><br>
</div>
<div><br>
</div>
<div>can anyone tell me that firstlly how can I
add the rows without geometry in the table as
well.</div>
<div><br>
</div>
<div>and is there another easy way to get mapinfo
file into postgis</div>
<div><br>
</div>
<div>Thanks</div>
<div>Ibad Raza</div>
</div>
<br>
<fieldset></fieldset>
<br>
</div>
</div>
<pre>_______________________________________________
Qgis-user mailing list
<a moz-do-not-send="true" href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a>
<a moz-do-not-send="true" href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a></pre>
</blockquote>
<br>
</div>
<br>
_______________________________________________<br>
Qgis-user mailing list<br>
<a moz-do-not-send="true"
href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br>
<a moz-do-not-send="true"
href="http://lists.osgeo.org/mailman/listinfo/qgis-user"
target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>