cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
Combine Map Shapes
XanGregg
Staff

This add-in was written by JMP development intern David Spruill. More details in his blog post (see below) about it.

 

The add-in lets you take an existing shape file and merge selected shapes together to create new shape files. Here is an example with US states merged into four regions.

 

8488_combinedus.png

 

Edit - 02June2023:  The blog post listed above was archived.  The article content is reposted below: 

 

With JMP, you can easily show data geographically with maps. However, you can only show your data if the regions you want to show exactly match up with the regions JMP has in its installed maps, or any maps you might have. This makes showing data by larger divisions, like regions of a country, more difficult. I developed an add-in that is designed to alleviate this problem by allowing you to combine existing smaller shapes into new larger ones.

So let’s run through an example with some FBI crime data. Notice that the only data given is in terms of regions, which JMP does not normally recognize. So in order to map this data with JMP, we want to create map definitions that fit these names. To do this, let’s use the new Combine Map Shapes add-in – downloadable from the JMP File Exchange (download requires a free SAS profile).

The data looks like this:

MikeD_Anderson_0-1685717241951.png

 

So to prepare a map file for this data, let’s launch the Combine Shapes add-in; you should see a screen like the one below:

MikeD_Anderson_1-1685717241951.png

 

With this screen, you need to first pick the map name file. You can select where to search for this file with the radio buttons below. Remember that JMP maps are represented by two files; here you want to open the “-Name.jmp” file. For this example, let’s look in the built-in maps for a file called “US-State-Name.jmp” that holds the state names. Selecting this file and clicking Continue will bring you to a new window with the map in question shown.

With this map, you can drag your mouse over areas or use shift+click to select the areas that you want to represent with a single name. In the picture below, I have selected the area corresponding to the “West” region data table:

MikeD_Anderson_2-1685717241951.png

 

Press “Finish Region” to finalize this region and to go on to the others. When you have set all of your regions as you would like them, you still have two options at the bottom of the window: to keep internal borders and save the map files in an alternate location. By default, the shapes are combined with the internal borders kept and are saved in JMP’s user-installed map directory.

When you have selected and finalized every region from your data, press “Merge Region.” The add-in will take the selections and merge each of them into a single JMP map shape. After the merge, you can use these files to map data as you normally would. You can even just use Graph Builder if you chose to save the maps in their default save locations. (However, you may have to restart JMP to use these newly added maps in Graph Builder.)

The visualization from this particular example is below. With this, you can clearly demonstrate graphically that the South has the most property crimes, while the Northeast has the fewest.

MikeD_Anderson_3-1685717241951.png

 

Here is the same visualization, but done without keeping internal borders:

MikeD_Anderson_4-1685717241951.png

 

A little note about the inner workings of the add-in: Maps in JMP are stored in pairs of data tables, one mapping the different areas’ names to a specific ID number, and the other mapping that ID number to a list of X/Y coordinates for displaying geographically. What this add-in does is take your area selections and look for intersection points between the areas selected. When it has these intersection points, it follows along the edges to find a single border following the combined shape – excluding the line between the two shapes if you opted not to keep the internal borders.

NOTE: This post was written by a former intern on the JMP development team.