Copy of Projection and Transformation Calculations

download Copy of Projection and Transformation Calculations

of 37

description

PROJECTION

Transcript of Copy of Projection and Transformation Calculations

INTRODUCTION

ProjectionandTransformationCalculations.xls v3.35 12-December-2007

This spreadsheet which will carry out common calculations with coordinates. All of the concepts and formulae given in "A guide to coordinate systems in Great Britain", which is the user manual for these calculations, are detailed in this spreadsheet. "A guide to coordinate systems in Great Britain" is available from the Ordnance Survey GPS web site (www.ordnancesurvey.co.uk/gps). The guide gives some important warnings about the use of its formulae, which you should be aware of. There are also other projection functions such as scale factors, convergence and t-T in this spreadsheet that are not in the guide.

The Constants sheet is where ellipsoid, projection and Helmert transformation parameters are entered.The Enter coordinates here sheet is for user input of coordinates to the calculations.Use the buttons at the bottom left of the screen to scroll through the other sheets.Each sheet carries out a different calculation. The calculations are shown in "step by step" format where all the intermediate calculation results are given and they are also shown as results in single cells computed by user defined functions written in Visual Basic. The code for the user defined functions can be viewed and if required copied to other applications.

The calculation sheets are as follows:-Lat & Long Format Conversions converts between DMS format, decimal degrees and degrees & decimal minutes.Helmert Transformation transforms the user entered cartesian coordinates to cartesian coordinates on a new datum using the transformation parameters from Constants.XYZ to lat,long,H converts the user entered cartesian coordinates to geodetic coordinates in DMS format using the ellipsoidal parameters from Constants.lat,long to E,N projects the user entered geodetic coordinates to easting and northings using a Transverse Mercator projection and the ellipsoid and projection parameters from Constants.E,N to lat,long is the reverse of lat,long to E,N.lat,long,H to XYZ is the reverse of XYZ to lat,long,H.UD Funcs Transformation Example shows how a complete Helmert transformation from WGS84 geodetic coordinates to OSGB36 Eastings and Northings and vice versa can be carried out using the user defined functions.convergence from lat & long computes the convergence at the geodetic coordinate entered by the user.convergence from E,N computes the convergence at the easting, northing entered by the user.local scale factor from lat,lon computes the local scale factor at the geodetic coordinate entered by the user.local & line sf from E,N computes the local scale factor at the easting, northing entered by the user and also the line scale factor between easting, northing and easting2, northing2.t-T correction from E,N computes the t-T (difference between true and projected directions) between easting, northing and easting2, northing2 entered by the user.true azimuth from E,N computes the true direction (after allowing for t-T and convergence) between easting, northing and easting2, northing2 entered by the user.

Cells for user data entry are coloured Cells giving calculation results are coloured Cells showing intermediate calculation steps are colouredCells which repeat the user inputted data are coloured

ConstantsELLIPSOID AND PROJECTION CONSTANTS'"Dec DegsRadsSemi-major axis, a6377563.396True origin latitude, j0N490049.000000000.855211333Semi-minor axis, b6356256.910True origin longitude, l0W200-2.00000000-0.034906585Central Meridan Scale, F00.999601271700a for OSGB36 =6377563.3960True origin Easting, E0400000.000b for OSGB36 =6356256.9100True origin Northing, N0-100000.000a for GRS80 & WGS84 =6378137.0000aF06375020.48098897b for GRS80 =6356752.3141Slight difference in b is due to different flattening valuesbF06353722.49048791b for WGS84 =6356752.3142All other parameters sameProjection Notes1. The constants above are correct for working with the Ordnance Survey National Grid.If you want to work with OS National Grid, do not change anything in the above box.2. It is also possible to use this spreadsheet to work with Universal Transverse Mercator (UTM) grids.The constants that must be entered in the yellow boxes if you want to work with UTM are given in Annex A of'A Guide to coordinate systems in Great Britain', available from the OS GPS website www.gps.gov.uk.HELMERT TRANSFORMATION CONSTANTSETRS89 (WGS84) to OSGB36translation parallel to X-446.448metres-446.448translation parallel to Y125.157metres125.157translation parallel to Z-542.060metres-542.060scale change20.4894parts per million20.4894rotation about X-0.1502seconds of arc-0.1502rotation about Y-0.2470seconds of arc-0.2470rotation about Z-0.8421seconds of arc-0.8421reverse signs to go from OSGB36 to ETRS89Transformation Notes1. It is very important to understand the limitations of simple datum transformations.This method does not take account of the local distortions present in coordinate reference frames (TRFs)This is especially important when one or both of the coordinate systems involved is based on a traditional triangulation networkFor instance, transforming between WGS84 GPS coordinates and OSGB36 National Grid will incur transformation errorsof up to five metres, depending on location.Also, this method cannot convert ellipsoid heights to heights above mean sea level.For full details on the limitations of the method coded here, see the OS publication 'A guide to coordinate systems inGreat Britain', available free from our GPS Website (www.gps.gov.uk) or OS customer helpline.2. The constants in the table above are suitable for transforming from WGS84 GPS coordinates to OSGB36 National Grid.By changing the constants above, this spreadsheet may be used to convert between any two geodetic datumsSome ellipsoid constants are given in 'A guide to coordinate systems in Great Britain'Ordnance Survey cannot supply suitable transformation parameters for the geodetic systems of other countries -please make enquiries for these parameters to the national mapping agencies of the country concerned.

&APage &P

Enter coordinates hereEnter your coordinates in the yellow boxes'"Decimal DegRadianslatitudeN523927.25308552.657570301390.9190479779Enter either latitude and longitudelongitudeE1434.5176921.71792158100.0299833879Ellipsoidal height24.700metresEllipsoidal height is optional (see notes)Easting651409.903metresor easting and northingNorthing313177.270metresEasting 2626238.249metres2nd pair of coordinates is optional (see notes)Northing 2302646.415metresCartesian X3909833.018metresor Earth centred Cartesian XYZ coordinatesCartesian Y-147097.138metresCartesian Z5020322.478metresNotes1. Type your input data in the yellow boxes only on this page.Enter either Latitude, Longitude and optional Ellipsoidal height, Easting and Northing or Earth centred Cartesian coordinates.To convert from decimal latitude and longitude or degrees lat / long and decimal minutes to the degrees, minutes and seconds formatsee the "Lat & Long Format Conversions " sheet.Ellipsoidal height is only required for the Cartesian XYZ coordiante conversions.The Earth centred Cartesian coordinates are used as input to the Helmert datum transformation calculations.Look at the following sheets to see the results of the calculations.2. Check that the appropriate parameters are set on the "Constants" sheet.3. For two of the calculations (t-T correction and true azimuth), the eastings and northings of two points are required.For these calculations only, you must enter Eastings 2 and Northings 2 in addition to Easting and Northing4. For background information on the calculations contained in this spreadsheet, download 'A Guide to Coordinate Systemsin Great Britain' from our GPS website www.gps.gov.uk, or see any textbook on map projections or surveying computations.

&APage &P

Lat & Long Format ConversionsLatitude & Longitude Format Conversions (Enter your coordinates in the yellow boxes)Degrees, Minutes & Seconds to Decimal Degrees and Degrees & Decimal MinutesInput DataOutput DataDegrees ()Minutes (')Seconds (")Decimal DegreesDegrees & Decimal MinuteslatitudeN523927.25310052.657570305556N5239.454218333longitudeE1434.5177001.717921583333E143.075295000Decimal Degrees to Degrees, Minutes & Seconds and Degrees & Decimal MinutesOutput DataInput DataOutput DataDegrees ()Minutes (')Seconds (")Decimal DegreesDegrees & Decimal MinuteslatitudeN523927.25310052.657570305556N5239.454218333longitudeE1434.5177001.717921583333E143.075295000Degrees & Decimal Minutes to Degrees, Minutes & Seconds and Decimal DegreesOutput DataInput DataDegrees ()Minutes (')Seconds (")Decimal DegreesDegrees & Decimal MinuteslatitudeN523927.25310052.657570305556N5239.454218333longitudeE1434.5177001.717921583333E143.075295000

Helmert TransformationHelmert Datum TransformationX3909833.018This is the input dataY-147097.1376Z5020322.4777X3909460.068This is the result of the calculationY-146987.301Z5019888.070Rotation and Scale Matrix (H)These values are intermediate calculation steps for the1.00002048944.08261601E-06-1.19748979E-06formulae given in 'A Guide to Coordinate Systems in Great Britain'-4.08261601E-061.00002048947.28190149E-071.19748979E-06-7.28190149E-071.0000204894See the Transformation Notes on the"Constants" page for information on theTranslation Matrix (T)Parameters (see "Constants" sheet)limitations and accuracy of this transformation.-446.448translation parallel to X-446.448m125.157translation parallel to Y125.157m-542.06translation parallel to Z-542.060mscale change20.4894ppmH * Input Cartesian coordsrotation about X-0.1502secs3909906.51580659rotation about Y-0.2470secs-147112.458129588rotation about Z-0.8421secs5020430.13019519X3909460.068This is the result of the calculation using user defined functions.Y-146987.301To see the Visual Basic code of the functions -Z5019888.070Menu = Tools, Macro, Visual Basic Editor,then view the code in "Module 1".

XYZ to lat,long,HCartesian XYZ to Latitude, longitude and Ellipsoidal heightX3909833.018This is the input dataY-147097.1376Z5020322.4777'"Decimal DegRadianslatitudeN521516.60643352.254612898020.9120150444This is the result of the calculationlongitudeW2916.510138-2.154586149489-0.0376046223Ellipsoidal height626.294mp3912599.110These values are intermediate calculation steps for thee26.6705397616E-03formulae given in 'A Guide to Coordinate Systems in Great Britain'Initial jN521516.672152.25463114770.9120153629The radians value of latitude is computed using a user defined functionn6.3909051545E+06To see the Visual Basic code of the function -Menu = Tools, Macro, Visual Basic Editor,then view the code in "Module 1".latitudeN521516.60643352.25461289802This is the result of the calculation using user defined functions.longitudeW2916.510138-2.154586149489To see the Visual Basic code of the functions -Ellipsoidal height626.294mMenu = Tools, Macro, Visual Basic Editor,then view the code in "Module 1".

&APage &P

lat,long to E,NLatitude and longitude to easting and northinglatitudeN523927.253085This is the input datalongitudeE1434.517692Easting651409.903mThis is the result of the calculationNorthing313177.270me26.67053976E-03These values are intermediate calculation steps for then1.67322025E-03formulae given in 'A Guide to Coordinate Systems in Great Britain'n6.38850233E+06r6.37275644E+06The value of M is computed using a user defined functionh22.47081362E-03To see the Visual Basic code of the function -P6.48899729E-02Menu = Tools, Macro, Visual Basic Editor,M4.06688295E+05then view the code in "Module 1".I3.06688295E+05II1.54040791E+06III1.56068754E+05IIIA-2.06711230E+04IV3.87512058E+06V-1.70000782E+05VI-1.01344704E+05Easting651409.903mThis is the result of the calculation using user defined functions.Northing313177.270mTo see the Visual Basic code of the functions -Menu = Tools, Macro, Visual Basic Editor,then view the code in "Module 1".

&APage &P

E,N to lat,longEasting and Northing to Latitude and LongitudeEasting651409.903This is the input dataNorthing313177.270'"Decimal DegRadianslatitudeN523927.25308752.657570301810.91904797787This is the result of the calculationlongitudeE1434.5176921.717921581000.02998338788j'N524257.27844552.71591067920.92006620954These values are intermediate calculation steps for thee26.67053976E-03formulae given in 'A Guide to Coordinate Systems in Great Britain'n6.38852334E+06r6.37281931E+06The radians value of j' and the value of M are computed using user defined functionsh22.46422052E-03To see the Visual Basic code of the functions -M4.13177270E+05Menu = Tools, Macro, Visual Basic Editor,Et2.51409903E+05then view the code in "Module 1".VII1.61305625E-14VIII3.33955474E-28IX9.41985617E-42X2.58400625E-07XI4.69859700E-21XII1.61243166E-34XIIA6.65773163E-48latitudeN523927.25308752.65757030181This is the result of the calculation using user defined functions.longitudeE1434.5176921.71792158100To see the Visual Basic code of the functions -Menu = Tools, Macro, Visual Basic Editor,then view the code in "Module 1".

&APage &P

lat,long,H to XYZLatitude, longitude and Ellipsoidal height to Cartesian XYZlatitudeN523927.253085This is the input datalongitudeE1434.517692Ellipsoidal height24.700mX3874938.850mThis is the result of the calculationY116218.624mZ5047168.208me26.6705397616E-03These values are intermediate calculation steps for then6.3910506260E+06formulae given in 'A Guide to Coordinate Systems in Great Britain'X3874938.850mThis is the result of the calculation using user defined functions.Y116218.624mTo see the Visual Basic code of the functions -Z5047168.208mMenu = Tools, Macro, Visual Basic Editor,then view the code in "Module 1".

UD Funcs Tranformation ExampleThis sheet gives an example of how the user defined functions stored in this workbook can be used.To see the Visual Basic code of the functions, menu = Tools, Macro, Visual Basic Editor, then view the code in "Module 1".A WGS84 lat, long and height (e.g. from a handheld GPS receiver) is converted and transformed in stages to an OSGB36 easting, northing and approx ODN height.The reverse transformation from OSGB36 to WGS84 is then performed.The results of each stage are all produced by user defined functions in single cells (i.e. there are no intermediate steps done in other cells).The outputs of the previous stage are passed as inputs to the next stage. Other parameters used are on the right of each stage.Note : be aware when changing the layout of this sheet that all cell references are ABSOLUTE. This is so that function inputs can be easily identified.WGS 84 to OSGB36WGS84 Latitude, longitude and Ellipsoidal height to WGS84 Cartesian XYZ'"Dec DegsUser inputs DMS and Height. Decimal degrees andlatitudeN523928.72300352.65797861194Inputheight are the input to the user defined functions.longitudeE14257.7872531.71605201472The DMS values are converted to decimal usingEllipsoidal height69.391mstandard Excel functionsX3875311.465mOutputEllipsoid parameters (WGS84)Y116103.234ma =6378137.000Z5047602.291mb =6356752.314Helmert Datum Transformation (WGS84 to OSGB36)Transformation (WGS84 to OSGB36)X3875311.465mInputtranslation parallel to X =-446.448Y116103.234mSee the Transformation Notes on thetranslation parallel to Y =125.157Z5047602.291m"Constants" page for information on thetranslation parallel to Z =-542.060X3874938.849mOutputlimitations and accuracy of thisscale change =20.4894Y116218.624mtransformation.rotation about X =-0.1502Z5047168.210mrotation about Y =-0.2470rotation about Z =-0.8421OSGB36 Cartesian XYZ to OSGB36 Latitude, longitude and approx ODN heightThe decimal degrees and height are the output ofX3874938.849mInputthe user defined functions.Y116218.624mThe decimal values are converted to DMS usingZ5047168.210mstandard Excel functions'"Dec DegsEllipsoid parameters (OSGB36)latitudeN523927.25313552.657570315182Outputa =6377563.396longitudeE1434.5177101.717921586082b =6356256.910~ODN height24.701mOSGB36 Latitude and longitude to OSGB36 easting and northing'"Dec DegsThe decimal degrees are the input to thelatitudeN523927.25313552.657570315182Inputuser defined functions.longitudeE1434.5177101.717921586082The decimal values are converted to DMS usingEasting651409.903mOutputstandard Excel functionsNorthing313177.271mEllipsoid and projection parameters (OSGB36)a =6377563.396b =6356256.910f0 =0.9996012717e0 =400000n0 =-100000j0 =49.00000l0 =-2.00000OSGB36 to WGS84OSGB36 easting and northing to OSGB36 latitude and longitudeThe eastings, northings and approx ODN height areeasting651409.903mInputinput by the user. User defined functions convertnorthing313177.270mthem to dec degrees. The decimal degrees are'"Dec Degsconverted to DMS using standard Excel functionslatitudeN523927.25309552.657570304134OutputEllipsoid and projection parameters (OSGB36)longitudeE1434.5176991.717921583102a =6377563.396~ODN height24.700mb =6356256.910f0 =0.9996012717e0 =400000n0 =-100000j0 =49.00000l0 =-2.00000OSGB36 latitude, longitude and approx ODN height to OSGB36 cartesian XYZ'"Dec DegsDecimal degrees and height are the input to thelatitudeN523927.25309552.65757030413Inputuser defined functions.longitudeE1434.5176991.71792158310The DMS values are converted to decimal using~ODN height24.700mstandard Excel functionsX3874938.849mOutputEllipsoid parameters (OSGB36)Y116218.624ma =6377563.396Z5047168.208mb =6356256.910Helmert Datum Transformation (OSGB36 to WGS84)Transformation (OSGB36 to WGS84)X3874938.849mInputtranslation parallel to X =446.448Y116218.624mSee the Transformation Notes on thetranslation parallel to Y =-125.157Z5047168.208m"Constants" page for information on thetranslation parallel to Z =542.060X3875311.472mOutputlimitations and accuracy of thisscale change =-20.4894Y116103.230mtransformation.rotation about X =0.1502Z5047602.299mrotation about Y =0.2470rotation about Z =0.8421WGS84 Cartesian XYZ to WGS84 Latitude, longitude and Ellipsoidal heightThe decimal degrees and height are the output ofX3875311.472mInputthe user defined functions.Y116103.230mThe decimal values are converted to DMS usingZ5047602.299mstandard Excel functions'"Dec DegsEllipsoid parameters (WGS84)latitudeN523928.72298052.657978605604Outputa =6378137.000longitudeE14257.7870421.716051956076b =6356752.314Ellipsoidal height69.402m

convergence from lat & longGrid convergence from Latitude and LongitudelatitudeN523927.253085This is the input datalongitudeE1434.517692'"Decimal DegRadiansconvergence25726.5561142.957376698400.0516159606This is the result of the calculationn6.38850233E+06These values are intermediate calculation stepsr6.37275644E+06h22.47081362E-03XIII7.95024505E-01XIV9.82300034E-02XV2.02438381E-03convergence25726.5561142.95737669840This is the result of the calculation using a user defined function.To see the Visual Basic code of the function -Menu = Tools, Macro, Visual Basic Editor,then view the code in "Module 1".NotesGrid convergence is the angle FROM the meridian line through a point TO the North-South grid line at the same point. A positive angle is clockwise.

&APage &P

convergence from E,NGrid convergence from Easting and NorthingEasting651409.903This is the input dataNorthing313177.270'"Decimal DegRadiansconvergence25726.5561482.95737670770.05161596077This is the result of the calculationj'524257.27844552.71591067920.92006620954These values are intermediate calculation stepsn6.38852334E+06r6.37281931E+06The radians value of j' is computed using a user defined functionh22.46422052E-03To see the Visual Basic code of the function -Et2.51409903E+05Menu = Tools, Macro, Visual Basic Editor,XVI2.05594320E-07then view the code in "Module 1".XVII4.57174659E-21XVIII1.60898687E-34convergence25726.5561482.957376708This is the result of the calculation using a user defined function.To see the Visual Basic code of the function -Menu = Tools, Macro, Visual Basic Editor,then view the code in "Module 1".NotesGrid convergence is the angle FROM the meridian line through a point TO the North-South grid line at the same point. A positive angle is clockwise.

&APage &P

local scale factor from lat,lonLocal scale factor from Latitude and LongitudelatitudeN523927.253085This is the input datalongitudeE1434.517692factor1.00037733This is the result of the calculationn6.38850233E+06These values are intermediate calculation stepsr6.37275644E+06h22.47081362E-03XIX1.84422569E-01XX-1.03620198E-02factor1.00037733This is the result of the calculation using a user defined function.To see the Visual Basic code of the function -Menu = Tools, Macro, Visual Basic Editor,then view the code in "Module 1".NotesLocal scale factor is the scale distortion inherent in the map projection at a point

&APage &P

local & line sf from E,NLocal scale factor from Easting and NorthingEasting651409.903This is the input dataNorthing313177.270factor1.00037732This is the result of the calculation'"Decimal DegRadiansThese values are intermediate calculation stepsj'524257.27844552.7159106790.9200662095n6.38852334E+06The radians value of j' is computed using a user defined functionr6.37281931E+06To see the Visual Basic code of the function -h22.46422052E-03Menu = Tools, Macro, Visual Basic Editor,XXI1.22811183E-14then view the code in "Module 1".XXII2.53854231E-29factor1.00037732This is the result of the calculation using a user defined function.To see the Visual Basic code of the function -Menu = Tools, Macro, Visual Basic Editor,then view the code in "Module 1".NotesLocal scale factor is the scale distortion inherent in the map projection at a pointFor a long line the scale factor at the mid point should be calculated. For lines up to 30km in length this will give a result with an error not exceeding 1 to 2 ppm.If still greater accuracy is required compute a line scale factor using Simpson's Rule as shown below.The line scale factor between Point 1 (East1, North1) and Point 2 (East2, North2)is the projected distance between the points divided by the true (geodesic) distance.Line scale factor = (1/6)(F1 + 4Fm + F2)Where F1 = scale factor at Point 1; F2 = scale factor at Point 2 and Fm = scale factor at mid point between Point 1 and Point 2.e.g.: -1.00037732= Scale factor at Point 1 (East1,North1)1.00022969= Scale factor at Point 2 (East2,North2)1.0003015598= Scale factor at mid point of Point 1 (East1,North1) and Point 2 (East2,North2)1.00030221= Line scale factor for line between Point 1 (East1,North1) and Point 2 (East2,North2)

&APage &P

t-T correction from E,Nt-T correction from Eastings and NorthingsEasting651409.903This is the input dataNorthing313177.270Easting 2626238.249Northing 2302646.415'"Decimal DegRadians(t1 - T1)006.4829430.001800817370.00003143019240This is the result of the calculation(t2 - T2)-006.259111-0.00173864187-0.00003034502515Nm307911.8425These values are intermediate calculation stepsM4.07911842E+05j'52406.85517152.66857088090.9192399742The radians value of j' and the value of M are computed using user defined functionsn6.38850630E+06To see the Visual Basic code of the functions -r6.37276830E+06Menu = Tools, Macro, Visual Basic Editor,XXIII4.09374978E-15then view the code in "Module 1".(t1 - T1)006.4829430.00180081737This is the result of the calculation using a user defined function.(t2 - T2)-006.259111-0.00173864187To see the Visual Basic code of the function -Menu = Tools, Macro, Visual Basic Editor,then view the code in "Module 1".Notest-T correction is the difference between true direction and projected direction due to the curving of straight lines on the projection

&APage &P

true azimuth from E,NTrue Azimuth from eastings and northingsEasting651409.903This is the input dataNorthing313177.270Easting 2626238.249Northing 2302646.415'"Decimal DegRadiansTrue Azimuth(1 to 2)2501510.839516250.2530109774.367739005This is the result of the calculationGrid Bearing(1 to 2)2471750.766311247.29743508634.316154474These values are intermediate calculation stepsC125726.5561482.95737670770.0516159608(t1 - T1)006.4829430.0018008170.000031430True Azimuth(1 to 2)2501510.839516250.253010977This is the result of the calculation using a user defined function.To see the Visual Basic code of the function -Menu = Tools, Macro, Visual Basic Editor,then view the code in "Module 1".NotesThe true azimuth from one point (easting, northing) to a second point (easting 2, northing 2)is computed by applying the convergence and t-T corrections to the grid bearing.

&APage &P