E.4 Overlaying a Shape on a Custom Map

In some cases you may want to overlay shapes on top of an existing custom map. For example, you may want to overlay shapes corresponding to the four Census Regions on top of an existing U.S. map that already displays data using a 'State' layer. In this case, do not add the Census Regions as a new layer to the existing map as described in Adding a Layer to a Custom Map, because a given map can only have a single data layer. (You would then be forced to choose either 'State' or 'CensusRegions' as the displayed layer.)

To create a map that displays data on the 'State' layer, but that also draws the Census Regions (without data), follow the steps below:

1. In OpenJUMP, open the shapefile containing the shapes that you want to overlay.

To manually create shapes by merging existing shapes (e.g., to cre­ate larger regions by merging multiple states) follow the steps described in Adding a Layer to a Custom Map, but use the 'Merge selected features' option rather than 'Combine selected features'. Do not export the resulting map.

2. (Optional) Perform any necessary simplification processing as described in Exporting a Shape File as a Style Intelligence Map.

3. Select 'Export layer' from the 'InetSoft' menu, make the following settings:

a. For the 'Map file', press the 'Browse' button. Select a different location than your current SREE Home (WEB-INF/classes) so that you do not overwrite the existing mapdata.xml file. For example, create a new “maps” folder into which to save the export.

b. For the 'Map type', enter a map name (e.g., 'US2').

c. For the 'Layer name', enter a name for the layer you are exporting (e.g., 'CensusRegions').

d. For the 'Feature ID' and 'Display name', select the appropriate feature column.

 

e. Press 'OK'. This exports the layer to the location that you specified. The saved files include two CSV files and a mapdata.xml file.

 

4. Copy the two CSV files from the export location to your SREE Home directory (WEB-INF/classes). Do not copy the mapdata.xml file.

5. Stop the Style Intelligence server (if it is running).

6. Open the original mapdata.xml file in the SREE Home directory with a text editor. Amend mapdata.xml to allow the custom map to access the saved CSV files, and provide the appropriate styles for the labels and outlines. A example follows:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<mapdata>

  <style name="label">

    <font font="Verdana-BOLD-12" color="#0000FF"/>

    <line width="3" dash="1"/>

    <fill color="#0000FF" alpha=".1"/>

  </style>

 

  <nametable name="US_States_names" file="/US_States.names.csv" labels="0"/>

  <layer name="US_States" id="104" nametable="US_States_names"/>

  <matching layers="104" columns="0"/>

 

  <map type="US2">

    <shapedata data="/US_States.csv" layer="US_States">

      <shapes style="label" data="/CensusRegions.csv"/>

      <labels data="/CensusRegions.names.csv"/>

      <sampledata>Rhode Island</sampledata>

      <sampledata>South Carolina</sampledata>

    </shapedata>

  </map>

</mapdata>

7. Save the mapdata.xml file, and restart the Style Intelligence Server.

8. Create a map chart in Style Studio or Visual Composer based on the custom map. Observe that the specified regions and labels are overlaid on the map as desired.

 

<< E.3.2 Adding a Layer Based on Merged Regions © 1996-2013 InetSoft Technology Corporation (v11.5) E.5 Editing a Custom Map >>