Exporting to Adobe Illustrator
From OpenStreetMap
The osm2ai.pl script takes OpenStreetMap data and produces an unstyled Adobe Illustrator file (.ai). You can then work on this in Illustrator to produce a finished map.
Given a bounding box, the script takes all the ways that pass through that area, and draws them (in a Mercator projection). Ways are grouped in Illustrator layers according to their tags. By editing the script, you can determine which tags go to which layers.
Contents |
What you'll need
- The osm2ai.pl script ([1])
- Perl and the Geo::Coordinates::OSGB module (plus a few others you almost certainly have already)
- Either:
- (for small areas) an .osm file covering the area you want
- (for large areas) an OpenStreetMap SQL database running on your own machine - typically, a MySQL database created from planet.osm by planetosm-to-db.pl or similar
Using the script
perldoc osm2ai.pl for instructions.
The output
The resulting Illustrator file is version 6 (which will still open in any modern version).
The file is wholly unstyled and unlabelled: the idea is that you make the cartographic styling decisions yourself. However, to help you, the tags (keys/values) are brought through into the file, so that you can see (for example) the name of the road. The keys/values are stored as a 'comment'. To view these (in Illustrator CS), open the Attributes palette to its fullest extent.
Each way is rendered as a single Illustrator path.
Future plans
- Move to the 'Export' tab
- Add constant scaling etc.


