﻿ Example: Re-project a Drawing

# Example: Re-project a Drawing

In this example, we learn how to change the projection of a drawing, either within the drawing itself, or by changing the projection of a map window that shows the drawing and re-projects that drawing on the fly for display.   This topic is similar to the procedures shown in the Manifold 9 - Re-Project a Shapefile video.   The Idaho drawing is the same drawing imported from a shapefile in the Example: Import Shapefile and Create a Map  topic.

There are two ways to display a drawing using a different projection:

• Change the projection of the drawing itself.  When the drawing appears in a drawing window, the drawing window always uses whatever is the native projection of the drawing.  Changing the projection of the drawing will change the data within the drawing, re-computing coordinate numbers so all of the coordinates which define objects will appear at the correct locations in the new projection.

• Do not change the projection of the drawing, but instead display the drawing as a layer in a map window that uses whatever projection is desired.   The map window will re-project on the fly for display purposes all layers into the projection used by the map.   Changing the projection of a map window does not change the data of any layers within the map.   Instead, the layers are re-computed dynamically as if they had been changed to generate a correct display in the desired coordinate system.

Manifold is very fast at reprojecting, so fast that normally there is no need to re-project a drawing into some specific projection to save the time required to re-project the drawing on the fly for display purposes.   We can therefore leave the drawing in whatever native projection it uses upon import and simply rely on a map window to display the drawing in whatever projection is desired.

When drawings are very large and complicated, the reprojection-on-the-fly process might take longer than we like.  In that case, we should re-project the drawing into whatever projection is used within the map window.

## Re-Project a Drawing

We consider the first case, re-projecting a drawing.   That changes the geometry data within the drawing.   We will re-project a drawing from Latitude / Longitude projection into Pseudo-Mercator projection.

We have imported a shapefile as shown in the Example: Import Shapefile and Create a Map topic.

To see what projection is used, we can click on the Component pane.   The pane reports that Latitude / Longitude coordinate system is used.

To change the projection we click on the coordinate picker button.

We choose Change Coordinate System.

In the Change Coordinate System dialog we press the coordinate picker button for the New system we desire.

In the menu that appears we choose the WGS 84 / Pseudo-Mercator (EPSG:3857)  coordinate system.  This is one of the two Favorite systems automatically provided by Manifold.

Press the Update Component button.

Ctrl-click the Idaho tab at the bottom of the window to Zoom to Fit, to show Idaho.  Done!

The Idaho drawing has been re-projected from Latitude / Longitude into Pseudo-Mercator.  Manifold does this so fast that we might not realize we have, indeed, re-projected the drawing.    With small drawings like the example the process is instantaneous.  Even with larger drawings, it is very fast.

The Component pane reports the new projection.

## Change the Display Projection used by a Map

We will now consider the second method,  leaving the drawing in its own native projection and instead using the drawing as a layer in a map window that uses different projections.

As before, we will use the Idaho drawing, seen above in its original Latitude / Longitude projection.

## Create a Map

In the Project Pane, right-click into an empty part of the pane and choose Create - New Map.     In the New Map dialog, accept defaults and press the Create Map button to create a new map, called Map by default, in the project.

Double-click the new Map to open it, and then expand the Bing Maps data source.

Drag and drop the Bing Maps Street Map Image into the Map as the first layer.  The first layer added to a map sets the projection used by that map.  Since Bing uses Pseudo-Mercator, adding that layer first to the map will set Pseudo-Mercator as the coordinate system used by the Map.   The initial view, not illustrated, will show the entire world using the Bing layer.

Next, drag and drop the Idaho drawing into the Map as the second layer. To zoom into Idaho,  Ctrl-click on the Idaho layer tab to Zoom to Fit that layer, or right-click on the layer tab and choose Zoom.

To create the illustration above, we have Shift-clicked on the Map title tab to undock the map window so we can resize it as seen above.   We have also used the Layers pane to set the opacity of the Idaho layer to 70%, so the Bing layer underneath can be partially seen through the Idaho layer above.

In the above view, after zooming into Idaho we have rolled the mouse wheel out one click of the wheel to zoom out slightly, for a larger view surrounding Idaho of the Bing layer, to provide more visual context for the location of Idaho.   For other illustrations in this topic, we usually zoom out one click as well.

## Change the Projection to Latitude / Longitude

In the Component pane we can see that the Map uses Pseudo-Mercator as a coordinate system while the Idaho drawing uses Latitude / Longitude.   The Map window is dynamically re-projecting the Idaho drawing on the fly into Pseudo-Mercator, to display the Idaho layer as if it were in Pseudo-Mercator.

We can change the projection used by the Map window by pressing the coordinate picker button for the Map

We can click the Latitude / Longitude choice in the menu to switch the Map's projection to Latitude / Longitude.  Latitude / Longitude is such a frequent choice that it is one of the two Favorite Coordinate Systems built into Manifold as defaults.

Choosing a different coordinate system in the menu immediately changes it in the Component pane.  The Map now uses Latitude / Longitude projection for display.

When changing map projections, we generally need to Zoom to Fit the layers of interest.   A quick short-cut used by experienced Manifold users is to Ctrl-click the layer tab to Zoom to Fit the contents of that layer.   We Ctrl-click the Idaho layer tab.

The map immediately shows the contents of the map in Latitude / Longitude projection.   The Idaho drawing is in Latitude / Longitude so the map simply displays the Idaho layer in its native projection.   The Bing layer, in contrast, is served by the Bing web servers as image tiles in Pseudo-Mercator projection.  When the map window re-projects that layer on the fly into Latitude / Longitude the result is a horizontal stretching, best seen in the labels, that is a characteristic distortion at the latitude of Idaho.

Tech Tip: Manifold is very fast at re-projecting image tiles served by web servers such as Bing or Google, so usually there is little or no delay using a projection other than Pseudo-Mercator for a map that contains layers from web servers.  Given the distortion most re-projections cause, usually it is a better idea to simply stick with Pseudo-Mercator as a projection for map windows which include web server layers such as Bing, Google, or OSM.

## Change the Projection to a Custom Projection

We can change the projection used by the Map window to a custom projection by once more pressing the coordinate picker button for the Map.  We will define a new, custom coordinate system, a Lambert Conformal Conic projection centered on Idaho.

To choose a coordinate system other than one of the two Favorites displayed by the menu, we choose Edit Coordinate System.

The Coordinate System dialog opens to the Standard tab with the Latitude / Longitude coordinate system selected that is currently in use by the map,   We click the Custom tab.

In the Coordinate System dialog we enter Idaho LCC as the Name for the custom system we will define.  We could use any name we like, but it is wise to use a name that later on will provide some self-documentation.  Calling the new system "Idaho LCC" is more descriptive than "Custom Coordinate System" or "George."  From the long list in the Type box we choose Lambert Conformal Conic for the projection we will customize.

We enter 45 as the Center latitude, and -114 for the Center longitude, an approximate center of Idaho.   For the 1st standard latitude we choose 43 and for the 2nd standard latitude we choose 47,  values for standard latitudes which reasonably place the cone of projection within the North / South extent of Idaho.   Press OK.

The map immediately changes to using our new, custom projection, which we have named Idaho LCC.

As with many projections intended to show a limited area, the resulting projection when zoomed out to the "whole Earth" Bing layer looks wildly wrong.  That will change when we Ctrl-click on the Idaho layer tab to Zoom to Fit the Idaho layer.

Zooming to Fit the Idaho layer, we see how the Lambert Conformal Conic projection works.  It is designed to display a limited portion of the Earth's surface.   The Map now uses Idaho LCC projection, and it is re-projecting on the fly both the Idaho layer, from Latitude / Longitude, and the Bing layer, from Pseudo-Mercator, into Idaho LCC for display.

## Add a Custom Projection to Favorites

We can add the new Idaho LCC projection we have created to our Favorite Coordinate Systems.   We can then apply it with a single click.

Press the coordinate picker button for the Map.

Choose Edit Favorites.

The context coordinate system displayed in the lower panes is the current projection, the custom Idaho LCC coordinate system we have specified for the map.  Press Add to Favorites.

Press the OK button.  Done!

The Idaho LCC coordinate system will now be a choice within the list of favorite coordinate systems that appears in menus.

For example, suppose we open the Idaho drawing it its own drawing window, and we would like to re-project the drawing from Latitude / Longitude into Idaho LCC.  We can now do that without needing to re-specify all of the parameters for the custom system.

In the Component pane, we press the coordinate picker button for the Idaho drawing.

We choose Change Coordinate System.

Press the coordinate picker button for the New coordinate system desired.

Choose Idaho LCC, which now appears in the list of favorite coordinate systems.

Press Update Component.

The Component pane now shows that the Idaho drawing has been re-projected into Idaho LCC.

Zooming to fit the drawing, we see that the Idaho  drawing now uses the new projection we specified, based upon Lambert Conformal Conic with parameters customized for Idaho.

The map, of course, also shows Idaho correctly.

We see that the map still uses Idaho LCC, which is now the native projection of the Idaho drawing.   The map is re-projecting the Bing layer on the fly from Pseudo-Mercator into Idaho LCC.    We will change the projection of the map one more time.   We press the coordinate picker button for the Map.

With one click we change the projection used by the map window to Pseudo-Mercator.

Immediately, the map display changes to Pseudo-Mercator, re-projecting on the fly the Idaho drawing from Idaho LCC into Pseudo-Mercator.   At this latitude there is not much visual difference between Pseudo-Mercator and Idaho LCC when viewing a small portion of the world centered on Idaho.    The main visual  difference is that lines of latitude, like the border between the United States and Canada at the top of Idaho, are straight lines in Pseudo-Mercator but are gently curved arcs in a conic projection like Idaho LCC.

## Videos

Manifold 9 - Re-Project a Shapefile  - New coordinate system dialogs make it easier than ever to re-project data, often in only one click. This video shows how to import a shapefile and then rapidly re-project it into different coordinate systems. We then show how maps re-project their contents on the fly for display and how to exploit that to rapidly show data in different projections.

Drawings

Maps

Projections

Component Pane

Change Coordinate System

Map Projection

Favorite Coordinate Systems

Favorite Base Coordinate Systems

Example: Import Shapefile and Create a Map - Step by step process to import a shapefile and to create a map.

Example: Import a Shapefile - ESRI shapefiles are a very popular format for publishing GIS and other spatial data.  Unfortunately, shapefiles often will not specify what projection should be used.  This example shows how to deal with that quickly and easily.

Example: Re-project a Drawing - An essential example on changing the projection of a drawing, either within the drawing itself, or by changing the projection of a map window that shows the drawing and re-projects on the fly for display.

Example: Adding a Favorite Coordinate System - Step by step example showing how to add a frequently used coordinate system to the Favorites system.

Re-Projection Creates a New Image - Why changing the projection of an image creates a new image.

Projections Tutorial