Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

share|improve this question
    
What GIS software product are you using? –  artwork21 Jun 4 '12 at 11:27
1  
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
show 3 more comments

3 Answers

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.

ArcGIS (ArcInfo license)

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

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).

share|improve this answer
add comment

see Linear Referencing

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

share|improve this answer
2  
the reference you gave seems do not give details about calculation but only simple description on ArcGis –  user1101148 Jun 4 '12 at 13:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.