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.

Best Practices for Processing and Importing Maps into the Avenza Maps App

Avenza Maps is capable of importing and displaying georeferenced maps in several different formats. The app processes a map by rasterizing and tiling it on import. The speed and result of processing will vary depending on the type of file used and the size and dimensions. We’ll discuss the types of files allowed and the advantages of each.

Usually larger files take longer to process than smaller ones with some exceptions. An image may have a very high resolution but a small disk size due to image compression. It is recommended that images be less than 100 megapixels for upload to the app. A geospatial PDF file with many vector features may also take a long time to process. In this case, you should convert the file to an image to avoid having to rasterize vector data in the app.

Maps can be loaded into the app faster by processing them before import. Maps can also be preprocessed by uploading them to the Avenza Maps Store or using the Export to Avenza Maps tool in Geographic Imager or MAPublisher.

Comparison of Allowed File Types

GeoTIFF

A GeoTIFF is a TIFF file (Tagged Image File Format) with spatial information embedded in the file. This format is typically the preferred format for uploading directly to Avenza Maps without preprocessing. Since this is an image format, the app doesn’t need to rasterize the file on import meaning processing times will generally be faster compared to PDF’s, and it will maintain the native resolution.

It is also possible to import a normal TIFF file by zipping it with a TIFF World File (TFW) and either a WKT or PRJ file which contains projection information. It is best not to do this for the sake of simplicity. Usually, any GIS software that can produce a world file will also be able to save to GeoTIFF.

Geospatial PDF

A Geospatial PDF stores spatial data in either raster or vector format as well as associated attributes and layer information. Files should comply with the Adobe Acrobat PDF 1.7 specification which has been standard since 2006.

Avenza Maps rasterizes geospatial PDF files on import which discards layer and attribute information. PDF files typically take longer to process than image files. There is also a chance that the file may process incorrectly (e.g. discarding labels).

Despite this, there are some instances when it may be preferable to use a geospatial PDF file. For example, the map may already be in this format and isn’t worthwhile to convert to another format. Geospatial PDF files tend to be smaller than image files so they would be a good solution if device storage space or download speed is an issue. Also, occasionally converting from PDF to TIFF degrades the image quality and may make maps illegible.

To ensure a geospatial PDF file has a good balance between size and quality, open the file in Adobe Acrobat and go to Advanced > PDF Optimizer. This is especially helpful if the map contains large raster images.

JPEG

JPEG is an image format like TIFF but it does not have the ability to store spatial information. To load a JPEG into Avenza Maps, it must be zipped with a JPEG World File (JGW) and either WKT or PRJ file. JPEG files are compressed so this may be an option to consider if file size is a consideration, however, a better alternative would be to compress a GeoTIFF file.

Processing Maps with MAPublisher, Geographic Imager, and the Map Store

It is best to process maps before loading them into the app because desktop computers are more powerful than mobile devices. It also avoids having to process the file each time the map is loaded onto a device. Geographic Imager and MAPublisher each have a utility to export to an Avenza Maps package with the capability to upload directly to the Avenza Map Store if you have a vendor account.

Running these utilities produces a folder that contains a ZIP file with a thumbnail to show a preview of the map, a reference file, and a folder called tiles that contains a tiled version of the map in PNG format. This ZIP file can be imported into the app in the same way as other files.

Uploading a map to the Avenza Map Store processes the map the same way. To use the store, register a vendor account on the Avenza Maps website.

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!

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.

Placing Text with an Offset Value Using MAP LabelPro

Having introduced some background information about text insertion point coordinate values in a previous post, it would be good to explore if this method works when trying to place text objects (annotations/labels) with a specific offset value. For example, if you have a point layer and there is an attribute for the offset value so that every object has a different offset value.

An Attribute table with the offset value for every object

Placing text objects with a specific offset is possible in MAP LabelPro. You can specify the Label Offset value in the MAP LabelPro dialog box. However, this setting will be applied to all text labels. In the example below (see screenshot), all the text will be placed 0.2 inches away from the object. However, that does not help when every point has different offset value like this example. Also, MAP LabelPro uses page units, not the world/map units. In this example, the offset distance was specified in the world/map unit (metres).

The offset option in The Point Rules dialog window from MAP LabelPro.

There are two methods you can accomplish to make the text placed with offset value. The first method is the same as the step shown above. You can adjust the text placement position by calculating the “ideal” coordinate for the text insertion point. From a MAP layer (point, line, or area), generate text with a MAPublisher feature (MAP LabelPro or Feature Label).  Then adjust the text position (maybe you will have to calculate a new position by adding/subtracting the offset values from the current point), then apply it to #MapX and #MapY. The second method is to adjust the position of the points first before labeling.

In the example below, a point layer with offset values in the attribute: x_Offset and y_Offset.

An example map with offset attributes (x_offset and y_offset)

Step 1: Calculate coordinates with offset.

  1. Create a copy of the layer just because the point value will be adjusted.
  2. Make the #MapX and #MapY visible (so that it’s easy to see when calculating).
  3. Create new columns (here we created “x+coord_withOffsetX” and “y+coord_withOffsetY”).
  4. Calculate the new coordinate of the points for X and Y (here we used Apply Expression) as shown below.

Step 1: Calculating the coordinates with offset

Step 2: Move the points to the calculated coordinates with the offset values.

Use the same method as the one introduced in the previous post. This method works for the Point layer as well. Open the Edit Schema window and apply “x_coord_withOffset” and “y_coord_withOffset” to #MapX and #MapY, respectively.

Step2: moving the points to the calculated coordinates with the offset values

Now, the points are moved to new position. The red point is the original and the blue points are the ones moved to the offset. Now you can label each points. After placing labels for the point layer (blue), you can make the point layer invisible.

The point position is adjusted by #MapX and #MapY

Now you can run the label engine (MAP LabelPro / Label Feature) for the new point layer with offset.

Using MAP Themes to Automatically Style CanVec+ Data on Import in MAPublisher

Creating multiple maps that share cartographic styling is a common requirement for MAPublisher users. The most effective way to accomplish this is the use of MAP Themes. MAP Themes are a collection of thematic cartography tools designed to increase productivity by automating how styles and symbols are applied. Creating a number of MAP Themes based on regularly used layers with standard attribute schemas can greatly reduce the amount of time spent styling maps.

This guide will walk through creating and setting up MAP Themes to automatically apply to the appropriate layers upon import. If done correctly, rather than seeing this:


Unstyled CanVec+ layers

 

You will see this when importing data to MAPublisher:

Styled CanVec+ layers

1. Data Source

The data used in this guide comes from the publically available CanVec+ topographic database. CanVec+ contains a comprehensive set of layers optimized for display at 1:50,000 that are perfect for topographic mapping. In fact, many of these layers are used in the construction of the CanTopo Topographic mapping series available here.

The layers you receive from the CanVec+ download service will vary depending on what features are present in the extent chosen. The Geogratis Geospatial Data Extraction tool is the most convenient method to retrieve CanVec+ data. This guide uses a selection of CanVec+ layers styled similarly to the CanTopo maps.

All vector data was downloaded in an unprojected geodetic coordinate system and projected into a UTM projection MAP View.

The map shown above contains 12 vector layers and one raster layer, but we will only discuss the styling and configuration of three layers as the process is similar for the rest. You can download the Adobe Illustrator file at the bottom of the page if you want to examine the different layers, their graphic styles and MAP Themes.

MAP Themes are the primary method for applying attribute based cartographic symbology. A powerful feature is the ability to automatically do this on layer import based on geometry type or file name. By defining one or many graphic styles and a MAP Theme for each layer the layers can be automatically styled on import.

CanVec+ themes have a consistent naming scheme that makes them especially suitable for this sort of automated styling. Because each style is always named the same, it is simple to set up the MAP Themes to automatically apply when the layers are imported. The theme names are consistent but somewhat obscure, as are some of the attribute names and values. Luckily there is a specifications document that provides a guide to the various themes, datasets and attributes that are available. A link is provided in the useful resources section below. While the style guide is helpful, it can be difficult to navigate, so it has also been translated into a more easily readable Excel spreadsheet, which also available in the useful resources.

A CanTopo symbology guide is available for download and was used to help define the styles for the different layers used in this map. A link is available in the useful resources section at the bottom. The University of Toronto also hosts an old specifications guide, but as it is almost 14 years old it should not be assumed to be accurate. If you are looking for inspiration though, it is useful.

 

2. Example A: Building point locations

Building Symbols

2a. Building Point Symbol

The Graphic style for the building symbols is a black square rotated to match the value in an orientation attribute. Using the CanTopo symbology guide a correctly sized square was created and then added to the symbol library.

Buildings Symbol

2b. MAP Theme

A new Point Stylesheet MAP Theme was created called Buildings. The appropriate layer “bs_2010009_0” was added to the Theme and a rule was created named “All” as it will apply to all the building point locations. The Rule Expression is set to apply the Theme to all artwork as we want all the building points to look the same.

Buildings Rule Expression tab

The Visual Properties tab was used to determine how the buildings would appear. The Symbol property was set to use the Building black square symbol created and added to the Symbol library earlier. The Rotation property was set to use the “orientatio” attribute. This ensures the buildings are oriented correctly.

Buildings Visual Properties tab

Finally, and most importantly for the MAP Theme automation, the Auto-assign option was set so that any layer that matches the filename of the imported shapefile would automatically be styled using this theme.

Buildings Auto-assign setting

 

3. Example B: Contours

Contours

3a. Contours Graphic Style

Two Graphic styles were created for the contours: one for the regular contours and one for the index contours at intervals of 100m. Both are grey, with the index contours slightly thicker (although it is hard to tell in the Graphic Styles panel.)

Contours Graphic Styles

3b. MAP Theme

A Line Stylesheet MAP Theme was created called Contours. The layer “fo_1030009_1” was assigned to the MAP Theme. Two rules were created, one for index contours and one for regular contours. For the index contours, the Advanced Rule Expression builder is used to select any contour where the elevation is a multiple of 100, and the converse for the regular contours.

Index Contours Rule Expression

The Modulo (MOD) function makes this simple. For the index contours, the expression built as: “MOD(elevation,100)=0”. For the regular contours, the expression is “MOD(elevation,100)!=0”. The != operator means not equal to.

Contours Rule Expression

The Modulo function will be available with a future release of MAPublisher. If you are using an earlier version of MAPublisher, the same result for index contours can be had with this expression:

(elevation/100)-ROUNDDOWN(elevation/100,0)=0

If you do try and apply this MAP Theme with an earlier version of MAPublisher without changing the equations, it will not work and you will get errors.

Each rule is assigned the appropriate graphic style applied in the Visual Properties. Creating Graphic Styles in advance is much easier than trying to remember specific stroke/colour combinations and makes them re-usable.

Index Contours Visual Properties

It is worthwhile organizing them in the Graphic Styles panel and naming the Graphic Styles appropriately so you can easily remember which is which later.

Contours Visual Properties

The layer is then set as auto-assigned so that when it is imported in the future this MAP Theme will automatically be applied.

Contours Auto-assign setting

 

4. Example C: Roads

Roads

4a. Graphic Style

The Roads layer is the most complex as there are multiple different classes of roads, that are then broken down into sealed and unsealed surfaces, and can be at grade, tunnels or bridges. Several of the road classes are assigned the same Graphic Style, so each style was named after a representative road class and assigned to several MAP Theme Rules.

Roads Graphic Styles

4b. MAP Theme

There are defined styles of roads in the CanTopo specifications, but these do not map directly to the attributes that are present in the CanVec roads dataset. There are several attributes that hold information about the composition of the road, but the ones that were used to define the MAP Theme Rules were:

  1. roadclass: a heirachy of road types
  2. structype: defines if the road is a road, a bridge or a tunnels
  3. pavstatus: contains information on the road surface, if it is paved or unpaved.
Roads Attributes (many others are hidden)

A Line Stylesheet Theme was created called Roads. The layer tr_1760009_1 was assigned to this Theme. Each road class has its own rule. The rule expression determine what class of road it is, if it is a bridge or a tunnel, and if it is paved or unpaved. An example of this is “Arterial: Paved: Bridge” with the expression:

roadclass=3 AND pavstatus=1 AND (structype =1 OR structype =2 OR structype =3 OR structype =4)

which simply says select art that is an Arterial Road (roadclass=3) is paved (pavstatus=1) and one of four different types of bridge (structype 1 through 4).

Roads Rule Expression

As in previous examples, each rule is assigned a Graphic Style in the Visual Properties tab.

Roads Visual Properties

The layer is set to auto apply on import.

Roads Auto-assign setting

Once rules are created and applied to all the imported layers the end result looks like this:

Styled Layers overlaid on hillshade

 

5. Hillshade

In addition to vector data, the GeoGratis portal has raster terrain data available for download. There are digital elevation models, digital surface models, and a variety of derived products such as slope and aspect. For this map we downloaded a hillshade and adjusted the opacity so it would blend with the map style. The forest cover layer and the built up areas layer also had their blending modes adjusted so the hillshade would show through.

The hillshade was downloaded in an unprojected geodetic coordinate system and Geographic Imager was used to transform it into the UTM projection used for this map.

 

6. Final words

In order for the defined MAP Themes to be automatically applied to any imported data, the imported layer filenames must match those defined in the MAP Theme Rules as discussed above. If you would like to try it out with your own CanVec data extract, do the following:

  1. Download the “Canvec_Data_Themes.ai” file linked below for the version of Illustrator you are using. Have a look at the data structure, layer names and MAP View properties of this document.
  2. Also download the appropriate “Canvec_Data_Themes_Empty.ai” file to use as a template.
  3. Download an extract of CanVec data as shapefiles.
  4. Use the Advanced Import functionality to import the shapefiles into the empty document. Reproject the map if desired.
  5. The imported data have the styles applied automatically. However, you will probably have a few layers that have no style. Use the methods detailed above to create new styles for those layers.

 

7. Useful resources

CanVec Demo. (Created with MAPublisher 9.5.3, AI CC2014) – File Download
CanVec Demo – No Layers. (Created with MAPublisher 9.5.3, AI CC2014) – File Download
CanVec Demo. (Created with MAPublisher 9.5.3, AI CS6) – File Download
CanVec Demo – No Layers. (Created with MAPublisher 9.5.3, AI CS6) – File Download
GeoGratis Website
GeoGratis FAQ’s
CanVec Style Guide for Adobe Illustrator – File Download
CanVec Feature Catalog
CanVec feature Catalog Spreadsheet (Unofficial, non-maintained. For information only.) – File Download
University of Toronto Topographic Cartographic Symbols Archive

Improve Mosaic By Resampling Images in Geographic Imager

The Mosaic function in Geographic Imager merges multiple georeferenced images together to create a single composite georeferenced image. Though the goal of the mosaic is to create a single and seamless composite image, combining images with the Mosaic tool will often result in a slight shift of the imagery due to differences in the original pixel registration grid. This means that even when images are in the same coordinate system with the same spatial resolution, error can still be introduced because of a difference in the pixel alignment. Due to this, mosaicking processes in general tend to produce results that may be very close, but not exact. With this in mind, the results of your mosaic may be improved by resampling your images beforehand to the smallest unit of the resolution.

As an example, let’s say we have an image where the pixel size is 2.00 metres. When plotting the X coordinates of every pixel in this image (using the top left corner of the pixel), the X coordinate value will be incremented by the number/distance of the pixel size. For example, if the X coordinate values were to start at 111.00, then the next pixel would be 113.00, 115.00, 117.00, and so on. It’s important to note that these coordinate values are discrete, which means that the values could not be 113.22 or 115.77 because the origin of the coordinate in this case starts at 111.00 metres.

Now, we have another image that we want to mosaic with the first image. In this instance, the first image will be “Image A” and the second image will be “Image B”. Image B has the same coordinate system as well as the same pixel size as Image A.

Take a look at the X coordinates in Image A and Image B below:

We can see that the X coordinate in the top-left corner is different between these two images, and as previously mentioned, we know that the X coordinate values are discrete. When mosaicking Image B to Image A, the X coordinate cannot be 111.75 or 113.75. The coordinates must be 111.00, 113.00, 115.00, and so on, following the pattern of the pixel grid values in Image A.

This means that Image B will need to be “shifted” or “snapped” to the closest coordinates when the mosaic is performed, see below:

As a result, the X coordinate of Image B will be shifted by 0.75 metres (less than half a pixel). The pixel with X coordinate 111.75 is now placed at 111.00 and the next pixel with X coordinate of 113.75 will now be placed at 113.00, and so on.

With this in mind, the results of your mosaic may be improved by resampling your images to the “smallest unit of the resolution”. The smallest unit of the resolution can be determined from the difference in the coordinates (spatial alignment difference) between the two images.

Looking back at our example, we can see that the smallest unit of the resolution (represented by the blue arrow) in this case is 0.75 metres – this is the value we will use to resample our images.

Once the images have been resampled to 0.75 metres, we may go ahead with our mosaic.

The above example demonstrates the possibility of a pixel shift after a mosaic for two images with a different pixel alignment. It should be noted that this example explains the problem in one-dimension (looking at only the X coordinate) when the image in reality is in two-dimension (looking at both X and Y coordinates). The basic principal of the pixel shift in 2D is the same, but it would include the direction of the shift when mosaicking images. In addition, it’s important to keep in mind that although resampling your images to the smallest unit of the resolution will improve the final mosaic, this is not always an efficient process when mosaicking with more than two images. Another thing to remember is that resampling your images will make your file size much larger. However, in cases where high precision is desired, resampling the images beforehand is a process that should be considered.

Labeling Trick for MAPublisher

This blog post was written by Avenza reseller in The Netherlands, Hans van der Maarel of Red Geographics.

When you’re labeling point features (let’s say cities) in MAPublisher, using either Label Pro or Label Features, and you’re not placing a label for every single point, you’re left with the task of removing the points you haven’t labeled. This trick will have the text inherit the attribute structure of the points including a lat/long and guarantee that there are no orphan points.

Take for example the above map. I want to label the cities, but not all of them. I’ll decide as I go along which city will get labeled, and which will get dropped. In order to more easily remove the unlabeled cities I need to do some preparation. I’ll create two columns in the cities layer, X and Y, and assign the expression #MapX and #MapY to them, respectively. It’s important that you do this through the Apply Expression option in the Map Attribute panel.

This gives two attributes with the original coordinates of the city points.

Next, I’ll create a layer for the labels and put it into the MAP View as a text layer, indicating that I want to copy the attribute structure of the cities layer.

Now that all the preparatory work is done, I’ll start the labeling. I’m going to be using the Label Features option, but this will work with MAP LabelPro as well.

If I select one of the texts and look at its attributes, I’ll see that the attributes from the city point have been transferred to the text, including the X and Y attributes which hold the position of the original city point.

Next, I’ll remove the city points layer, select all city labels and use the Export Attributes option in the MAP Attributes panel:

This will export a comma-delimited text file (CSV). Make sure to check the “Field names on first line” option. It’s not exactly necessary, but it will make things a lot easier.

Import the CSV file back into MAPublisher. Make sure to specify that the projection of the data is the same as the existing MAP View. Once the data is imported, you can apply any existing Stylesheets that you had in place to style the cities, or create a new one. This way, you end up with just the symbols for the cities you’ve actually labeled.

How to get Open Street Map data into Adobe Illustrator with MAPublisher

Edit: Updated with a new QGIS workflow (November 21, 2014)

The following tip is courtesy of Hans van der Maarel of Red Geographics.

————-

For many areas on Earth, OpenStreetMap is a viable alternative to commercially offered data sources. However, it is not always easy to process. This blog tutorial explains the steps needed to load OpenStreetMap data into MAPublisher.

1. Download and install QGIS, this is a free GIS application, available for Windows, Mac and Linux computers. QGIS now comes with built in tools for downloading Open Street Map Data.

2. Open QGIS and zoom in to an area of interest. Use the OpenLayers plugin for a basemap if you do not have any imagery or mapping of your own. Keep in mind that downloads from the OpenStreetMap website are limited in the number of exported objects, so for larger areas you will have to combine multiple downloads yourself, or look for other options (for example Geofabrik).

Bing Basemap

3a. Go to the Vector Menu and Choose OpenStreetMap and then Download data.

OSM Download Menu

3b. Choose how you want the extent of the downloaded data to be defined. The easiest way is to use the Map Canvas.

OSM Download Dialogue

4. Open your downloaded .osm file in QGis using the Add Vector Layer tool. Select all the Layers and choose OK.

Select vector layers to add

This results are shown in several layers depending upon what is present in the extent you have downloaded. In this case there are points, lines, multilinestrings and multipolygons. Note that QGIS only imports features that fall completely within the extent specified. So make sure you choose an area larger than your actual area of interest to ensure it is completely covered.

OSM layers loaded in QGIS

5. Export these layers one by one. Right-click and choose “Save As, then ESRI shapefile”.

Save Points to Shapefile

6. The shapefiles can be imported into Adobe Illustrator using MAPublisher. After reprojecting, scaling and cropping we’ve ended up with the raw OpenStreetMap vectors in Adobe Illustrator, with all attributes still maintained.

OSM Layers loaded in MAPublisher

7. Once within the data is imported successfully, you may now use any of the MAPublisher and Adobe Illustrator tools to style and customize the map in any way you want.

OSM Layers loaded and themed in MAPublisher

 

News Archive