0

So I'm using a osm2pgsql schema. When I get a road, the points in the linestring don't have an order, so when I try to draw the road, it won't follow the road but will be a bunch of lines. Do I have to do the ordering myself? If so hhow? How do I order the points so they follow the road.

1
  • Please tell more about your usecase. AFAIK the order of linesegments isn't important for rendering?
    – Mapper
    Commented Sep 19, 2015 at 18:49

1 Answer 1

1

If by road, you mean an OpenStreetMap way, the coordinates in the linestring are ordered.

If by road, you mean something else, the answer is, it depends. For many purposes like rendering, the order doesn't matter. If you need to merge multiple linestrings, the technique is called glomming and would need to be done with PostGIS functions.

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.