2014

September 2014

Listing Transformations for an Area with ArcMap and ArcPy

Posted by spk578 Sep 29, 2014

A common question asked when working with Coordinate Reference Systems (CRS) in ArcMap is not only how to transform between different CRS but simply what transformations are available between two CRS in a given area?

There are several ways of finding this information with ArcMap:

PDF resources found in your ArcMap installation:

C:\Program Files (x86)\ArcGIS\Desktop10.2\Documentation\projected_coordinate_systems.pdf

C:\Program Files (x86)\ArcGIS\Desktop10.2\Documentation\geographic_transformations.pdf

C:\Program Files (x86)\ArcGIS\Desktop10.2\Documentation\geographic_coordinate_systems.pdf

Using the OGP EPSG Area Polygons:

OGP's EPSG Area Polygons as Searchable Layers which is available to download from here @exprodat

Using the ListTransformation and SpatialReference Object

The spatial reference object allows you to interrogate a layer, features class, shapefile, raster or a coordinate reference name to view or manipulate a spatial object's properties. These include spheroidName, datumName, projectionName, scaleFactor and many more.

In the below example the code interrogates the names of two projections systems, prints their spheroid name, geodetic datum and a list of transformations that are valid between the two projection systems within the specified extent.

```# Define from and to Spatial Reference names
fromSpatRef = arcpy.SpatialReference('European Datum 1950 UTM Zone 31N')
toSpatRef = arcpy.SpatialReference('WGS 1984 UTM Zone 31N')

# Print the spheroid name for fromSpatRef and toSpatRef
print("from SpatRef spheroid: " + fromSpatRef.GCS.spheroidName)
print("to SpatRef spheroid: " + toSpatRef.GCS.spheroidName)

# Print the datum name for for fromSpatRef and toSpatRef
print("from SpatRef datum: " + fromSpatRef.GCS.datumName)
print("to SpatRef datum: " + toSpatRef.GCS.datumName)

# Extent for Central North Sea (values can be found in the data frame)
extent = arcpy.Extent(533553, 6469886, 993268, 6179505)

# list transformations valid for Central North Sea region
outlist = arcpy.ListTransformations(fromSpatRef , toSpatRef, extent)
print str(outlist)
```

This prints the following information:

from SpatRef spheroid: International_1924

to SpatRef spheroid: WGS_1984

from SpatRef datum: D_European_1950

to SpatRef datum: D_WGS_1984

[u'ED_1950_To_WGS_1984_1', u'ED_1950_To_WGS_1984_NGA_7PAR', u'ED_1950_To_WGS_1984_18', u'ED_1950_To_WGS_1984_2', u'ED_1950_To_WGS_1984_24', u'ED_1950_To_WGS_1984_25', u'ED_1950_To_ETRS_1989_4 + ETRS_1989_To_WGS_1984', u'ED_1950_To_WGS_1984_7', u'ED_1950_To_WGS_1984_36', u'ED_1950_To_WGS_1984_32_incorrect_DS', u'ED_1950_To_WGS_1984_32']

The ListTransformations function provides access to the list of transformations for a given area between any projection systems.

With this information it is possible to see a cut down list of what transformations are appropriate between any two CRS for a given area and investigate which of these is the appropriate method.

Further to this the syntax for a transformation method can be easily copy and pasted into other tools such as the Project Tool and can be used within a script such as the below.

```# Set variables XY values can be presented as a list
x = 309905
y = 6320846
srIn = 'European Datum 1950 UTM Zone 31N'
srOut = 'WGS 1984 UTM Zone 31N'
Transform = 'ED_1950_To_WGS_1984_18'

# Create point geometry from xy variables and project to   srOut with Tranform method
pointGeometry = arcpy.PointGeometry(arcpy.Point(x,y),srIn,False, False)
projectedPoint = pointGeometry.projectAs(srOut, Transform)

# Copy the reprojected points to a shapefile
arcpy.CopyFeatures_management(projectedPoint,r"C:\Users\Documents\ArcGIS\Wells.shp")
```

Geodesic distances: How long is that line again?

Posted by spk578 Sep 1, 2014

What are Geodesic distances?

A geodesic line is the shortest path between two points on a curved surface, like the Earth. They are the analogue of a straight line on a plane surface or whose sectioning plane at all points along the line remains normal to the surface. It is a way of showing distance on an ellipsoid whilst that distance is being projected onto a flat surface.

However there are several types of lines that have different definitions which are listed at the bottom of this blog.

Here's a video example of a geodesic line, the longest geodesic line possible without touching land.

The below image shows a planar distance in orange and the geodesic distance of that planar distance in blue. The maximum deviation of the geodesic from the planar line is near 2,000 Km and the difference in length is 644 Km.

What this image represents is the actual path taken (geodesic line) if I travel in a straight line, relative to me with no turns, from London to Singapore along the International 1924 ellipsoid (this is what I displayed the map in ArcGIS in EPSG:4022).

This type of measurement forms part of a series of geodetic features whose measurements account for the distortion of projected space. The distortion of a sphere into 2D space is nicely visualized in the video below:

Jarke J. van Wijk | Mathematical Art Galleries

Why is this important?

Apart from what can be very large differences between geodetic and planar measurements, see the above example, in the real world these differences can have a legal consequence such as those seen in constructing license areas for oil and gas exploration and production, international boundaries and exclusive economic zones.

An example of geodesic line constructions having a political role is seen in the Beaufort Sea International Border dispute between Canada (Canadian Yukon) and The United States (Alaska). The maritime boundary between the two countries has been defined differently. Canada claims the boundary to be along the 141st meridian west out to a distance of 200 nautical miles, following the Alaska-Yukon land border (this is derived from the 1825 boundary treaty between Great Britain and Russia). The United States on the other hand define the boundary line as stretching out to 200 nautical miles perpendicular to the coast whilst being equidistant from the coast.

Red line is the Canadian boundary, Blue line the USA boundary and the stippled area is claimed by both parties.

Building Geodetic distances in ArcGIS

The features you draw in a normal ArcMap edit session are not geodetic (they are planar) unless you create them using either the Advanced Editor Construct Geodetic tool or one of the following geoprocessing tools: Bearing Distance To Line, Table To Ellipse, or XY To Line. Geodetic features do not account for changes in terrain, this is a topic for another blog.

The Construct Geodetic tool is found in the "Advanced Editing" toolbar.

Here I shall make the Canadian border line which is defined as 200 nautical miles offshore along the Canadian-US border following the 141st Meridian Line.

• First I specify the line type (note the other types defined below)
• Use the snapping tool to add my start vertex to the end of the border
• Change the segment type to Distance - Direction and specify the distance covered (changing it to Nautical Miles)
• Specify the direction of the line

Now the line is constructed according to the chosen ellipsoid and is saved as a new feature upon saving edits.

Some terms used in ArcGIS:

• Geodesic line—The shortest line between any two points on the Earth's surface on a spheroid (ellipsoid). One sample use for a geodesic line is when you want to determine the shortest distance between two cities for an airplane's flight path. Another example is the creation of the path between the point of impact and the point of origin of a missile. This is also known as a great circle line if based on a sphere, rather than an ellipsoid. The geodesic line type allows you to create lines only. In addition, you can create a multi-segment line which is a series of geodesic lines that make up a single line feature. You can use a multi-segment line when you want to create an airplane's flight path with waypoints, such as an air route with multiple stops that make up a full route.
• Geodesic circle—A shape whose edge is defined as a particular geodetic distance from a fixed point. Depending on the coordinate system in which it is displayed, it may not appear to be a circle. You might use this if you are creating a range ring of a weapon system, such as to show a weapon's effective range. Geodesic circles can be used to create either lines or polygons.
• Geodesic ellipse—A shape whose sum of geodetic distances from a fixed pair of points is a constant. You could use this to create a signal error ellipse. This is also known as a geodesic circle when the major and minor axes are the same length. The geodesic ellipse type allows you to create lines or polygons.
• Great elliptic—The line on a spheroid (ellipsoid) defined by the intersection at the surface by a plane that passes through the center of the spheroid and the start and end points of a segment. This is also known as a great circle when a sphere is used. The great elliptic type allows you to create lines only.
• Loxodrome—A loxodrome is not the shortest distance between two points, but instead defines the line of constant bearing, or azimuth. Great circle routes are often broken into a series of loxodromes, which simplifies navigation. This is also known as a rhumb line. The loxodrome type allows you to create lines only.
•

Something extra to try:

A cool app to see the effect of the project on a straightline:

Shortest Distance on Earth

By date: By tag: