Example: Compare Sizes of Countries

In this example we combine multiple facilities within Manifold to create a presentation that allows comparison of the relative sizes of different countries.   The World drawing used in this example may be downloaded as the world.mxb sample project in the Examples page on the Manifold website.    See the Example: Locations topic for a step-by-step

 

See the video version of this project in the Manifold 9 - Compare Country Sizes video.  

 

 

We create a presentation like the above using techniques as an experienced Manifold user might apply.  Many of those techniques are a single click, but despite the speed with which an experienced user could create the above display, this topic is lengthy since it shows almost all individual steps.

Open a Project, Create a Map

Launch Manifold, or, we can launch Manifold Viewer as this example works in Viewer too.   If running from a Portable installation, double-click on the manifold.exe executable to launch Manifold.    Do the same if using Manifold Viewer.

 

To fit into this documentation, illustrations show a small Manifold desktop, with only a few panes, docked to the right side.  In real life we use a much larger Manifold desktop, and more panes would be turned on, with panes docked to the left or to the right, or undocked, as we prefer.

 

 

 

Manifold opens with a new project.   We create a new map by choosing File - Create - New Map.   We can also right-click into the Project pane and choose Create - New Map.

 

 

The New Map dialog allows us to create a new map that automatically includes a image server base layer.  The dialog will automatically add an image server data source to our project, as necessary.

 

The Base layer box remembers the last image server we have used to create a map.   The pull down menu for the box is loaded with all image servers in our Favorites list.  If this is the first time we are creating a map using the menu, or if we previously created a map without using an image server as a base layer,  the Base layer box will show (none).   If the Bing streets image server is not in the box by default, we choose it from the pull down menu.    

 

We leave the coordinate system set to Pseudo-Mercator, the default.   That is a good choice when using image servers as background layers, since they almost always use Pseudo-Mercator as well.

 

We press Create Map.

 

 

 

 

A new map, called Map, appears in the Project pane.  A Bing streets data source also appears, which is the data sources that provides the Bing layer for the map.  We open the map by double-clicking it.  Note that the Counts pane in the Status bar shows a very large number of records, since the Bing image server is full of hundreds of billions of tiles, with each tile being a record.

 

In this example we will show illustrations of the undocked map window to provide bigger map window illustrations.  Undock the map window by Shift-clicking the Map tab.

 

 

Resize the window as seen above.   Click and drag in the window to pan it, and use the mouse wheel or right-click-and-drag to zoom.

Change the Projection used by the Map Window

The first layer dragged and dropped into a map window sets the projection used by that map window to whatever is the coordinate system used by that first layer.   We dragged and dropped the Bing layer into the map window as the first layer.  Since Bing uses Pseudo-Mercator, that is the projection now used by the map window as well.   

 

We will change that projection to the Gall projection, which is an equal-area projection that does a reasonable job of showing most countries in the world in a way that their areas can be reasonably compared by lay people.

 

 

Launch the Component tab of the Info pane.  The Component pane shows the coordinate system used by the map, as well as the coordinate system used by the active layer.

 

 Press the coordinate picker button for the Map and choose More... to open the Coordinate System dialog.

 

 

The dialog opens to the EPSG tab with the Pseudo-Mercator system selected , since the Pseudo-Mercator coordinate system in use by the Map is designated by its EPSG number.  Click on the Standard tab.

 

 

Scroll down to the Gall projection and click on it.  We could also enter Gall into the filter box to find it more quickly in the very long list of projections.   Press OK.

 

 

The map immediately switches to using the Gall projection.

Copy and paste the World Drawing and Table

We will now add a new drawing to our map.  We would like to use the World drawing that is in the world.mxb sample project published in the Examples page on the Manifold web site.   

 

There are many ways to get a drawing published in a Manifold project into a different project.   One of the easiest ways is to launch a second Manifold session, to open the world.mxb project in that session, and to then Copy the World drawing from that second session and Paste it into our project.

 

 

Some GIS packages can run only one session at a time.   Manifold can be launched in as many sessions as we like at the same time, and we can copy and paste between them. That is a great way to get data from other projects.  We could, of course, always use File - Link to link those other projects into our current project, but sometimes a casual use of Copy and Paste is what we prefer.

 

Launch a second session of Manifold and use File - Open to open the world.mxb sample project.   MXB is a Manifold, compressed archive format that Manifold (and Viewer) can open as if it was regular .map format, decompressing the archival format automatically.

 

 Important: For this topic to work as written, the World drawing must be in Pseudo-Mercator projection.  If it is in Latitude / Longitude, take a moment to change the projection to Pseudo-Mercator.

 

 

In the second session highlight both World and World Table, that is, choosing both the drawing and the drawing's table.  We can do that by ctrl-clicking both or in Windows fashion by clicking and dragging a box from lower right corner to upper left corner that covers the two components.

 

Press Ctrl-C to Copy.   If we prefer we can right-click on the highlighted items and choose Copy, or press the Copy button in the project pane toolbar.

 

 

 

Click into the Project pane for our first Manifold session and press Ctrl-V to Paste.   If we prefer we can right-click into the main part of the Project pane and choose Paste, or press the Paste button in the project pane toolbar.

 

The World drawing and the drawing's table are copied from our other Manifold session into our current Manifold session.   This is very cool and useful but it is only a small part of how  experienced Manifold users will take advantage of Copy and Paste between multiple Manifold sessions.

 

 

Drag and drop the World drawing into our map.   It appears as a layer above the Bing layer.   Although the map is in Pseudo-Mercator and the World drawing is in Latitude / Longitude,  the map window will re-project the World layer into Pseudo-Mercator on the fly for display.   The area objects that show countries in the World drawing thus neatly cover the countries shown in the Bing image.

Eliminate All but Four Countries

We intend to show only four countries, the US, Brazil, China and Australia, so we will eliminate all other countries from the drawing.  That is quickest to do by selecting only the four we want, inverting the selection and then pressing Delete.

 

 

Ctrl-click on a country to select that area object.  In the illustration we have already ctrl-clicked on the US to select it, and now we will ctrl-click on Brazil to select that country as well.

 

 

When all four desired countries have been selected, we will press Ctrl-I to invert the selection.

 

 

Inverting the selection will select all countries except those four we previously had selected.   We now press the Delete key to delete all selected objects.

 

The result in a few quick clicks is a drawing with only four objects in it, the four area objects representing the four countries of interest.

Move Countries to Desired Positions

Our next step is to move the countries we have in our drawing to a position nearer each other so their relative sizes are easier to compare.

 

 

Alt-click on Brazil to choose it for editing.

 

 

Editing handles appear at the vertices which define Brazil and the Info pane automatically pops open.  We click on the Coordinates tab or click any editing handle to switch into editing mode.

 

 

The Coordinates tab in the Info pane shows we are in editing mode.

 

 

The map window shows the object in edit mode, with the clicked handle bigger.  We can Shift-drag (that is, click and drag with the Shift key pressed) on this handle to move the entire object.  (Simply clicking and dragging on the handle moves only that coordinate).  

 

If snapping is on (it is by default), we take a moment while doing this to tap the spacebar, to turn off snapping.  That will prevent Brazil from snapping to one of the other countries if we move the mouse too nearby one of the other countries.

 

 

We can click and shift-drag any of the editing handles and all of them will move together, as seen in the illustration above where we have moved all of the coordinates together nearer to the Equator and closer to Africa.

 

 

So far the move is just a preview.   Right-click and choose Save Changes to apply the move.   Or, we could press the Update Record button in the Info pane to apply the changes.

 

 

Brazil moves to the new location.

 

 

Next, we Alt-click on the US, we click one of the handles, and then we Shift-drag that handle to move all of the US onto the Equator next to Brazil.

 

 

In the Info pane we press Update Record to apply the change, an alternative to right-clicking in the map and choosing Save Changes to apply the move.

 

 

We can continue moving countries by Alt-clicking China and then moving China.

 

 

We continue in this way to move Australia as well, so that all four countries have now been moved onto the Equator next to each other.

Format Countries using Style

Default formatting in gray color looks drab, so we will improve the visual appeal of our presentation by coloring the countries using the Style pane.

 

 

We open the Style pane.  We click the Fill color for areas button, and then we click the field selection box and choose Name as the field for our thematic format.  We use unique values as the method, we right click onto the palette button and choose the Color Brewer CB Spectral palette.   The illustration above shows the palette colors applied in reverse order.   We can reverse colors by first applying the CB Spectral palette, next clicking anywhere into the intervals list to move the focus there, pressing Ctrl-A to select all intervals, and then right clicking on one of the color wells and choosing Reverse.    Press Update Style to apply the palette.

 

 

The result is a livelier, more appealing display.

Alter Layer Opacity

In the illustration above our Bing background layer is slightly too intrusive.  We can make it less intrusive by changing the opacity of the layer so it is slightly transparent, allowing some of the white background color to show through.  That has the effect of lightening the Bing layer.

 

 

In the Layers pane we double-click into the opacity value for the Bing layer and we change it to 50.   Press Enter.

 

 

Making the Bing layer only partially opaque lightens the layer as the white background becomes partially visible through the Bing layer.  The lighter Bing background allows the four, brightly colored countries to appear more prominently.

Create Labels

We will create a labels layer to label the countries with their names.   

 

 The system used to specify the text content of labels has changed recently, with topics still in the process of being updated, including this topic.  Until this topic is updated, please see the  the Label Text topic and the 5 Minute Tutorial - Labels from Fields and Expressions video for a quick guide to specifying the text content of labels.

 

 

In the Project pane, right-click onto the World drawing and choose Create - New Labels.     In the New Labels dialog we use a Name of Labels and we choose Name  as the field for the Text of the labels. That automatically loads a text pattern of [Name] for the label, which means to create each label from the contents of the Name field.

 

Press Create Labels.   That creates a new labels component in the Project called Labels.

 

 

Drag and drop the Labels component into the map.   Labels taken from the Name field for each country object automatically appear.

Create a Drop Shadow Effect

We can quickly create a drop shadow effect that will make the country shapes appear more solid.    We do this by making a copy of the World layer, coloring all areas in that copy black, and then shifting that copied layer slightly.

 

 

Ctrl-click on both the World component and the World Table component and then press the Copy toolbar button.   

 

Next, press the Paste toolbar button.  That creates copies in the Project pane called World 2 and World Table 2.  

 

 

Drag and drop the World 2 drawing into the map.  Drag the layer tab for the World 2 layer so it is just below the World layer.     The World 2 layer is an exact copy of the World layer, so we cannot see it in the map because the World layer is exactly above it.

 

 

With the focus on the World 2 layer, in the Style pane click the Fill color button for areas, clicking twice to get the drop down menu with many color choices, instead of the thematic formatting display.

 

 

Change the color to black.   The color of all areas in the World 2 layer, if we could see it, would change instantly to black.

 

 Important: For this topic to work as written, the World drawing, and thus the World 2 drawing created by copying and pasting from the World drawing must be in Pseudo-Mercator projection.  If it is in Latitude / Longitude, take a moment to change the projection to Pseudo-Mercator.  Why do we do that?  We want the World 2 drawing to be in Pseudo-Mercator because that is a meter based projection, so shifting objects around using meters as units of measure is reasonable.

 

Next, with the focus on the map window we choose the Transform pane.  In the Transform pane we choose the World 2 layer and the Geom field.   We double-click on the Reshape template to launch it.

 

 

In the Reshape template we choose the Shift operation, and for X we enter 50000 and for Y we enter 70000.   Leaving the Unit at the default Meter, that means we will shift the geometry by 50000 meters in the X direction and -70000 meters in the Y direction.  

 

For the Result destination, we leave the default Same Field setting, to update geometry in place.

 

To see a preview of what will happen, we press the Preview button.

 

 

Previews use blue preview colors to show what the template will do with those settings, drawing the preview layer above all others and adding a blue preview caption bar to the top of the window that gives the name of the template being previewed.  

 

 

We can right-click the caption bar and choose Left to show the preview only on the left hand side of the window, dragging the blue vertical separator line to the left or right to show less or more of the preview.

 

 

We can pan and zoom without losing the preview.   As we can see from the zoomed-in view above, the template will move objects in the World 2 layer downward (a negative Shift Y value) and to the right (a positive Shift X value).    Using the preview as a guide, we can tinker with the X and Y values to get the effect we want.

 

To apply the proposed change, we press the Transform button.

 

 

The result is that we have shifted the black areas in the World 2 layer slightly downward and to the right.   This gives a visual effect of a hard-edged drop shadow and helps the countries to stand out more from the background.    For this example we have used a somewhat larger shift than we might use in real life, to make it clear how the drop shadow effect works.

 

 

If we prefer, we can double-click the Bing layer tab to turn off that layer.  That shows all four countries next to each other in a simpler presentation.

 

  If we are using the free Manifold Viewer, we can duplicate this entire example for free, and we can create fine illustrations.   We cannot save this project, but all the same we can use PrtScn (press the Windows Print Screen keyboard button) to copy a screenshot of our desktop, paste that into Paint or some other graphics editor, and then crop to the four countries to make an illustration to use in  a web page or in some other document.

For Extra Credit

Once we become familiar with Manifold we can manipulate data as we like.   For example, suppose we wish we had shown other countries, but now those other countries have been deleted from the World drawing we use.   How do we get them?   Suppose, for example, we wanted to add Russia to the display.

 

 

That is easy.  In our second session of Manifold, which we opened with the world.mxb project, we open the World drawing and we Ctrl-click on Russia to select that object.  We press Ctrl-C to Copy that object.    In our Map above, we click on the World layer to move the focus there and then we press Ctrl-V to Paste the copied object, thus pasting Russia into the World layer.   We Shift-Alt-click on Russia, click into the Coordinates list of the Info pane, press Ctrl-A to select all coordinates and then we can drag Russia into whatever location we want.    See the Notes below for the small additional step we used to create the illustration above.

 

To make a drop shadow, we Ctrl-click on Russia to select it, Ctrl-C to Copy and then we click the World 2 layer tab to move the focus there and we Ctrl-V to Paste.   We temporarily turn off the World layer so we can see what we are doing, we click on the World 2 layer to move the focus there, Ctrl-click on Russia to select it, and now we can use the Transform pane's Shift template to move just the Russia object by checking the Restrict to selection box.    

 

We double-click the World layer back on and we use Style to change the color of Russia to a dark green, as seen above.

 

 

Using similar moves we can copy and paste other areas we might want to use from our second session, to provide a display that compares the various countries from very large, Russia, to smaller, France, plus adding Alaska for comparison as well.  

 

In the illustration above, using the default Labels that were created from areas in one simple step would put a label directly on top of France, which would not look good with such a small country.  We have therefore turned on Style overrides in the Labels layer and have used a style override for the France layer to set the Stroke color to transparent color.  That turns off the default label in the Labels layer for France.  We cannot move the label for France using a style override because the move option is not available for labels automatically generated from areas or lines, but only available for areas generated from points.

 

Next, we added a new labels layer called France and manually inserted a point label next to the France object.   That is a hack, but sometimes it is quicker and easier to do a quick manual hack than it is to construct a more elegant, automatic solution.   If we wanted a more elegant, automatic solution, we could first create centroids for the country areas in the World layer, and then create labels from those centroids.  We could then use style overrides to move the labels sideways in cases like France or to make them transparent.

Notes

Blue color used in editing - Objects that are picked for editing, as well as paths drawn by the measurement tool and in editing, have their coordinate edit handles and boundaries shown using the same blue color used for previews and for provisional edits in other settings. If desired, we can change the preview and provisional color used by Manifold in the Tools - Options dialog.   This allows us to use a color different than blue color in cases where a visual display already uses very much blue color or to provide a more discernible color in case of color blindness.

 

Viewer is Free  - We can create the above display using Manifold Viewer, which is a completely free product.    We cannot save the above as a layout or print to PDF, but we can make a screenshot using the PrtScrn button and then edit the screenshot using Paint to create an image that is perfectly suitable for use on a web site or in documents.

 

Copy and Paste on Local machines - Alas, Windows Remote Desktop does not understand copy/paste between Manifold sessions, so we cannot RDP into a distant machine, launch a Manifold session there and then copy something from the Project pane in that session into a Manifold session's Project pane on our local machine.

 

Quick trick for a complete Russia - A quick trick is required to generate the view of Russia in the illustrations above.   In the World drawing from which we grabbed country areas, Russia is shown using two main areas.  The first area is most of Russia, and the second area is the small portion that extends past the +/- 180 degree longitude meridian.  What we did was to copy both areas from the original World drawing in one session of Manifold and then paste both areas into our working World drawing in the other session of Manifold.  We then moved them together to form the illustrations above.  Because we can pan and zoom even while objects are picked for moving, we can zoom far in and easily align the far Eastern part of Russia very accurately next to the larger portion.  We also used style overrides to assign transparent Stroke color to the smaller Russia area, so that there would be only one Russia label on the main portion.

 

Gall is approximate - The Gall projection is used in this example because it is equal area and also because it produces country shapes, however inaccurate in "real life," that are familiar to most people.   Any equal area projection will provide a geometrically accurate way to visually compare the relative sizes of countries.   Different equal area projections, however, will distort the shapes of countries in different ways.   The Gall projection artificially lengthens the North - South "height" of countries near the Equator while flattening that dimension of countries in higher latitudes.   The areas may be preserved as accurate, but the change in shape can make countries near the Equator seem bigger than they are.

 

There is no way around having at least some distortion, since we cannot flatten a 3D spherical or ellipsoidal shape into a flat, 2D plane without inducing some distortion.  That is the central problem for all cartography, known to cartographers for over 2000 years.    The only question is what sort of distortion is acceptable for a given purpose.  

Videos

Manifold 9 - Compare Country Sizes - Many people want to compare the true sizes of countries. In this video we show how to use different capabilities within Manifold to create a display that instantly shows the relative sizes of four countries: United States, Brazil, China and Australia. Very fast and easy! Works with Manifold Release 9 and the free download of Manifold Viewer.

 

See Also

Drawings

 

Maps

 

Projections

 

Info Pane: Component

 

Layers Pane

 

Style Pane

 

File - Export

 

Reproject Component

 

Map Projection

 

SHP, Shapefiles

 

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: Reproject 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 on the fly reprojects the drawing for display.

 

Projections Tutorial