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.

enter image description here

I have few points from server and I want to draw a line with this point on road. But the leaflet drawing point to point line as shown in picture in orange color. But I want to draw the line according to the blue line. How it can be done?

Thanks

share|improve this question
2  
From your illustration it looks like you don't have any point in the crossing. Then, how can you expect the line to go there? –  Nicklas Avén Apr 3 '13 at 10:25
    
This is the issue.... –  Devils Dream Apr 3 '13 at 10:31
    
well, then your question is about how to get the point in the road crossing, right? Then, what is your problem? Is it to find out the coordinates of the road-crossing, or is it how to get that coordinates into the linestring in PostGIS? –  Nicklas Avén Apr 3 '13 at 10:35
    
Why don't you just get the lines from the server? –  alexgleith Apr 8 '13 at 4:46

2 Answers 2

pgRouting could be a solution (Official website), are you tried it as PostgreSQL extension?, it could do the trick... But, you needs a good vectorial layer "road".

It's only a idea... :)

share|improve this answer

If you know all of your roads are pure N/S and E/W you could use the two points on either side of the intersection to come up with the intermediate point. In other words, if the last point before the turn is X1,Y1 and the point after the turn is X2,Y2, you could insert a point X1,Y2 which would be the intersection. Of course, this only works if you have all right angles in your routes and they are all completely N/S or E/W. Another option which could work or straight lines without requiring N/S and E/W routes would be to find a line for each route and then find the intersection. You would need a second point on the route after the turn though. Otherwise, you simply do not have the data for the point.

share|improve this answer

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.