How to get all points along a way from (osm)PostGIS?

眉间皱痕 提交于 2019-12-25 15:50:13

问题


I have import OpenstreetMap data into Postgres with gis extension with tool osm2pgsql (-s option)

of course, I have the following tables

planet_osm_point
planet_osm_ways
....

Within planet_osm_ways I have a column called way, type geometry(LineString, 4326), content like following

"0102000020E6100000070000005E70BCF1A49F2540D3D226987B134840896764EB749F25403B5DCC858013484040D1860D609F2540C426327381134840CE50DCF1269F2540EF552B137E1348405AAB2CC02D9E2540F978324976134840D66F26A60B9D2540CE8877256E1348403CA81F2FFF9C2540BC1D86FB6D134840"

What is that ? How could I get all points along this way ?

Thanks a lot


回答1:


That's hex-encoded extended well-known binary (EWKB) of a LINESTRING.

There are several methods to get the points along the way. To get individual coordinates as points, use ST_DumpPoints. Or to simply output the geometry in other human-readable formats (WKT, EWKT, GeoJSON, GML, etc.), see the relevant manual section.



来源:https://stackoverflow.com/questions/32050986/how-to-get-all-points-along-a-way-from-osmpostgis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!