|
Download the Eye4Software GPS Toolkit fully functional 30 day trial version for free |
|
Download Eye4Software GPS Toolkit Manual |
|
Browse through the Eye4Software GPS Toolkit manual |
The Oblique Mercator Projection is used to show regions along a great circle other than the Equator (Mercator) or a meridian (Transverse Mercator). This kind of map can be made to show as a straight line the shortest distance between any two preselected points along the selected great circle.
Some projections that are derived from the Oblique Mercator projection are:
To convert Oblique Mercator coordinates, the following parameters have to be set:
The following code sample (VBScript) shows how to use the Oblique Mercator Projection from the Eye4Software GPS Toolkit:
' demo_obliquemercator.vbs
'
' This demo translates lat/lon coordinates (WGS84) to LV95 coordinates (CH1903+) using
' oblique mercator projection
'
' This demo specifies a map grid based on the Oblique Mercator projection, by setting all geodetic parameters.
'
' If you want to convert using one of the 4000 grids that are included in the component,
' you should have a look at the demo_gridsimple.vbs demo (recommended for users with less or no experience in geodesy).
Option Explicit
Dim objDatumSrc, objDatumDst, objGridSrc, objGridDst, objProjection, objConstants
Set objDatumSrc = CreateObject ( "Eye4Software.GpsDatumParameters" )
Set objDatumDst = CreateObject ( "Eye4Software.GpsDatumParameters" )
Set objGridSrc = CreateObject ( "Eye4Software.GpsGridParameters" )
Set objGridDst = CreateObject ( "Eye4Software.GpsGridParameters" )
Set objProjection = CreateObject ( "Eye4Software.GpsProjection" )
Set objConstants = CreateObject ( "Eye4Software.GpsConstants" )
WScript.Echo "Eye4Software GPS Toolkit " & objProjection.Version & " - Oblique Mercator Projection Demo"
WScript.Echo
' // Start of parameters part //
' Set Source Datum: WGS84
objDatumSrc.Axis = 6378137.000
objDatumSrc.Flattening = 298.257223563
' Set Source GridL: Latitude/Longitude
objGridSrc.Projection = 0
objGridSrc.Datum = objDatumSrc
' Set Destination Datum: WGS84
objDatumDst.Axis = 6377397.155
objDatumDst.Flattening = 299.1528128
objDatumDst.TranslationX = 674.374
objDatumDst.TranslationY = 15.056
objDatumDst.TranslationZ = 405.346
' Set destination grid: LV95
objGridDst.Projection = objConstants.GPS_PROJECTION_OBLIQUEMERCATOR
objGridDst.Datum = objDatumDst
objGridDst.FalseNorthing = 1200000
objGridDst.FalseEasting = 2600000
objGridDst.OriginLatitude = 46.95240555555556
objGridDst.OriginLongitude = 7.43958333333333
objGridDst.ScaleFactor = 1.0
' Set Source coordinates
objProjection.Latitude = 46.820000
objProjection.Longitude = 8.230000
' // End of parameters part //
' Perform the transformation
WScript.Echo "Convert from Latitude / Longitude to LV95 ( CH1903+ ) using oblique mercator projection"
WScript.Echo
WScript.Echo "Latitude = " & objProjection.Latitude
WScript.Echo "Longitude = " & objProjection.Longitude
WScript.Echo
objProjection.TransformGrid objGridSrc, objGridDst
' Return the result
WScript.Echo "Result: " & objProjection.LastError & " (" & objProjection.LastErrorDescription & ")"
WScript.Echo
If ( objProjection.LastError = 0 ) Then
WScript.Echo "Northing = " & objProjection.Northing
WScript.Echo "Easting = " & objProjection.Easting
End If
WScript.Echo "Ready."