For my vector map I'd love to display highways at a quite early zoom level. The problem is that this data would be quite big, so I thought I simply ST_Simplify it. The problem though is that the OSM data consists of a lot of small road segments. So for Germany f.e. there are roughly 60000 segments of type highway.

Does anybody have an idea on how to better simplify the data? I was thinking of creating longer polylines by combining the small ones and then ST_Simplify-ing those?!?

The problem is just that I don't know how I should do that...

I could do a ST_Union on all of my roads, but that would create ONE geometry. So maybe group them somehow. There are relations in OSM, but I don't think that there is an easy query for "Give my only highway", right?

As a bonus, if would be awesome to have only a line in one direction, as for my zoom-level the two lines would look as one anyway.

  • why don't you think "that there is an easy query for "Give my only highway", right?"? doesn't your highway have a name or id? – Ian Turton Jul 10 at 16:39
  • I was refering to the relations. From the data I had a look at, it seems that highway relations are not really properly tagged in OSM. – Georg Jul 10 at 18:28
  • Ignore relations, they won't help for your case. Relations are used in OSM to express specific routes, you are not looking for routes though. How about combining roads that share the same name and the same ref, if available? However note that roads can split while still keeping the same name (e.g. if there are separate roads for each direction, or at a roundabout, or ramps for motorways). So this won't work for all cases. – scai Jul 23 at 7:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.