[Gdal-dev] ogr2ogr and MapInfo

Fischer, Andreas andreas.fischer at kreis-unna.de
Thu Nov 10 10:40:28 EST 2005


Hi Frank,
thanks for continue talking about this problem! 
Yes, that's right. Dropping the Bounds-Clause in the MIF-File "only"
improves the precision of the imported data (the MapInfo-Relation). I think
it is because of the wide range given in the Bounds of (-30000000,
-15000000) (30000000, 15000000). The range is much wider than the range
covered by the projection EPSG:31463 (Gauss Krueger - DHDN, Zone 3). Further
this projection does not know negativ values. I think this Clause simply
doesn't fit this projection very well, even though at first sight
erverything looks almost o.k.. Overlaying both data in different colors show
both colors at some points. This should not be possible, when the data
really match. So when you zoom in very deep you will discover that the
original data of MapInfo and the
"GetIntoPostGis-GetOutofPostGisIntoMIF-GetIntoMapInfoImported Data" don't
really match. And after I compared the coordinates, the differences I can
see make sense. The coordinates of equal points are not the same anymore! It
is only a couple of cm but it is not the same, as it should be since data
haven't got changed on purpose.
In the HELP-texts of MapBasic I found a hint on the Bounds-Clause, that
seems to point in the same direction:
"In a Create Map statement, you can increase the precision of the
coordinates in the map by specifying narrower Bounds."
That are my asumptions on this problem. When importing the data from MIF
without Bounds-Clause, you get exactly the same data and coordinates. I just
tried it out again before writing this.
So a layer creation option to disable the bounds would solve this problem
:-)
Best regards
Andreas Fischer

-----Ursprüngliche Nachricht-----
Von: Frank Warmerdam [mailto:warmerdam at pobox.com]
Gesendet: Donnerstag, 10. November 2005 15:28
An: Fischer, Andreas
Cc: Gdal-dev at lists.maptools.org
Betreff: Re: [Gdal-dev] ogr2ogr and MapInfo


On 11/10/05, Fischer, Andreas <andreas.fischer at kreis-unna.de> wrote:
> Dear list,
> I still did some experiences getting PostGIS-data to MapInfo MIF-files.
> Everything works well whenn (!)  I drop the Bounds-Clause in the MIF-File
> before importing it to MapInfo. Now I'd like to know if there is a
> possibility to avoid ogr2ogr writing this clause at the end for the
CoordSys
> line. To get a MIF-file imported this clause is not nessesary and dropping
> this clause increases the precision of my data. Now I have to drop this
> clause manualy after creating the MIF-file and therefore I can't get the
> conversion done automatically.
>
> In the documentation to the different formats I found the following:
>
> "We should fix the driver at some point to set valid default bounds for
each
> projection, but for the time being, the MapInfo driver sets the following
> default bounds when a new layer is created: For a file in
> - LAT/LON (geographic) coordinates: BOUNDS (-180, -90) (180, 90)
> - For any other projection: BOUNDS (-30000000, -15000000) (30000000,
> 15000000) "
>
> And that is what it does with my MIF-File. The line looks as follows:
> "CoordSys Earth Projection 8, 104, "m", 9, 0, 1, 3500000, 0
> Bounds(-30000000, -15000000) (30000000, 15000000)"
>
> Does this mean that this functionality is fixed in the source code of the
> programm? May this be changed by myself or has anyone another idea to
> workaround this problem? Conversion would be perfect than!
> Thank you for your help!

Andreas,

I would have no objection to adding a layer creation option
which would disable the bounds.  Do you have any idea
why the bounds are causing the import into mapinfo to fail?
Does your data fall outside the indicated bounds?

Re-reading your message I get the impression that dropping
it just improves the precision the data is imported with in
MapInfo, is that right?

Best regards,
--
---------------------------------------+------------------------------------
--
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list