Wolfram Language

Geo Computation

Choice of Datum

Take data for the polygon of the City of London from https://geoportal.statistics.gov.uk.

show complete Wolfram Language input
In[1]:=
Click for copyable input
coords = {{532140.3, 182191.9}, {532141.5, 182188.7}, {532142.4, 182189.0}, {532146.6, 182190.3}, {532158.3, 182151.1}, {532189.3, 182166.7}, {532191.5, 182161.7}, {532253.2, 182188.7}, {532287.9, 182097.9}, {532304.3, 182035.1}, {532309.6, 182006.1}, {532342.0, 182013.2}, {532359.9, 182018.8}, {532361.7, 182008.8}, {532374.0, 182012.4}, {532382.4, 181991.3}, {532436.4, 182009.7}, {532447.6, 181959.0}, {532461.4, 181957.9}, {532486.1, 181954.8}, {532517.4, 181951.0}, {532548.5, 181945.1}, {532594.7, 181937.5}, {532634.5, 181929.1}, {532633.8, 181926.2}, {532615.1, 181845.7}, {532630.8, 181839.4}, {532664.3, 181825.9}, {532746.8, 181786.9}, {532788.1, 181764.5}, {532871.4, 181727.1}, {532880.5, 181723.4}, {532901.5, 181777.4}, {532907.4, 181792.9}, {532924.1, 181838.3}, {532935.7, 181871.7}, {532946.1, 181894.9}, {533078.9, 181840.5}, {533119.2, 181869.8}, {533146.8, 181897.9}, {533167.5, 181925.3}, {533182.4, 181945.4}, {533184.6, 181948.2}, {533198.6, 181978.0}, {533215.8, 182024.1}, {533230.5, 182082.5}, {533250.9, 182075.9}, {533320.2, 182053.4}, {533410.7, 182037.9}, {533394.1, 181985.1}, {533389.4, 181951.5}, {533387.4, 181942.3}, {533387.6, 181941.8}, {533378.8, 181881.7}, {533368.0, 181807.7}, {533352.0, 181739.8}, {533427.7, 181752.9}, {533445.1, 181755.9}, {533448.9, 181702.3}, {533442.1, 181700.3}, {533455.3, 181676.3}, {533467.0, 181660.8}, {533472.0, 181653.0}, {533475.5, 181646.1}, {533478.8, 181634.1}, {533496.7, 181587.9}, {533499.1, 181582.4}, {533532.5, 181506.6}, {533535.5, 181501.3}, {533536.9, 181498.9}, {533539.7, 181494.0}, {533567.4, 181457.5}, {533659.4, 181359.4}, {533683.2, 181331.7}, {533709.9, 181298.0}, {533719.6, 181286.8}, {533743.7, 181261.4}, {533765.8, 181226.1}, {533779.4, 181175.8}, {533786.9, 181142.7}, {533787.1, 181142.1}, {533796.8, 181094.9}, {533807.2, 181027.9}, {533814.3, 180968.9}, {533816.0, 180954.9}, {533820.9, 180928.3}, {533826.1, 180907.5}, {533832.8, 180888.8}, {533837.3, 180865.4}, {533838.0, 180857.8}, {533839.5, 180839.6}, {533839.6, 180808.4}, {533838.3, 180801.5}, {533834.7, 180794.9}, {533829.5, 180784.5}, {533824.3, 180779.6}, {533813.9, 180779.6}, {533787.5, 180779.0}, {533765.9, 180776.8}, {533751.0, 180771.6}, {533740.9, 180766.7}, {533725.5, 180759.3}, {533711.8, 180761.2}, {533696.7, 180763.9}, {533657.2, 180741.4}, {533646.6, 180736.0}, {533645.4, 180735.4}, {533642.7, 180739.5}, {533641.3, 180741.4}, {533637.5, 180746.7}, {533637.1, 180747.0}, {533632.9, 180750.2}, {533631.1, 180771.9}, {533630.6, 180777.1}, {533609.8, 180774.1}, {533604.0, 180813.0}, {533602.5, 180812.9}, {533595.3, 180812.4}, {533594.4, 180822.4}, {533575.5, 180819.9}, {533552.2, 180816.9}, {533552.4, 180813.1}, {533553.3, 180798.6}, {533553.8, 180789.7}, {533551.4, 180784.5}, {533540.4, 180783.1}, {533505.8, 180778.7}, {533491.3, 180771.9}, {533479.5, 180761.7}, {533465.8, 180745.3}, {533450.4, 180719.8}, {533443.6, 180703.6}, {533442.9, 180696.0}, {533440.9, 180695.6}, {533417.5, 180691.8}, {533412.8, 180659.4}, {533406.8, 180658.6}, {533403.5, 180652.0}, {533404.2, 180651.7}, {533428.2, 180639.4}, {533425.5, 180629.5}, {533429.3, 180627.6}, {533430.4, 180627.1}, {533429.4, 180625.1}, {533420.5, 180607.3}, {533409.0, 180580.4}, {533408.7, 180571.4}, {533405.7, 180558.9}, {533396.9, 180522.3}, {533389.8, 180523.6}, {533387.6, 180516.4}, {533386.0, 180510.8}, {533376.1, 180503.1}, {533362.1, 180488.6}, {533360.5, 180486.9}, {533334.2, 180406.7}, {533326.8, 180409.6}, {533293.1, 180420.1}, {533273.3, 180425.2}, {533268.6, 180426.4}, {533249.7, 180431.0}, {533213.1, 180439.6}, {533160.9, 180450.4}, {533105.2, 180462.5}, {533072.5, 180467.7}, {533053.5, 180472.9}, {533005.7, 180484.5}, {532985.0, 180488.9}, {532951.0, 180492.2}, {532946.7, 180492.6}, {532944.0, 180492.8}, {532921.4, 180494.3}, {532875.0, 180499.8}, {532812.9, 180505.1}, {532806.6, 180505.6}, {532806.1, 180505.7}, {532782.3, 180509.8}, {532745.7, 180515.5}, {532721.6, 180518.4}, {532715.0, 180519.6}, {532684.4, 180524.9}, {532627.0, 180531.7}, {532572.7, 180541.7}, {532515.3, 180550.9}, {532485.0, 180559.9}, {532464.7, 180566.6}, {532452.6, 180571.1}, {532428.2, 180581.8}, {532369.0, 180606.9}, {532303.5, 180628.8}, {532278.6, 180637.8}, {532248.8, 180647.1}, {532228.8, 180651.9}, {532170.6, 180663.1}, {532109.1, 180671.2}, {532052.5, 180677.7}, {531998.8, 180683.8}, {531954.6, 180687.0}, {531936.6, 180688.1}, {531840.8, 180694.6}, {531721.9, 180692.7}, {531700.1, 180696.0}, {531660.8, 180695.1}, {531661.1, 180674.7}, {531671.3, 180671.8}, {531669.9, 180670.4}, {531659.9, 180664.6}, {531661.7, 180615.6}, {531669.3, 180610.1}, {531660.8, 180605.2}, {531660.8, 180578.4}, {531660.5, 180558.0}, {531662.9, 180544.3}, {531663.2, 180536.1}, {531629.7, 180533.6}, {531626.3, 180540.8}, {531625.5, 180551.3}, {531628.1, 180557.4}, {531628.2, 180601.1}, {531628.2, 180606.1}, {531623.9, 180609.7}, {531622.4, 180611.0}, {531627.6, 180612.3}, {531628.8, 180650.9}, {531628.2, 180666.7}, {531622.4, 180667.0}, {531621.9, 180667.9}, {531620.3, 180670.7}, {531627.9, 180673.9}, {531628.2, 180674.0}, {531628.8, 180696.6}, {531591.4, 180695.7}, {531563.0, 180696.3}, {531498.8, 180696.9}, {531465.9, 180696.3}, {531440.0, 180695.1}, {531401.0, 180693.8}, {531361.3, 180691.0}, {531313.2, 180688.1}, {531261.2, 180683.3}, {531230.5, 180680.7}, {531214.2, 180679.9}, {531182.6, 180676.7}, {531155.6, 180672.7}, {531145.1, 180782.1}, {531143.8, 180799.3}, {531143.5, 180844.6}, {531144.3, 180858.7}, {531145.6, 180880.9}, {531142.8, 180890.6}, {531132.2, 180915.1}, {531127.9, 180920.4}, {531119.9, 180916.3}, {531100.3, 180949.0}, {531099.6, 180950.4}, {531098.0, 180953.6}, {531107.0, 180956.4}, {531096.6, 180976.7}, {531081.0, 181004.6}, {531085.6, 181007.8}, {531083.6, 181011.4}, {531094.6, 181018.2}, {531085.6, 181034.4}, {531126.7, 181053.2}, {531117.6, 181083.9}, {531108.5, 181107.2}, {531153.2, 181120.2}, {531169.1, 181124.4}, {531166.2, 181139.3}, {531144.9, 181231.6}, {531133.8, 181279.0}, {531132.0, 181285.7}, {531129.7, 181291.7}, {531110.2, 181342.6}, {531090.7, 181386.5}, {531089.2, 181389.2}, {531037.8, 181479.0}, {530995.3, 181544.8}, {530975.7, 181576.6}, {530974.0, 181579.8}, {530970.5, 181595.6}, {530968.4, 181608.2}, {530967.7, 181612.4}, {531022.5, 181617.6}, {531070.5, 181615.6}, {531120.1, 181610.8}, {531200.3, 181598.1}, {531266.2, 181583.3}, {531300.9, 181579.6}, {531359.6, 181570.6}, {531385.0, 181568.4}, {531401.1, 181577.4}, {531413.8, 181583.5}, {531438.2, 181598.1}, {531473.7, 181616.4}, {531496.4, 181627.9}, {531521.2, 181642.1}, {531554.6, 181659.1}, {531555.2, 181659.5}, {531595.2, 181683.2}, {531697.9, 181736.9}, {531778.2, 181780.0}, {531796.2, 181790.5}, {531813.0, 181800.3}, {531847.4, 181818.9}, {531865.9, 181828.1}, {531891.4, 181842.3}, {531900.3, 181844.7}, {531903.3, 181845.5}, {531913.5, 181846.5}, {531944.7, 181863.1}, {531965.7, 181873.1}, {531996.3, 181888.2}, {532027.3, 181899.0}, {532081.1, 181915.5}, {532083.4, 181950.0}, {532086.5, 181980.3}, {532089.2, 182013.7}, {532097.1, 182012.8}, {532097.7, 182016.7}, {532098.7, 182027.8}, {532097.7, 182041.9}, {532087.7, 182083.6}, {532078.1, 182111.2}, {532073.6, 182121.4}, {532067.3, 182133.7}, {532059.0, 182147.3}, {532056.7, 182150.8}, {532053.9, 182154.6}, {532134.9, 182206.1}, {532140.3, 182191.9}};

Those points are specified using the Ordnance Survey National Grid system of coordinates, corresponding to the following projection specification in the Wolfram Language.

In[2]:=
Click for copyable input
proj = {"TransverseMercator", "Centering" -> {49., -2.}, "GridOrigin" -> {400000, -100000}, "CentralScaleFactor" -> 0.9996012717, "ReferenceModel" -> "Airy1830"};

This changes the coordinates to latitude, longitude pairs.

In[3]:=
Click for copyable input
cityoflondon = GeoPosition[GeoGridPosition[coords, proj]];

A change of datum also needs to be specified to obtain fully precise results.

In[4]:=
Click for copyable input
cityoflondonWGS84 = GeoPosition[GeoGridPosition[coords, proj, "OGB7"], "WGS84Original"];

The blue line is the correct one. Note, for example, how well it fits Blackfriars Bridge.

In[5]:=
Click for copyable input
GeoGraphics[{Thick, Red, Line[cityoflondon], Blue, Line[cityoflondonWGS84]}, GeoGridLines -> True, ImageSize -> Large]
Out[5]=

Related Examples

de es fr ja ko pt-br zh