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 try to create an application for taxis. The application will be GMap based.

On the map will be marked the region in which the taxi driver is working in.

The region will be a polygon designed by the application owner.

Also the client charge will be based on kilometer.

The end user can define the departure and destination points on the map. In case that both locations are inside the region all are fine.

In case the destination point is outside the region, the client must be charged in double rate for the kilometers outside the region.

What I like to ask is the following:

  • Is there a way to know what is the distance from the point inside the region until the region border?
  • And what is the distance from the point outside the region until the region border?

To be more specific, I attach an image here:

enter image description here

What I need is to get the distance from departure location to the border of the region (the yellow circle) and from yellow circle to the destination location.

I know that this is very complex, but I don't even know if is possible.

Can somebody to help me with that problem ?

share|improve this question
1  
You need a spatial database (like postgres/postgis) backend for this solution. –  Mapperz Nov 27 '12 at 14:51
    
This will be a WordPress plugin, so I can have a database access to write data. Can you please brovide me with any further information on how to implement the distance calculation in Google Maps, from starting point to the borders and from destination point to the borders too ? –  Merianos Nikos Nov 27 '12 at 14:55
1  

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.