For the latest version of JMP Help, visit JMP.com/help.


Essential Graphing > Maps > Graph Builder > Custom Map Files
Publication date: 04/28/2021

Custom Map Files

You can create your own map files by following the same pattern as the built-in files. To add your own map files, you need two things: a series of XY coordinates for the vertices of the polygons that describe the shape, and a set of names for each polygon. Data and shape attributes are required to map custom shapes so that you can add your own shapes to JMP. There are two common sources for data like this: Esri shapefiles and SAS/GRAPH map data sets.

In order for JMP to automatically find your files, place them in the following directory:

On Windows: C:/Users/<user name>/AppData/Roaming/SAS/JMP/Maps

On macOS: /Users/<user name>/Library/Application Support/JMP/Maps

Note: On Windows, in JMP Pro, the “JMP” folder is named “JMPPro”. Or, you can link the map files to your data files explicitly with the Map Role column property.

Note the following when creating map files:

Each set of map files that you create must contain a -Name file and a -XY file.

The first column in both files must be the ascending, numeric Shape ID variable. The -Name file can contain any other columns. The shapes are built by rows. The XY coordinates have to go around the shape rather than just define the convex hull of the shape.

For the Map Role column property, columns that are marked with the Shape Name Definition are searched for shape identification and must contain unique values.

If you import an Esri SHP file, it is opened in the correct format. -Name files commonly have a .dbf extension. See Esri Shapefiles.

SAS/GRAPH software includes a number of map data sets that can be used with JMP. See SAS/GRAPH Map Data Sets.

You might want to create choropleth maps of other non-geographic regions (for example, a floor of an office building). Simply, add the two shape files for your non-geographic space. If you do not have XY coordinates, but you do have a graphic image of the space, you can use the Custom Map Creator add-in for JMP. With this add-in, you can trace the outlines of the space and JMP creates the -XY and -Name files for you. You can download this add-in from the JMP File Exchange page.

Map Role

You can specify the attributes and properties of a column in a data table within the Column Info window in Column Properties. The Map Role property is set for a column like other column properties in the Column Info window.

If you have created your own data table that contains boundary data (such as countries, regions, states, provinces, or counties) and you want to see a corresponding map in Graph Builder, use the Map Role property within Column Properties. Each pair of map files that you create must contain a -Name file and a -XY file.

Note the following:

If the custom boundary files reside in the default custom maps directory, then you need to specify only the Map Role property in the -Name file.

If the custom boundary files reside in an alternate location, specify the Map Role property in the -Name file and in the data table that you are analyzing.

The columns that contain the Map Role property must contain the same boundary names, but the column names can be different.

To add the Map Role property into the -Name data table:

1. Right-click the column containing the boundaries and select Column Properties > Map Role.

2. Select Shape Name Definition below Map Role.

3. Click OK.

4. Save the data table.

Figure 12.10 Shape Name Definition Example 

To add the Map Role property into the data table that you are analyzing:

Note: Perform these steps only if your custom boundary files do not reside in the default custom maps directory.

1. Right-click the column containing the boundaries and select Column Properties > Map Role.

2. Select Shape Name Use below Map Role.

3. Next to Map name data table, click to browse to a -Name map data table. You can enter the relative or absolute path.

If the map data table is in the same folder, enter only the filename. Quotation marks are not required when the path contains spaces.

4. From the Shape definition column list, select the column in the map data table whose values match those in the selected column.

Figure 12.11 shows an example of the room/office column in the S4 Temps.jmp sample data table.

Figure 12.11 Shape Definition Column Example 

5. Click OK.

6. Save the data table.

When you generate a graph in Graph Builder and assign the modified column to the Map Shape zone, your boundaries appear on the graph.

For numeric columns, the Format Menu appears in the Column Info window. Specify the format to tell JMP how to display numbers in the column. Latitude and Longitude for geographic maps are located under Format > Geographic when customizing axes and axes labels.

Geographic

Shows latitude and longitude number formatting for geographic maps. Latitude and longitude options include the following:

DDD (degrees)

DMM (degrees and minutes)

DMS (degrees, minutes, and seconds)

In each format, the last field can have a fraction part. You can specify the direction with either a signed degree field or a direction suffix. To show a signed degree field, such as -59°00'00", deselect Direction Indicator. To show the direction suffix, such as 59°00'00" S, select Direction Indicator.

To use spaces as field separators, deselect Field Punctuation. To use degrees, minutes, and seconds symbols, select Field Punctuation.

Esri Shapefiles

The Esri shapefile is a vector data format that contains data about geographic features such as terrain and oceans. It is developed and regulated by Esri as a specification for geographic mapping software.

Each shapefile is a set of files with the same name and different extensions.

main file (.shp)

The .shp file contains sequences of points that make up polygons. When opened with JMP, a .shp file is imported as a JMP table.

The Shape column is added during import to uniquely identify each geographic region. Each coordinate point is in a separate row.

The Part column to indicate discontiguous regions, and the XY coordinates (in latitude and longitude degrees).

JMP supports two-dimensional .shp files (no elevation information).

dBase Table (.dbf)

You add a Shape ID column to the .dbf table, which maps to the Shape column in the .shp file. Add any number of columns that provide common names or values to refer to specific regions.

To convert an Esri shapefile to a JMP map file:

1. Open the .shp file in JMP.

2. Make sure that the Shape column is the first column in the .shp file. Add formatting and axis settings for the X and Y columns (optional). Graph Builder uses those settings for the X and Y axes.

3. Save the .shp file as a JMP data table to the Maps folder with a name that ends in -XY.jmp.

4. Open the .dbf file.

5. Add a Shape ID column as the first column in the table. This column should be the row numbers from 1 to n, the number of rows in the data table.

Note: You can use Cols > New Columns > Initialize Data > Sequence Data) to fill the column with sequential numbers.

6. Assign the Map Role column property to any column that you use for place names in the Shape role of Graph Builder. To do this, right-click at the top of the column and select Column Properties > Map Role.

7. Select Shape Name Definition from the drop-down box in the property definition.

8. Save the table as a JMP data table with a name that matches the earlier table and that ends in -Name.jmp.

JMP looks for these files in two locations. One location is shared by all users on a machine. This location is:

Windows: C:/Program Files/SAS/JMP/15/Maps/

macOS: /Library/Application Support/JMP/15/Maps

The other location is specific for an individual user:

On Windows: C:/Users/<user name>/AppData/Roaming/SAS/JMP/Maps

On macOS: /Users/<user name>/Library/Application Support/JMP/Maps

Note: On Windows, in JMP Pro, the “JMP” folder is named “JMPPro”.

SAS/GRAPH Map Data Sets

SAS/GRAPH® software includes a number of map data sets that can be converted for use with JMP. The data sets are in the Maps library. The traditional map data sets contain the XY coordinate data and the feature table contains the common place names. You need to convert both of these files to JMP data tables for use with JMP.

Most of the traditional map data sets have unprojected latitude and longitude variables in radians. The data sets can be used with JMP once they have been converted to degrees and the longitude variable has been adjusted for projection. The following is a DATA step that shows the conversion process for the Belize data set.

data WORK.BELIZE;
keep id segment x y;
rename segment=Part;
set maps.belize;
if x NE .;
if y NE .;
y=lat*(180/constant('pi'));
x=-long*(180/constant('pi'));
run;

You can now import the converted file and save it as Belize-XY.jmp.

The next step is to import the matching feature data set (in this case: MAPS.BELIZE2). After importing the feature data set, move the ID column to the first position in the data table. Then assign the Map Role column property to the columns that you use for place names in the Shape role of Graph Builder. To do this, right-click the top of the column and select Column Properties > Map Role. Then select Shape Name Definition from the drop-down box in the property definition. For MAPS.BELIZE2, use the IDNAME column. Save the feature data table as Belize-Name.jmp.

To convert SAS maps, download the SAS to JMP Map Converter add-in from the JMP File Exchange page. For each map, the add-in reads the data from the two SAS map tables, rearranges and formats the data and then places it into the two JMP map tables.

Want more information? Have questions? Get answers in the JMP User Community (community.jmp.com).