Wolfram Language

Knowledgebase Expansion

Generate a Walking Tour of Notable Buildings

Use GeoNearest to retrieve notable buildings in a radius of 1 km around Boston City Hall.

In[1]:=
Click for copyable input
position = Entity["Building", "BostonCityHall::96t3t"]; radius = Quantity[1, "Kilometers"];
In[2]:=
Click for copyable input
nearMe = GeoNearest["Building", position, {All, radius}]
Out[2]=

Plot those buildings on a local map, using built-in icon entities.

show complete Wolfram Language input
In[3]:=
Click for copyable input
iconItemPairs = With[{icon = EntityValue[Entity["Icon", "Museum"], "Image"][[1]]}, MapThread[{#1, Graphics[{EdgeForm[Black], FaceForm[#2], icon}, "ImageSize" -> 25]} &, {nearMe, RandomColor[Length@nearMe]}] ]; legend = Column[ Row[Reverse@#] & /@ (MapAt[CommonName, #, 1] & /@ iconItemPairs)]; Row[{ GeoGraphics[{EdgeForm[Darker[Orange]], Orange, GeoDisk[position, radius], GeoMarker[position, "Color" -> Red], GeoMarker @@@ iconItemPairs}, ImageSize -> 400], legend }]
Out[3]=

Use TravelDirections to compute a walking tour of those entities.

In[4]:=
Click for copyable input
tourPlaces = Prepend[nearMe, position];
In[5]:=
Click for copyable input
{distance, tourPath} = FindShortestTour[GeoPosition /@ tourPlaces, 1, Length@tourPlaces]
Out[5]=
In[6]:=
Click for copyable input
travelDirectionsForPath = TravelDirections[tourPlaces[[tourPath]], TravelMethod -> "Walking"]
Out[6]=
show complete Wolfram Language input
In[7]:=
Click for copyable input
Row[{ GeoGraphics[{ Thickness[0.01], Darker@Red, GeoPath@travelDirectionsForPath, EdgeForm[Darker[Orange]], Orange, GeoDisk[position, radius], GeoMarker[position, "Color" -> Red], GeoMarker @@@ iconItemPairs }, ImageSize -> 400], legend }]
Out[7]=

These are detailed instructions on how to follow that path.

In[8]:=
Click for copyable input
travelDirectionsForPath["ManeuverGrid"]
Out[8]=

Related Examples

de es fr ja ko pt-br ru zh