Register  |  Login   Search
ThinkGeo - GPS Tracking and Mapping Solutions  |  Home  |  Cygnus Track  |  Blog
 
LivePerson Chat

Discussion Forums

The online community for users of Map Suite GIS components

Subject: Converting map layer from Decimal Degrees to UTM83
Prev Next
You are not authorized to post a reply.
Author Messages
5/01/2008 5:55 PM  

Hello,

I would like to know how to convert map layer from decimal degrees to UTM83.

The New layer constructor does not have projection class parameter and I can not find IProjection interface to implement.

Is it possible? If not, what is the suggestion/resolution?

Thanks.

5/02/2008 10:14 AM  
There is a Projection class for UTM83 in the Geometry namespace to go from and to Geodetic (Lon/Lat).
See example in VB.NET

Dim GeoUTM As New MapSuite.Geometry.GeodeticUTM83(15, Hemisphere.Northern, UTMGeodeticDirection.GeodeticToUTM)
Dim Layer As New Layer("...\myshapefile.shp", GeoUTM)

If you want to create yourself a Projection class for UTM83 implementing the IProjection interface:

Public Class GeodeticUTM83 : Implements IProjection
Private mZone As Integer
Private mDirection As UTMGeodeticDirection
Private mHemisphere As Hemisphere
Private IsNorthernHemisphere As Boolean = True

Sub New()

End Sub

Sub New(ByVal Zone As Integer, ByVal Hemisphere As Hemisphere, ByVal Direction As UTMGeodeticDirection)
mZone = Zone
mHemisphere = Hemisphere
If mHemisphere = Hemisphere.Southern Then IsNorthernHemisphere = False
mDirection = Direction
End Sub

Public Property Zone() As Integer
Get
Return mZone
End Get
Set(ByVal Value As Integer)
mZone = Value
End Set

End Property

Public Property Direction() As UTMGeodeticDirection
Get
Return mDirection
End Get
Set(ByVal Value As UTMGeodeticDirection)
mDirection = Value
End Set
End Property

Public Property Hemisphere() As Hemisphere
Get
Return mHemisphere
End Get
Set(ByVal Value As Hemisphere)
mHemisphere = Value
If mHemisphere = Hemisphere.Southern Then IsNorthernHemisphere = False
End Set
End Property

Public Function ProjectPoint(ByVal X As Double, ByVal Y As Double) As MapSuite.Geometry.PointR Implements MapSuite.Geometry.IProjection.ProjectPoint
Dim UTMProj As New UTMProj

Dim Easting, Northing As Double
If mDirection = UTMGeodeticDirection.GeodeticToUTM Then
UTMProj.ConvertGeodeticZoneToUTM(Y, X, mZone, Easting, Northing, IsNorthernHemisphere)
Else
UTMProj.ConvertUTMToGeodetic(mZone, IsNorthernHemisphere, X, Y, Northing, Easting)
End If
Return New PointR(Easting, Northing)
End Function
End Class

5/02/2008 11:31 AM  

Thank You for response.

Unfortunately I can not find MapSuite.Geometry.GeodeticUTM83 class. I'm using MapSuite PocketPC Edition 1.0.0.0.

See MapSuite.Geometry attachment.

I can not access IProjection. I expect to get Implements MapSuite.Geometry.IProjection but this is what I get: Implements MapSuite.ILabeler. This is the only choice.  See MapSuite attachment.









5/06/2008 10:21 AM  
I have to apologize. I gave you the solution for Desktop and Web editions. Projections are not supported in the Pocket PC edition, so you have to work with all your data (Layers and MapShapes) in the same projection. I would suggest using a general GIS tool such as ArcView to have your shapefiles saved to the projection UTM83. That way all your layers are natively in that projection.
You are not authorized to post a reply.
Forums > Map Suite 2.x GIS Components > Map Suite Pocket PC > Converting map layer from Decimal Degrees to UTM83



ActiveForums 3.7