[Tile-serving] [osm2pgsql-dev/osm2pgsql] [flex output] Get the first node and last node of a linestring using lua, and insert into as a point in the database (Discussion #2091)
Julien Fastré
notifications at github.com
Tue Oct 10 12:48:25 UTC 2023
First, thanks for developing flex, this is a pleasure to use it.
This is our use case: we are developing a spatial analysis which will compute the distance between different points on the same level (a platform in a station). We would like to know, for instance, the distance between the steps and a `railway=platform_marker` node.
For this, we summary every object on the train's platform on a point geometry.
This is very easy with elevator, which, for instance, are already a point.
For steps, we are currently using the centroid of the linestring. But, for accuracy, we would like to take the step where it does reach the platform level. Steps are a linestring. So, for this, we have to analyze the first and the last node of the linestring, and the content of the `level=*` key to know if it is going up or down. This will create two points in the table: one with the step's start and the corresponding level, and another with the step's end and the corresponding level. Later in the database, our queries will do a processing to compare the platform's level with the step's one.
So, it would be nice to be able to extract the first and last from a linestring, and be able to create a "geometry" from that.
Thanks.
--
Reply to this email directly or view it on GitHub:
https://github.com/osm2pgsql-dev/osm2pgsql/discussions/2091
You are receiving this because you are subscribed to this thread.
Message ID: <osm2pgsql-dev/osm2pgsql/repo-discussions/2091 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20231010/ee27fc49/attachment.htm>
More information about the Tile-serving
mailing list