ThinkGeo.com    |     Documentation    |     Premium Support

Driving time polygons

Hi,


I need to draw over Google map (or Yahoo, VE, ...) polygons that represent the area reachable in a specific amount of time starting from a specific point.


For example, I choose the center of Milan in Italy, I specify a first driving time of 10 minutes and a second of 20 minutes, I select the mean of transport and as result I need to obtain 2 polygons to draw over the map with different colours.


Do you have any idea on how to do this with Map Suite Web 3.0 or using some plugin?


Thanks in advance


Fabio



Fabio, 



So I think what you want is to add 2 polygons with different colors on Google Map, Here is what you need to do. 

1, You need 2 Overlays, one is for GoogleMap as the background, the other is a LayerOverlay which includes a InMemoryFeatureLayer with the 2 polygons. 

2, To display the LayerOverlay over GoogleMap, we need to set the Projection info for the InMemoryFeatureLayer, here is the codes how to do it. 


Proj4Projection proj4 = new Proj4Projection(); 
// 4326 is the EPSG of the Decimal Degree 
proj4.InternalProjectionParametersString = Proj4Projection.GetEsriParametersString(4326); 
proj4.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); 
layer.FeatureSource.Projection = proj4; 

3, To render the 2 polygon differently, we need to set a codition column for the inMemoryFeatureLayer and use the ValueStyle to render it. 


// Add the column to the layer 

layer.Columns.Add(new FeatureSourceColumn("Color"));
 
// Add the corresponding value for the column for each feature 
feature.ColumnValues.Add("Color", "Red"); 



Hope that helps. 



Thanks, 



Ben



Sorry, 
 maybe my post is not clear. Starting from a specific point and giving a driving time specified by the user, I need to calculate and show all the locations reachable in this time. 
  
 Hope I clarify my need. 
  
 Thanks 
 Fabio 


Fabio, 
  
 Sorry for misunderstanding, but still I’m not very sure about your requirement. Let’s say I choose the center of Milan in Italy, and the user specify a driving time of 10 minutes, how can we get the reachable polygon in that 10 minutes? One simple way is to create a circle that takes Milan as the center and takes let’s say 10 miles as the radius, and display that circle on the map. That’s not an accurate reachable area though and as you mentioned Polygon, I thought you have your own better algorithm to get that area yourself. That’s why I focused on how to display/render a polygon on Google Map in my last reply.  
  
 So still, could you let me know how to get the reachable polygon or just use a circle instead?  You can try the codes in my last reply to draw a polygon/ellipse on the map. 
  
 Any more queries just let us know. 
  
 Thanks, 
  
 Ben

Hi Ben,


the result I want to obtain is the one you can view in the attachment, circles are not the correct solution for me.


The problem is that I don't have the algorithm to calculate the area coverable in a specific amount of time, so I'm interested in suggestions or functionalities that MapSuite Web could provide to solve my trouble.


Thanks in advance


Fabio



641-drivingtime.zip (90.7 KB)

Fabio, 
  
 I see what you want, that’s an interesting idea.We don’t implement it now and I will add it to our traking system to see if we can do it in some future version. Thanks for pointing it out! 
  
 Ben