[Gdal-dev] Numerical problems with geometries in MapInfo Files

Frank Warmerdam warmerdam at pobox.com
Tue Sep 27 14:06:29 EDT 2005


On 9/27/05, Ari Jolma <ari.jolma at tkk.fi> wrote:
> Hello,
>
> I have geom.AddPoint and respective geom.GetX, geom.GetY method calls in
> my test code (swig/perl API). I make point, line and polygon geometries.
> I create the geometry, save it on disk, open it, and read it. Currently
> I'm testing only Shapefiles and MapInfo files. All is well with
> shapefles but with mapinfo files the returned values seem to differ from
> those saved often. For example a point (1,1) is returned as (0.99,
> 1.005). What could be the reason for this, does anybody have any ideas?

Ari,

The Mapinfo TAB format does not support true floating point values for
geometry locations.  Instead 32bit integers are used, and an extents
and resolution need to be determined.  I suspect you are seeing the
precision issues that this causes.  There are different decisions made
in MITAB about the extents and resolution based on the coordinate
system passed in on layer creation.

You might want to read over the MapInfo TAB driver page for more info
at:

  http://www.gdal.org/ogr/drv_mitab.html

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