Changing the Central Meridian via the SDK

Anyone that has taken advantage of the 2D capabilities of ArcGIS Explorer is probably used to this view of the Earth:

In this 2D view the world basically ends in eastern Russia, New Zealand and other areas around the 180 degree line.  For some people this is okay, but for others it is a problem because data is cut off, and measurements can’t be made across the Pacific Ocean.

Using an Add-In and a couple lines of code, you can change the central meridian for geographic projections to fit your display requirements.  The map above shows the 2D map in a World Mercator projection with a central meridian of 0 degrees.  The code below was put into the click event of a button Add-In to change the central meridian to 180 degrees:

The first line of code writes the World Mercator projection out as a string value with the updated central meridian.  The string is then used to create a new CoordinateSystem object and then set as the current 2D coordinate system.  The results are an updated central meridian giving you a different perspective on our 2D world:

It is important to note that maps with custom coordinate systems can’t be saved and re-opened, so if you want to make this switch to the central meridian then you need to do it within each map session or have an extension that runs on startup to make the change.

Please see the Explorer SDK documentation for information on how to create a button or extension with the code above.

(Submitted by: Larry Young, ArcGIS Explorer Team)

This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

Leave a Reply