2

I have two datasets, one is a GeoJSON of a highway with around 1509 linestrings. The other is a list of incidents that have occurred along said highway, but, instead of coordinates, the file specifies the kilometer where the incident happended. I.e

incident_id km incident_type
1 10 vehicle theft
2 152 dui

What I need to do is get the coordinates of each incident.

I know that you can calculate the distance between two coordinates using geopy.distance, but is there any way to calculate the coordinates of a point which is x kilometers away from a given set of coordinates?

2
  • 1
    II can't help with the Python code but be aware that in Qgis there a process under Vector Analysis called "Points along Geometry". You could perhaps try this or look at the underlying code. It is for generating many points at specified distances along a feature but the first point should suffice for your needs. You need to be sure that the starting point corresponds to your "0 km" or you could use the "offset" option. – Leigh Bettenay Feb 14 at 0:05
  • I can't see why this is closed. It is a straightforward, single question that relates to spatial location. – Leigh Bettenay Feb 14 at 23:25

Browse other questions tagged or ask your own question.