[Gdal-dev] Re: Decoding headers in a MIF file

Jacob Bensabat jbensabat at ewre.com
Tue May 25 03:30:57 EDT 2004


Hi
Then the question is where this information is stored ? Or if it is stored
at all ?
This information is crucial for rendering as various maps can be in various
coordinates systems
and we want to know prior to loading the map how to adapt it.
Actually shp files also have this kind of header.
thanks
jac

"Frank Warmerdam" <warmerdam at pobox.com> wrote in message
news:40ADFF95.4050800 at pobox.com...
> Jacob Bensabat wrote:
> > Hello to all
> > I am using OGR to read a Mapinfo MIF file. I can read all the data but I
> > have problems
> > decoding the header. I am interested in getting the extent of the map.
> > Here is the relevant part of the header
> >
> > Version 300
> > charset "Windows"
> > Delimiter ","
> > Index 5,6
> > CoordSys NonEarth Units "km" Bounds (-999, -999) (999, 999)
> > ....
> >
> > Using OGRSpatialReference, I am unable to get the map extent - I am
getting
> > huge number that have nothing
> > to do with the ones in the MIF file.
>
> Jacob,
>
> I don't believe that the OGRSpatialReference includes map extents of any
> kind.  Are you reading the extents from the OGRLayer for the MIF file?
> I don't think it gets it's bounds from the Bounds value in the CoordSys
> line.  It gets the extents by reading all the features and building an
MBR.
> I believe the Bounds value is supposed to indicate the bounds of validity
of
> the coordinate system, not necessarily the bounds of the dataset.
>
> 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