Wolfram Language

Computational Photography

Suggest a Museum to Visit

By geo analyzing metadata from a collection of touristic photos, make suggestions about other points of interests in the same area, for example, a museum.

In[1]:=
Click for copyable input
files = Map[img \[Function] ExampleData[img, "FilePath"], ExampleData[{"TestImageSet", "Oxford2011"}]]; geopos = Map[file \[Function] Import[file, "GeoPosition"], files];

Compute the centroid of the locations where pictures were taken.

In[2]:=
Click for copyable input
geodata = GeoPosition[{Mean@geopos[[ All, 1, 1]], Mean@geopos[[All, 1, 2]], Mean@Cases[geopos, GeoPosition[{_, _, h_}] :> h]}]
Out[2]=

Find the closest museum.

In[3]:=
Click for copyable input
entMus = Quiet[First@GeoNearest["Museum", geodata]];
In[4]:=
Click for copyable input
geoMus = Quiet[FindGeoLocation@entMus];

Fetch and typeset information about this museum.

In[5]:=
Click for copyable input
mus = EntityValue[entMus, EntityProperty["Museum", "Name"]]; type = EntityValue[entMus, EntityProperty["Museum", "MuseumTypes"]]; about = WikipediaData[mus, "SummaryPlaintext"]; description = TextGrid[{ {Style["MUSEUM TO VISIT", 15], SpanFromLeft}, {Style["Name:", Bold], mus}, {Style["Types:", Bold], StringTake[ToString[type], {2, -2}]}, {Style["About:", Bold], about} }, ItemSize -> {{4, 30}, Automatic}]
Out[5]=

Visualize this museum's information as a tooltip on a map of the surroundings.

In[6]:=
Click for copyable input
tooltip = Tooltip[GeoMarker[geoMus, Entity["Icon", "Museum"]], description];
In[7]:=
Click for copyable input
GeoGraphics[{Thick, Red, GeoDisk[geodata, Quantity[1000, "Meters"]], tooltip}, "GeoRange" -> 1500, ImageSize -> Medium]
Out[7]=

Related Examples

de es fr ja ko pt-br ru zh