Opened 15 years ago
Closed 6 years ago
#2802 closed defect (fixed)
[PATCH] ImportFromMICoordSys() does not set linear units in OGRSpatialReference
Reported by: | Daniel Morissette | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | OGR_SRS | Version: | unspecified |
Severity: | normal | Keywords: | MITAB |
Cc: | kfaschoway |
Description
A GDAL/OGR user reported the following issue to me:
I am using the latest version of GDAL, and I am running into a glitch with the Spatial Reference class. (OGRSpatialReference)
I am using the new ImportFromMICoordSys(coordSysString) function. The problem is that this function does not set the Linear Units of the spatial reference object created. The function GetLinearUnits() and getLinearUnitsName()in the C# wrapper are the functions used to get this information. Even if I do a FixUp()function, this only sets the linear units to the default Meters.
The linear units of the projection are available inside the MapInfo Coordinate system string, and these should be set to allow proper use of the coordinate system. I have come up with a work around for my use, but thought this should get passed along to whoever wrote the code for the ImportFromMICoordSys function.
Attachments (1)
Change History (7)
comment:1 by , 15 years ago
Keywords: | MITAB added |
---|
comment:2 by , 15 years ago
Cc: | added |
---|
comment:3 by , 15 years ago
here are two mapinfo coordinate system strings:
Coordsys Earth Projection 8, 66, 7, -141, 0, 0.9996, 500000, 0
This is a UTM, Zone 7, NAD27 for Canada. The linear units should be meters.
Coordsys Earth Projection 8, 74, 8, -85.8333333333, 30.5, 0.99996, 656166.6667, 0
This is a US State Plane coordinate system, in Feet. (Alabama 0101, Eastern Zoon, 1983).
The linear units should be feet.
Both projection strings fail to set the linear units on import, and after a FixUP is performed, they end up as meters...
comment:4 by , 15 years ago
Summary: | ImportFromMICoordSys() does not set linear units in OGRSpatialReference → [PATCH] ImportFromMICoordSys() does not set linear units in OGRSpatialReference |
---|
Daniel, here's patch inspired from MIF documentation found at http://www.gissky.com/Download/Down.asp?id=212&url=3&KeyCode=1OF6JV7ihC124jr7 (page 27-28) that solves the issue in the 2 above cases.
by , 15 years ago
Attachment: | ticket_2802.patch added |
---|
comment:6 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patch has since then been incorporated into a different but equivalent form
Daniel,
There is support for linear units in the mapinfo coordsys parser, but it may not be complete. I will need a sample CoordSys string that isn't being handled properly to do anything further.