Using PostgreSQL/PostGIS, given a point position I need extract the nearest linestring from a db table and update the founded geometry adding the given point based on the point position.
For these purposes the PostGIS function ST_AddPoint
can be used, but, as far as this function requires the index position to assign to the new point I want to add, I would need to get the maximum index of the two nodes of the nearest segment of the linestring but it seams not so easy to me.
Question posted in PostgreSQL
The official documentation can be found here.
The official documentation can be found here.
2
Answers
After a few attempt this is the solution a found:
You can add a point that is / is almost on a line using
st_snap
and a small tolerance