My Account     Contact Us     Cart

Optimizing Point Symbol Placement with MAPublisher LabelPro

This post was contributed by Hans van der Maarel of Red Geographics.


The problem with using GIS data for point symbols is that depending on the scale and symbolization you often end up with symbols partly overlapping each other. Of course, the symbols can be manually moved around after initial placement to get a more aesthetically pleasing result, but that can be a tedious and time-intensive task.

Thankfully, there is a way to automate at least part of this process by using MAPublisher and LabelPro.

Example map of Breda, The Netherlands

This example shows the heart of an old European city (Breda in The Netherlands to be exact). The map is composed of Dutch Top10NL topographic base data, a few labels were manually added for larger features (such as the park), and points imported from OpenStreetMap (OSM) and styled using a Map Theme. As you can see, there are a number of spots where the symbols are densely located and overlap each other.

The MAPublisher LabelPro add-on is capable of collision-avoidance to make sure overlaps don’t happen. But it only works when generating labels (text). Fortunately, the solution is to trick LabelPro into processing symbols too, so that they can benefit from better placement without overlaps.

Let’s start by adding a column to the attributes to the OSM points layer and filling it with a default value, a capital O.

Thankfully, there is a way to automate at least part of this process by using MAPublisher and LabelPro.

Editing the attribute schema

Next, determine how big the symbols are. On the artboard, use the Type tool to place a capital O and adjust its size so that it’s about the same size as one of the point symbols. In this case, a 14 pt Futura Medium, shown here in red, seems to cover it well (your results might be different).

Determine the approximate font size

Futura is a good font in this case because the O is a perfect circle. Once you’ve determined the approximate font size to use, delete the O text as it won’t be needed anymore.

Next, set up the LabelPro labelling rules. Since there is already a layer with the manually placed labels and the symbols shouldn’t interfere with them, the manually placed labels will be designated as an obstacle layer. The symbols layer will be labelled with the attribute created earlier and the style set to the font and size that was just determined.

Set obstacle layer

Setting the appropriate rules partly depends on personal preference but it’s important to specify that the placement prefers the center position (position 1 on the placement control). In other words: if there’s enough space for placement, the label doesn’t need to be moved or offset. Another important rule to configure is that font reduction should be turned off. All of the labels (eventually symbols) are going to be a fixed and similar size.

Set placement point rules
Set fitting point rules

Also, another good practice is to specify a suppression layer. Any labels that can’t be placed with the rules set will be placed on the suppression layer. After placement, you can determine if any labels need to be adjusted manually.

Let’s label! Go ahead and label with these settings and afterward hide the original symbols layer and the suppression layer. The map is filled with O’s where the original symbols are located.

O labels placed

At first glance, this does not seem very useful, but closer inspection shows that the labels have retained the attributes of the original OSM point symbols.

Attributes migrated to the O labels

This means that if they can be turned back into points, they will be able to be styled!

In order to turn them back into points, a text reference point needs to be created. In other words: a little dot on the text selection line, in the center of the O. This is a two-step process. First, select all the O’s on the artboard, open MAPublisher Text Utilities, and set the Action to Set text alignment and Alignment to Center. This action changes the alignment of the text without changing the actual position of the text (due to LabelPro labeling the text alignment is different based on where the label ended up in relation to the original point). This step takes care of the horizontal positioning.

Set text alignment in MAPublisher Text Utilities

The second step is to adjust vertical positioning. Vertical positioning is adjusted by moving all text up by a certain distance. Make sure all the O’s are selected, then use the (Adobe Illustrator) Move tool. In the Position group, set the Horizontal to 0 (no adjustment here since Text Utilities was used), set the Vertical to minus half the text size (font size in this example was 14 pt, so a vertical adjustment of -7 pt), and the Angle to 90 degrees.

Use the Move panel to fine tune position

For reference, this example is zoomed into a symbol that did not get displaced.

Next, these labels need to be turned into point symbols. There is a handy option in MAPublisher Text Utilities that can do that, but it places a point to the lower left of the text and the symbols need to use the center text reference point that was just created. Instead, with all of the O labels selected, open the MAP Attributes panel and export the attribute table to a text file. Make sure to specify the option Export All Attributes because there are two important hidden attributes needed to make this work: #MapX and #MapY, which are the coordinates of the text reference point.

Export attributes to a .txt file
(Click for larger version)
Export attributes to a .txt file

Using MAPublisher Import, add the attributes text file that was just created to the map and make sure to appropriately specify #MapX and #MapY in the X and Y coordinate columns.

Import .txt file as Delimited XY

Since there is no projection information stored in the text file, you’ll need to specify that the coordinates are in the same system as the MAP View it’s coming from and you’ll need to add it to that MAP View upon import.

On the map, there is now a new point layer and because they still have all of their original attributes, the layer can simply be added to the MAP Theme to have all the point symbols reapplied to them instantly. Let’s admire the results:

Symbols reapplied with MAP Themes

If needed, repeat the last few steps for the suppressed labels as well (to a different file and different layer of course) to see what still needs to be done manually.

How to Create and Style Highway Shields with MAPublisher LabelPro

MAPublisher LabelPro intelligently labels your map layers using custom rules and styles. One of the popular uses of this feature is to create highway shields. The result is a cleaner map and is widely used on road maps around the world. While MAPublisher has many default options for highway shields, it is possible to create custom shields to improve your map as well. This blog will outline the steps to create and customize highway shields for your map.

Step One

Import your data into MAPublisher, ensuring your road line data has an attribute field for highway route numbers. Highway shields can work with any data type, however, traditional highway shields are created with a highway number with no additional characters. Using the integer data type enforces this and is recommended for highway shields.

 

Step Two

On the MAPublisher toolbar, in the Labels subsection, click the MAP LabelPro button.

 

Step Three

On the MAP LabelPro dialog box, click the Setup Layers button. This allows you to select which layers are going to be labeled or used as obstacles. This means you can label multiple features at the same time as the highway shields. Click the checkbox next to your roads layer and click OK.

 

Step Four

Optionally, you may want to only create highway shields on some of the roads within your road layer. For example, if your roads layer also contains roads that are not highways, you don’t want them labelled with a highway shield. The solution is to create a Label Filter. To do this, first create a new filter by clicking Add label filter button at the bottom of the dialog box. Next, in the Label Filter section, select Limit by expression and click the Edit icon. This opens the Expression Builder dialog box. In this example, the expression entered selects only roads that have a jurisdiction designated as “Federal” or “Province”. Only these roads will be labelled with a highway shield.

 

Step Five

If you didn’t create a label filter, click the layer in the Source list you would like to label. On the right side, ensure that the “Is labeled” checkbox is checked. Immediately below, in the Label Source drop-down, select the field that contains the highway route numbers.

 

Step Six

Select or create a rule from the Rules drop-down. The pre-defined Highways and Interstate rules that are included with MAPublisher follow conventional mapping patterns, but if you want to customize the setup of your shields, click the Edit button. Once you are satisfied with your rules, click OK to return to the MAP LabelPro dialog box.

 

Step Seven

To customize the appearance of the shields, click the Edit button beside the Style drop-down. To add highway shields, click the Label with symbol check box to enable its settings. The Symbol file is the shield library, where you can pick between Canadian, US State and generic shields. The Symbol drop-down is where you can pick the shield from the shield library specified. All shields will have the same symbol, if you want multiple shield shapes on your map, you’ll have to create label filters as outlined previously in step four. The Font family, Font Style, Size, Colour and Label case affect the appearance of the text within the shield. Click OK when finished setting the style.

 

Step Eight

Back in the MAP LabelPro main dialog box, click the “Output suppressed labels to” check box. This moves all excess labels such as duplicate shields or shields that clash with other features on your map to a Suppressed layer. You can view features on the Suppressed layer after to see which labels were not included and you can decide to keep or delete them.

 

Step Nine

Click Label to begin the labeling process.

 

Step Ten

When all of your shields are generated, you can do some additional customization. In the Illustrator Layers panel, select all of your shields. From here, any changes to the colour, stroke colour and other settings you would use on objects, will be applied to your shields. With this functionality, you can create the exact shields you want for your map.

Getting the Best Resolution when Importing an Image from a WMS

Using a Web Map Service (WMS) is a great way to easily get up-to-date imagery for your project. An issue you may run into, however, is that a server may not allow you to download images over a certain size (in pixels). The image resolution provided on most servers is usually high enough for most projects but there may be some instances where a higher resolution is needed (e.g. a poster-sized map or a web map that covers a large area).

One possible workaround for this issue is to get several small-area, high-resolution images from a WMS and then mosaic them together to make one large-area, high-resolution image. Here, we will use the City of Toronto Web Map Service to:

  1. Get an image of downtown Toronto
  2. Tile the image to split it into four smaller images
  3. Use the extents of the four tiled images to get four high-resolution images
  4. Mosaic the images to one large high-resolution image

 

Download an Image from the Web Map Service

First we will get an image of downtown Toronto from the City of Toronto WMS. Click the Advanced Import button on the Geographic Imager panel. Select Web Map Service from the Format drop-down and click Browse. Click Load services from Avenza and select City of Toronto WMS from the list.

 

Download an Image from the Web Map Service
(Click for larger version)

 

Select City of Toronto Imagery from the list of layers. Click Select Area then drag a box to zoom in on an area of downtown. Click OK to return to the previous window. There is no need to change the image size because we will use this image to get the extents of a higher resolution image. Leave the other options as default and click OK to load the image, and click OK again on the Advanced Import dialog box. The selected image will now open in Adobe Photoshop.

 

Tile the Image

Next, let’s tile the image to split it into four separate images. Open the Tile dialog box from the Geographic Imager panel. Choose By Number of Tiles as the Tiling Schema and change Horizontal and Vertical to 2. Change the Horizontal and Vertical Overlap to 3 percent. It’s important to have overlap between the images so they will mosaic properly when the data is transformed.

 

Tile the Image
(Click for larger version)

 

Click the Keep Images Open check box to enable it. Choose a name and location to save the tiles. You can save them to a temporary location because they will not be part of the final product. The four image tiles will open in separate tabs.

 

Estimate a Web Map Service’s Maximum Image Size

Open the City of Toronto Imagery WMS again and select an area. In this service, as with many other services, the maximum resolution is not provided. We can, however, use trial and error to find the largest image that the service will allow us to download. A WMS has a maximum allowed width and height set for an image request. The maximum width is usually the same as the maximum height.

Set the resolution of the image by adjusting the width of the image in pixels under Output Options. First, try setting Image Size to a pixel width of 5000. Height will update automatically based on the image’s dimensions. Click OK and you will see an error that says “Parameter ‘width’ contains unacceptable value” (or height if the images higher than it is wide). OK the error to close it.

 

Estimate a Web Map Service’s Maximum Image Size
(Click for larger version)

 

To estimate the maximum width and height allowed by a web service, you can adjust the image size to see when the server returns an error. The maximum width and height for the City of Toronto WMS is about 4000 pixels.

 

Downloading and Mosaicking Large Images

Next we will use the geographic extents of the four tiled images to download four higher resolution images with matching extents then mosaic the images together. Import an image again from the City of Toronto WMS using Advanced Import. Select an area, click Select Area by Another Document’s Extents and choose the first tiled image from the dropdown menu. The Select Area dialog will display an area matching that image’s area. Click OK to return to the previous screen.

 

Downloading large images
(Click for larger version)

 

Enter 3000 as the Image Size. Click OK to add the image to the Advanced Import dialog box. Repeat the above steps for each of the remaining three tiled images.

Creating a mosaic of four images (two by two) makes a single image just under 6000 pixels wide because of the overlap between the tiles (the height will vary depending on the area you selected). This is larger than the maximum size allowed by the WMS. Check the box Mosaic All Files to the Destination Document and select one of the images currently loaded in the dialog window from the drop-down menu. Leave the other options unchecked and select Normal as the Layer Blending Mode. This will merge the four images into a single document.

 

 

Mosaicking large images
(Click for larger version)

 

Avoid Downloading Images Greater than the Maximum Image Resolution

One further consideration when getting imagery from a service is to avoid requesting an image that is higher resolution than the full resolution of the image on the service. In this case, the number of pixels in the image and, therefore, the image size will increase without any increase in the actual resolution of the image.

To see an example of this, get an image from a WMS by zooming in on a small area and downloading images of varying resolution. The pictures below show two images of the same area side by side at different resolutions. The image on the left is 1024 by 870 pixels and the one on the right is 2500 by 2124 pixels but there is no noticeable difference between them. This is because the image exceeds the resolution of the image on the server so the WMS resamples the image to a higher resolution, creating duplicate pixels.

 

Avoid Downloading Images Greater than the Maximum Image Resolution
(Click for larger version)

 

Use Geographic Imager to Import Imagery from ArcGIS Online Directly Into Adobe Photoshop

With the latest release of Geographic Imager 5.2, it’s now possible to easily import images directly from an ArcGIS Online account or an ArcGIS web service. This will allow you to use shared data within your ArcGIS Online organizational account and connect to publicly available map servers from various online sources.

 

ArcGIS Online is a collaborative web GIS that allows you to store and share GIS data using Esri’s secure cloud. Before, you may have had to download raster layers to your local machine and then import them into Adobe Photoshop using Geographic Imager. Now, Geographic Imager has a much-improved workflow to get ArcGIS Online image layers into Adobe Photoshop with full georeferencing.

Currently, the types of datasets allowed are Map Image Layers and Tile Layers. To load a layer, open Advanced Import and select ArcGIS Online from the Format drop-down list. Enter the credentials for your ArcGIS Online account and select an image layer from your user portal.

Images can be resized and transformed on import. To extract a specific area from the image, click Select Area. The interface is the same as the one used for WMS Import.

In addition to using your own organization’s data, you can connect to publicly available data from a wide variety of organizations by connecting to an ArcGIS Web Service. To connect to a web service, use Advanced Import and select ArcGIS Web Service from the Format drop-down menu. Click Browse and enter the URL for the service. This is a great option when searching for data from open data portals created by government agencies.

Handling GeoJSON Files with Unspecified Projected Coordinate Systems

In the latest GeoJSON specification (2016), the coordinate reference system for all coordinates is a geographic coordinate reference system—using the World Geodetic System 1984 (WGS 84) datum—with longitude and latitude units of decimal degrees. The previous specification (2008) allowed for the use of alternative coordinates systems, but this was removed because of interoperability issues.

MAPublisher still recognizes GeoJSON files with a specified coordinate system even though it is no longer officially supported. However, if no coordinate system is specified, MAPublisher will assume the coordinates are in WGS 84. Occasionally, this may cause a problem of improperly formatted files that contain projected coordinates but have no specified coordinate system. In this case, users will need to either choose a coordinate system during import or modify the GeoJSON file by adding a coordinate reference system (CRS) object manually.

Selecting a Coordinate System on Import

To change the coordinate system using the Import dialog box, click Advanced and select the WGS 84 link under Coordinate System. Ignore the warning about changing the coordinate system by clicking “Replace coordinate system”. Select the correct projected coordinate system from the list.

 

Modifying the GeoJSON File Manually

Coordinate reference systems can be specified in a GeoJSON file using a CRS object. You can view the contents of any GeoJSON file by opening it in a text editor such as Notepad. Copy and paste the text below after the line: “type”: “FeatureCollection”, (usually on line 2). Change the EPSG number to the correct CRS for your dataset. See Spatialreference.org to lookup an EPSG code.

"crs":
{
   "type" : "name",
   "properties" :
   {
      "name" : "EPSG:[EPSG Code]"
   }
},

Example:

The GeoJSON file can now be read properly by MAPublisher and can be imported as normal.

Cleanup Lines With MAPublisher Trim and Extend Tools

The latest release of MAPublisher includes the ability to trim and extend objects to a crossing or intersecting path. Extending a path lengthens it to meet the edge of a crossing object and trimming a path cuts the portion that extends past the edge of an intersecting path. Trim and extend tools are commonly used in CAD software and will greatly improve the ability to produce accurate and precise data in MAPublisher and clean-up imported data.

Location of the Trim and Extend tools on the Adobe Illustrator Tools panel. Click and hold the tool button to switch between MAP Trim Tool and MAP Extend Tool.

The MAP Trim Tool and MAP Extend Tools are located on the Adobe Illustrator Tools panel. Click and hold the MAP Trim or Map Extend tool button icon to switch between them. To use the tools, select the crossing or intersecting path and click the object to extend or trim. The diagram below illustrates the basic process.

Visualization of the trim and extend processes

There are many possible applications for these tools in digitizing and cleaning map data. In a hypothetical example illustrated below, we trim all the roads that extend past the edge of a border, and extend the imported roads (in bold) to meet the existing roads.

Examples of uses for the trim and extend tools. Extending imported roads to match existing roads and trimming lines that fall outside of a map border
Lines trimmed and extended!

Use MAPublisher to Import Layers from ArcGIS Online Directly Into Adobe Illustrator

With the latest release of MAPublisher 9.9, it’s now possible to easily import layers directly from an ArcGIS Online account or an ArcGIS web service. This will allow you to use shared data layers within your ArcGIS Online organizational account and connect to publicly available map servers from various online sources.

ArcGIS Online is a collaborative web GIS that allows you to store and share GIS data using Esri’s secure cloud. Before, you may have had to download layers as shapefiles to your local machine and then import them into Adobe Illustrator using MAPublisher. Now, MAPublisher has a much improved workflow to get ArcGIS Online layers into Adobe Illustrator will full georeferencing, all map features, and attributes.

Currently, the types of datasets allowed are Feature Layers, Map Image Layers and Tile Layers. To load a layer, use MAPublisher Import as you would with any data type and select ArcGIS Online from the Format drop-down menu. Click the login link to enter your ArcGIS Online credentials to access your organization’s web portal.

Import ArcGIS Online dialog box
ArcGIS Online user portal

Feature Layers contain vector data that will import as artwork into Adobe Illustrator. Optionally, you can extract specific features using standard SQL queries. Map Image Layers and Tile Layers are raster data layers that can be added by selecting the geographic extents.

Import Image Map Layer

In addition to using your own organization’s data, you can connect to publicly available data from a wide variety of organizations by connecting to an ArcGIS Web Service. To connect to a web service, use MAPublisher Import and select ArcGIS Web Service from the Format drop-down menu. Click to select the dataset and enter the URL for the service. This is a great option when searching for data from open data portals created by government agencies.

Import ArcGIS Web Service
Valid ArcGIS Web Service

Accessing Esri’s online services through MAPublisher provides a great opportunity to use shared data within your organization and access a wide variety of publicly available data. We’re sure you’ll find it very useful for finding data to make great maps.

Isolating and Displaying Specific Grid and Graticule Lines

MAPublisher Grids and Graticules is a powerful tool. There are dozens of settings to create an indexed grid, measured grid, or graticule exactly the way you want. We often receive questions about how to create certain grid and graticule styles and this was interesting. We were asked how to create a graticule to display a very specific latitude and longitude, perhaps even by itself (only a single line of latitude or longitude).

Creating a single graticule line

In this example, we’re going to create a graticule that will only display the Tropic of Capricorn at -23.4371 degrees (or 23.4371 degrees south of the equator).

On the MAPublisher toolbar, click the Grids and Graticules button to open the dialog box. Click the Graticules button to create one. On the Graticules Grid main settings, the important setting to note here is the Pass through section — it specifies lines of latitude and longitude that must be included in the graticule. Enter 30 deg Long and -23.4371 deg Lat. This means that a graticule line must pass through -23.4371 degrees latitude (the Tropic of Capricorn). The reason why a line at 30 deg longitude is specified is to hide it from the map view (it is placed at 30 deg longitude outside of the map extent).

Pass through setting

In the Intervals section, set 90 deg Latitude interval and 180 deg Longitude interval. Because the intervals are at the extreme, this means that the the only lines left to display are the ones specified in the Pass through section (30 deg long and -23.4371 deg lat). In this case, it will only display a single line of latitude (the Tropic of Capricorn) for the graticule.

Intervals setting

If you want to label the graticule, go to the Line Labels setting. Click the Lat and Lng on the grid label control to enable them. To control how many decimals are displayed, click the Format setting, then change the number of decimals to something greater than 0.

Label settings

To intersect single lines of longitude and latitude, adjust the Pass through setting so that the line is within the map’s extent. In this case, it was set to -50 deg (50 deg west).

Intersect single lines of longitude and latitude

Remember that you can share Grids and Graticules settings with anybody by clicking the Save Settings button, selecting a destination folder and sharing the configuration files.

The Difference Between Constraints and Bounds in a Graticule

A graticule is the network of lines of latitude and longitude drawn at regular intervals on a map. Graticules are created in MAPublisher using the Grids and Graticules tool. In some maps, you may want to limit the area on the map that a graticule covers. For example, you may want it to cover only the map’s area of interest. The image below is a map of North America with a graticule drawn at 5-degree intervals. US State boundaries are drawn in white. In this post, we’ll modify the graticule three times so it conforms to the edges of the image, so it covers only the Continental United States, and lastly a combination of the previous two modifications.

North America with a graticule of 5 degree intervals.

MAPublisher can limit the geographic extents of a graticule in two ways: using Grid Bounds and using Grid Constraints. In both cases, you’ll specify the lower left and upper right corners of the graticule. Specifying Grid Bounds will limit the extent of the graticule to a rectangular area while specifying Grid Constraints will limit the graticule along lines of latitude and longitude. If both Grid Bounds and Grid Constraints are specified, the graticule will cover an intersection of the two areas. The image below shows bounds and the constraints and the intersecting area which forms the graticule.

Bounds and the constraints and the intersecting area which forms the graticule.

To modify a graticule so that it conforms to the edges of the image, you’ll need to specify grid constraints. In the Grids and Graticules dialog box, click the Specify Grid Constraints check box and set the Lower Left and Upper Right corners to the corners of the image which are -127°, 7° and -50°, 65° respectively.

Specifying Grid Constraints.

To create a rectangular graticule covering only the lower 48 states, click the Specify Grid Bounds check box and set the Lower Left and Upper Right corners to the corners of that area. Tip: click the MAP World Locations drop-down arrow to choose the values for the lower left and upper right corners.

Specifying Grid Bounds.

When both Specify Grid Bounds and Specify Grid Constraints check boxes are both checked, the graticule will cover an intersection of each of the extents. For instance, in the map below, the northern extent follows the 49th parallel at the Canadian border, the western extent is at the edge of the image (127° west) and the south and east extents are the same as in the previous map.

Both Specify Grid Bounds and Specify Grid Constraints selected.



 

Validating Georeferencing in Geographic Imager

When georeferencing a map in Geographic Imager, there are two tools which can be used to check spatial accuracy: Validate and Show Image Extents Online. With Validate, click a point on the image and it will show the corresponding location on the web map service so that you can compare the difference between them. Show Image Extents Online will display a rectangle representing the spatial extent of the image on the web map.

The image below shows the Validate tool in action. Selecting the tool and clicking on the road intersection brings up the same intersection in the web map, displaying how accurate the georeferencing may be. It is good practice to test several known points on the image. Choose features that will be easy to identify on the web map such as road intersections, coastlines, buildings, and landmarks.

The Show Image Extents Online tool is shown in the image below. Use this tool to see the full area covered by the image. Note that the rectangle shown on the web map will include the non-map areas of the page (borders, legend, etc).

 

News Archive