Shp-to-osm.jar

Imports and automated edits should only be carried out by those with experience and understanding of the way the OpenStreetMap community creates maps, and only with careful planning and consultation with the local community. See Import/Guidelines and Automated Edits code of conduct for more information. Imports/automated edits which do not follow these guidelines might be reverted!

In the example above, "TYPE_TEXT" is listed as the heading in row one of the .dbf file,
and "Canal" is listed as one of the options in rows 2 to however many there are.
and the OSM Key, that we use for "TYPE_TEXT" is "waterway" and the OSM Value that we use for "Canal" is "canal".

Please note that attributes in Shapefiles are case sensitive and the rules.txt needs to match the case of the DBF columns.

Sample rule sets:

Glomming

As of shp-to-osm 0.7, the applications supports what the author calls "glomming": the ability to connect ways that share some key/value pair. The command line argument --glomKey specifies a single OSM tag name that should be used when checking for matches. It is important to note that the glom key is an OSM tag name, not a shapefile attribute name. The tag must be created by your rulesfile or it won't be useable as a glomming key.

For example, if my shapefile has a large river system where each segment of river is split at the point where rivers come together, then we can use glomming to connect the ways of rivers that share similar name (or in the case of NHD data, reachcode) values.

Compiling shp-to-osm

(tried on Ubuntu Jaunty and Karmic as well as Windows XP)

Maven is used to download dependencies. Eclipse has a Maven plugin that will download the required JARs and setup the project for you: