Get the LatLon of middle points of a road segment?

Suppose I have the LatLon of the two end points as well as a small number of middle points of a road segment.

What is the best way to calculate the LatLon of a middle point P of the road segment given the road distance between P and one end point of the road segment?

-
What GIS software product are you using? – artwork21 Jun 4 '12 at 11:27
i am not using any. i ask this question because I want to implement this function by myself. – user1101148 Jun 4 '12 at 13:56
Because you want to implement this yourself, you need to be more specific about the use cases. Is this a one-off calculation, or do you anticipate re-using the same segment for many such calculations? How far apart might the endpoints be (just a few kilometers or potentially thousands of kilometers)? How accurate does the solution need to be? How do you intend to specify the input (designating the relevant segment endpoint is slightly problematic for many GISes)? What is the relevance (if any) of having the "small number of middle points" available? – whuber Jun 4 '12 at 20:56
Would interpolate be more descriptive than find middle points? – Kirk Kuykendall Jun 4 '12 at 21:26
@whuber I wonder if there is a general algorithm for this sort of calculation if parameterize the factions you mention – user1101148 Jun 5 '12 at 14:48

You could try @underdark comment here, or use the following ESRI/ET Geowizard tool combinations.

ArcGIS/ET-Geowizard

1. Run Polyline to Point tool using ET-Geowizard, check 'Middle Points' option.
2. Run Add XY Coordinates tool within ArcGIS/ArcToolbox.

1. Run Feature Vertices to Points tool, select 'MID' as point type.
2. Run Add XY Coordinates tool within ArcGIS/ArcToolbox.
-
i am not looking for operations of a software; i'm interested in general algorithms – user1101148 Jun 5 '12 at 14:04

Linear referencing is the key term to describe the suite of algorithms to do what you want to do. If you want to inspect the source code to the algorithms, check out GEOS (e.g., geos::linearref::LengthIndexedLine Class), or JTS (e.g., com.vividsolutions.jts.linearref).

If you are working with Lat/Long data, you will need to project this to something with sane linear units, like UTM with units of metres. After you interpolate a point (say 10 km from your start point), then you can transform that point back to Lat/Long.

If you are into Python, I'd recommend looking into GDAL/OGR/OSR for vector projection from Lat/Long to UTM, and Shapely (which uses GEOS) for the simple linear referencing methods (pay particular attention to these examples).

-

you can create a vertex in given distance then calculate Latlong of the vertex.

-
the reference you gave seems do not give details about calculation but only simple description on ArcGis – user1101148 Jun 4 '12 at 13:55