Hello there, here's a question I've looked for on this forum but surprisingly I could not find an answer, so maybe my approach or assumptions aren't right. I've recently imported an osm-file into postgresql for the purpose of geocoding. using the planet_osm_line table I could extract the street names of a particular city. However the lines table contains multiple way-segments/records for one street. I can join the segments into a single line but that does not work in all cases. Is there a way to extract the "real" CenterPoint of a street ? I've created a recusive function to create a table with all connected segments like this: CREATE OR REPLACE FUNCTION public.connectedways ( main_id bigint ) RETURNS SETOF public.planet_osm_line AS $body$ BEGIN Insert into connected Select osm_id,name,way from planet_osm_line where osm_id = main_id;Using the result table I merge all geometry to a single line and use st_line_interpolate_point(way, 0.5) to get the centerpoint ; SELECT ST_AsEWKT(ST_Line_Interpolate_Point(st_makeline(way), 0.50)) from connected;Using this method it works but the results are not correct??? asked 16 Apr '15, 12:46 Eric Bossink SimonPoole ♦ |