[gdal-dev] Output MapInfo File with CoordSys Information
Frank Warmerdam
warmerdam at pobox.com
Tue Sep 22 22:57:44 EDT 2009
Reinaldo escada Chohfi wrote:
> Hello List,
>
> I am still trying to get a x,y (lon/Lat) point file in MapInfo format with
> coordinate information.
>
> I get the correct MapInfo files out (.tab or .mif) with the x,y points and
> attributes, but without the CoordSys information.
> The output file is always Non-Earth.
>
> I've tried everything:
>
> OGRSpatialReference oSRS;
> oSRS.SetWellKnownGeogCS("EPSG:4326");
> oSRS.importFromMICoordSys( "CoordSys Earth Projection 1, 104" );
>
>
> Could someone PLEASE let me know what to do?
Reinaldo,
I just tried:
ogr2ogr -skipfailures -f "MapInfo File" out.mif GB4X0000.000 TUNNEL
and this produced a mapinfo mid/mif fileset with "CoordSys Earth
Projection 1, 104" as the coord sys line. I also tested a small
program:
#include "gdal.h"
#include "ogr_spatialref.h"
int main()
{
OGRSpatialReference oSRS;
oSRS.importFromMICoordSys( "CoordSys Earth Projection 1, 104" );
}
and it appeared to correctly parse the Coordsys into a WGS84 srs.
I even tried:
ogr2ogr -a_srs wgs84.wkt -skipfailures -f "MapInfo File" out.mif
data/s57/GB4X0000.000 TUNNEL
with wgs84.wkt holding:
GEOGCS["unnamed",DATUM["WGS_1984",SPHEROID["WGS
84",6378137,298.257223563],TOWGS84[0,0,0,-0,-0,-0,0]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]
and things seemed to work.
Can you provide a more complete example that is failing for you?
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