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.

I'm new to GIS programming and I'm using OpenLayers for my GIS project. I want to know how to draw a linear map programmatically between two locations from a real geographical map (may be OpenLayers). I think there should be a projected coordinate system for this. Is there any distance mapping algorithm to accomplish this task?

I do not mean adding a vector layer to an existing map. I want create a separate line map looking at a real geo map (Obviously a path connecting two locations).

Original map

original map

Linear map

linear map

share|improve this question
5  
what you mean by linear map? A vector layer of type Line –  rashad Jan 10 '13 at 10:57
    
do you mean map where line is draw with heigth(y) and length(x) ? –  simplexio Jan 14 '13 at 7:28
    
Actually I can't understand the line heigth(y) and length(x). If it is geodesic line on map, that's not what I need. –  rajitha Jan 15 '13 at 8:47
    
you want to find the (x,y) at a specific distance between two geographic points? did you mean linear referencing? –  vinayan Jan 15 '13 at 10:41
1  
or you simply want to plot a striaght line on the map between two points? –  vinayan Jan 15 '13 at 11:03
show 1 more comment

2 Answers

I know that asking the questions is easier than read documentation and evaluate examples. Try to read source of http://openlayers.org/dev/examples/vector-features.html first. For futere read http://openlayers.org/dev/examples/ with 'vector' keyword first and books recommended on http://openlayers.org page: 'OpenLayers 2.10 Beginner's Guide' by Erik Hazzard and 'OpenLayers Cookbook' by Antonio Santiago Perez.

Regards

share|improve this answer
add comment
up vote 0 down vote accepted

I found a solution using Douglous Peuker algorithm which can be used to reduce the number of vertices with a tolerance factor and generate a simple linear map while maintaining network topology. PostGIS ST_Simplify function has been implemented on top of this algorithm. There 's also an OpenLayers implementation of this.

share|improve this answer
    
can you share the code?. Also the openlayer method? –  Roy M J Oct 25 '13 at 9:18
1  
For OpenLayers, please refer dev.openlayers.org/releases/OpenLayers-2.13.1/examples/… You can change Tolerance factor as necessary to adjust your simplification level. There 're some PHP implementations also. phpriot.com/articles/… –  rajitha Oct 26 '13 at 14:33
1  
Also check loughrigg.org/rdp –  rajitha Oct 26 '13 at 14:39
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.