Archive for September, 2011

Maperitive Tutorial: Generating OSM Map For Adobe Illustrator In Seven Easy Steps

2011-09-14 by Igor Brejc. 7 comments

SVG map of Manhattan generated using Map

In this tutorial you will learn how to produce a vector map based on OpenStreetMap data and then export it to SVG format suitable for editing in Adobe Illustrator. SVG export is one of the most useful features Maperitive provides and I’ve spent a lot of time tweaking the code so that Illustrator can handle the exported SVGs.

NOTE: the tutorial has been written for Maperitive build 1228. Some things will change in the near future, so please visit http://maperitive.net for any updates.

First things first: start Maperitive (if you don’t already have it, you can download it from here). Unzip the package somewhere on your disk and run Maperitive.exe (on Windows) or Maperitive.sh (on Linux/Mac).

Step 1: Setting Your Map Limits

Currently Maperitive uses your computer’s memory to store map data, so there is a limit of how large a map it can work on. Because of that, we need to tell Maperitive what area we’re interested in, so all the operations will limit themselves on that area.

There are several ways to set the limits. The easiest is to move the map to the area, zoom in our out appropriately to cover all the area you want, and then use the Map / Set Bounds menu function.

I will do this manually by entering a following command in the command prompt (at the bottom of the screen):

bounds-set -74.03,40.7,-73.96,40.72

I suggest you do the same for the purposes of this tutorial, so our map areas would match. The area in question is lower end of Manhattan.

Step 2: Loading OSM Data

Now we need to get the vector OSM data for our map. There are several ways of doing this.

The easiest one is to use the Map / Download OSM Data menu function, which contacts an OSM server to fetch the data. Try it out. If it fails, try it a couple more times. The problem is that these servers are sometimes overloaded and unresponsive.

If this doesn’t work, another option is to use JOSM or the Export tab on the OSM Web Map site. In that case you will get an OSM XML file, which you need to save on your disk (using .osm extension!) and then load into Maperitive using the File / Open Map Sources menu function (or simply drag and drop the file into Maperitive).

Once the OSM data is in, we can proceed with the next step…

Step 3: Removing The Web Map

Now that we have some vector content of our own, we don’t really need the OSM web map anymore. Select the Web Map (OSM Mapnik) in the Map Sources window at the bottom of the screen and then click on the “X” button to remove it:

Map Sources window

Step 4: Changing The Map Style

The default map style resembles the standard OSM Web map layer (generated using Mapnik). But just to show off, we will switch to something that looks like Google Maps. Choose Map / Switch To Rules / googlemaps menu function. After a second or two of processing, the map will change its style.

Step 5: Deciding The Map Scale

Depending on your needs, you can export the map using different map scales. Map scale is directly linked to the zoom level and together they determine what type of content is visible on the map and how the content is rendered. In the case of our Google Maps-like style, the street names are starting to appear on zoom level 15 and higher, so if you need them in your export, you will have to use the zoom level 15 or higher.

The zoom level value is displayed at the bottom of the screen:

The map scale is shown at the bottom left of the map itself, together with the bar scale indicator:

For this tutorial I’ve decided the zoom level 16 is the one I want. Try it out, you can set your own later.

Step 6: Exporting To SVG

The easiest way to export would be to use Tools / Export to SVG (For Adobe Illustrator) menu function. But since we need to specify the zoom level in our case, we will type the export-svg command manually into the Command Prompt:

export-svg compatibility=illustrator zoom=16

We instructed Maperitive to export the current map to a SVG file suitable for Adobe Illustrator and to use zoom level 16. After a couple of seconds a new file called output.svg should appear under the output directory of your Maperitive installation.

Step 7: Import Into Adobe Illustrator

Now that you have a SVG file, open up your AI and import it. If it complains about “roundtrips to Tiny“, simply ignore that.

Adobe Illustrator vs. Inkscape

You may wonder why you had to specify the compatibility=illustrator argument in the Step 6. I will just quote Maperitive documentation on this:

Due to the pretty buggy support which Adobe Illustrator provides for loading SVG files, it is not possible to have the same SVG optimally shown in both Illustrator and Inkscape. In other words, if you plan to use the SVG file in Illustrator, you should specify compatibility=illustrator parameter. Maperitive will in this case do some tweaks to the SVG file which allow it to be shown without any problems in Illustrator (tested in CS5). But do not expect this file to be usable in other SVG viewers/editors. On the other hand, if you need a SVG file which can be shown in various Web browsers and editable in Inkscape, you should specify compatibility=inkscape parameter. Again, do not expect this file to be usable in Illustrator.

Advanced Stuff

This tutorial shows only the basic workflow, but there are many ways of how the workflow can be customized:

  • using precision typography: the default setting of the export-svg command relies on Illustrator’s rendering of text on paths. By specifying the precision-typo=true command argument, each letter of a street label is positioned separately, which improves the quality of the rendering, but it can also slow down Illustrator dramatically.
  • modifying the map style to suit your needs
  • adding hillshading, hypsometric tinting and relief contours based on SRTM DEM data, especially for topo maps. Maperitive provides several menu functions and commands for this.
  • automating the whole process by writing a Maperitive script.

A Quick Guide to GIS Stack Exchange Questions

2011-09-13 by mapperz. 0 comments

What kind of questions can be asked on GIS Stack Exchange? The Geographic Information Systems Stack Exchange is for is for questions concerning geographic information systems and science. We welcome cartographers, database administrators, geographers, programmers, and anyone interested in or using GIS professionally.

Please see other places for help for questions which are off topic here (such as general questions on databases, server setup, web services, programming, etc.).

Although the scope of questions appropriate here is wide, befitting the range of GIS applications please make an initial effort to research the answer before you ask a question. That will help you write a great, focused question that gets excellent answers. Questions that are too basic (meaning the answer is indexed in any number of general internet reference sources designed specifically to find that type of information)will be closed.

GIS SE aim is to create a lasting record of great solutions to questions. Providing references to peer-reviewed literature or links to on-line resources is warmly welcomed. You can also incorporate the work of others under fair use doctrine, which particularly means that you must attribute any text, images, or other material that is not originally yours.

Please look around to see if your question has been asked before. Duplicates are Flagged for Moderation It’s also Okay to ask and answer your own question.

What kind of questions should I not ask here?

You should only ask practical, answerable questions based on actual problems that you face. Chatty, open-ended questions diminish the usefulness of our site and push other questions off the front page. Open-End cannot be completed and makes it harder for people to give correct answers.

Your questions should be reasonably scoped. If you can imagine an entire book that answers your question, you’re asking too much.

If your motivation for asking the question is “I would like to participate in a discussion about”, then you should not be asking here. However, if your motivation is “I would like others to explain … to me”, then you are OK. (Discussions are welcome in our real time web chat.)

How do I ask questions here? When you post a new question, other users will almost immediately see it and try to provide good answers. This often happens in a matter of minutes, so be sure to check back frequently when your question is still new for the best response.

Answers to your questions and comment replies to your posts will appear as a red indicator in your global inbox at the top left of every page.

Reputation The primary way to gain reputation is by posting good questions and useful answers. Your peers will vote on your posts, and those votes will cause you to gain (or, in rare cases, lose) reputation:

answer is voted up +10
question is voted up +5
answer is accepted +15 (+2 to acceptor)
question is voted down -2
answer is voted down -2 (-1 to voter)

 

A maximum of 40 votes can be cast per user per day, however, to reach the maximum you must vote on at least 10 questions. You can earn a maximum of 200 reputation per day. Please note that votes for posts marked “community wiki” do not generate any reputation, while accepted answers and bounty awards are not subject to the daily reputation limit.

The other way to gain reputation is by suggesting edits to existing posts as a new registered user. Each edit will be peer reviewed, and if it is accepted, you will earn +2 reputation. You can only earn a maximum of +1000 total reputation through suggested edits, however.

15 Vote up
15 Flag for moderator attention
50 Leave comments
100 Edit community wiki posts
125 Vote down (costs 1 rep on answers)
200 Reduced advertising
250 Vote to close, reopen, or migrate your questions
300 Create new tags
500 Retag questions
1000 Show total up and down vote counts
2000 Edit other people’s posts, vote to approve or reject suggested edits
3000 Vote to close, reopen, or migrate any questions
5000 Vote to approve or reject suggested tag wiki edits
10000 Vote to delete closed questions, access to moderation tools
15000 Protect questions to prevent answers by new users
20000 Vote to delete negatively voted answers and stronger question deletion votes

Further Details can be found at the GIS SE FAQ

 

GIS Blog Launched

by mapperz. 4 comments

Welcome to the New GIS Blog Overflow, a new additional to GIS Stack Exchange Community

New content will be coming soon from community members from the GIS Stack Exchange.

Popular & reoccurring topics on GIS.SE, events related to GIS and the GIS.SE community with a random collection of posts by different authors will give a good wide cross-section of articles.

  • Popular questions will be also expanded.
  • Commercial and Open Source related GIS posts (includes beta software) are welcomed.
  • Community GIS News and Events will also be included
Potential Blog Author?
If you have a post that you would like to be included please contact the moderator (Mapperz) by leaving a comment on this post.
Many thanks to the community users input who have made this blog possible

http://meta.gis.stackexchange.com/questions/591/gis-stackexchange-blog