Streets in Openstreetmap have more detail than I need. For instance, I do not need separate street tracks for each driving direction; instead I just want to show the general path of the street. Example:

OSM linestrings for a street

OSM linestrings for a street


Simpified linestring(s) (here it is just one, but in case of sidearms would be > 1)

input:  collection of linestrings
output: collection of linestrings 
simplified lines = f(osm lines)
f = ?

the output is a collection as well, since sidearms should remain available.

How do I programmatically simplify such linestring collections?

Would like to use JTS, NTS, GEOS but not PostGIS if possible.

2 Answers 2


Hard to imagine how you can reach what you want automatically. Perhaps by deleting one of the oneway tagged streets if there exist two of them with the same name and close enough?

Often used workflow starts from unioned linestrings followed by buffering and skeletonizing. This PhD thesis is good reading http://paduaresearch.cab.unipd.it/4077/1/Tesi-Savino-2011.pdf I also tried the workflow with OpenJUMP 1.7.0 and the Skeletonizer plugin http://kent.dl.sourceforge.net/project/jump-pilot/OpenJUMP_plugins/More%20Plugins/JUMP%20Skeletonizer%20Plugin/skeletonizer-1.0.zip The plugin works but the result is one long street, not a reduced number of short ones. I found it necessary to read the manual before using the plugin. It is inside the zip in the doc folder.

  • Thank you, this is the direction I thought about. Looks like it is as difficult as I feared, full automation is pretty much a requirement. Interesting readings - would not have found on my own, thx.
    – citykid
    May 28, 2014 at 14:24

There is an ST_Simplify function in postgis v. 2.0 that should suit your purposes. Basically it has a spatial tolerance where if a feature is within some distance of another feature, then it will merge both features into a single feature. The syntax is as follows.

ST_Simplify(geometry geomA, float tolerance);
  • 2
    No, that is a different story. The Douglas-Peuker algorithm provided by ST_Simplify simplifies lines. I do not want to simplify the various linestrings. I want to remove some of them, simplify maybe some of them while keeping others as they are. I expected this algorithm to come up, since it is frequently used when "simplification" is asked for, but I do not see how it helps in my case where a collection of line strings makes up the street. Also ST_Simplify acceepts an argument of type geometry, whereas streets are a collection of line strings.
    – citykid
    May 28, 2014 at 12:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.