Opened 16 years ago

Closed 16 years ago

#2060 closed defect (worksforme)

MapInfo conversion Spatial Ref

Reported by: gvanmaren Owned by: warmerdam
Priority: normal Milestone: 1.5.1
Component: OGR_SF Version: unspecified
Severity: normal Keywords: mapinfo
Cc: Daniel Morissette

Description

Hi,

I am trying to convert a projected shapefile to MapInfo format. It seems that the projection info gets lost. I noticed an old posting on the wiki (02/02/04) that describes similar issues:

http://trac.osgeo.org/gdal/ticket/481

When I create a MapInfo layer with OGR_DS_CreateLayer and OGRSpatialReferenceH defined (NZMG) -> the resulting Spatial ref for the MapInfo is geographic rather than the projected NZMG. It seems it falls back to using WGS84.

Is this still the same bug or is it not possible to define the NZMG projection?

Regards Gert

Change History (4)

comment:1 by warmerdam, 16 years ago

Cc: Daniel Morissette added
Component: defaultOGR_SF
Keywords: mapinfo added
Milestone: 1.5.0
Status: newassigned

comment:2 by warmerdam, 16 years ago

Milestone: 1.5.01.5.1
Priority: highnormal

I tried this translation:

ogr2ogr -a_srs '+proj=nzmg +datum=WGS84' -f "MapInfo File" out.tab data/esri/shape/eg_data/polygon.shp

And the resulting file has the nzmg dataset:

PROJCS["unnamed",
    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]],
    PROJECTION["New_Zealand_Map_Grid"],
    PARAMETER["latitude_of_origin",-41],
    PARAMETER["central_meridian",173],
    PARAMETER["false_easting",2510000],
    PARAMETER["false_northing",6023150],
    UNIT["Meter",1.0]]

From a quick skim your problem seems unrelated to #481. Could you provide some addition detail on what you did, and what result you got? Also, please indicate what version of GDAL/OGR you are working with.

comment:3 by gvanmaren, 16 years ago

Hi,

I tried it again and now I am getting good results. Unsure what happened before but am positive I was getting a GEOGCS instead of the correct PROJCS.

If I convert from ESRI shapefile with nzmg projection to a MapInfo file, now the resulting .tab file has the projection below:

"PROJCS["unnamed",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]],PROJECTIONNew_Zealand_Map_Grid, PARAMETER["latitude_of_origin",- 41],PARAMETER["central_meridian",173],PARAMETER["false_easting",2510000], PARAMETER["false_northing",6023150],UNIT["Meter",1.0]]"

I am using FWtools 2.0.3, gdal 1.5.0b1. Will let you know if it happens again.

Gert

comment:4 by warmerdam, 16 years ago

Resolution: worksforme
Status: assignedclosed

Gert,

Let me know if you run into problems again.

Note: See TracTickets for help on using tickets.