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 Answer
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.