Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.9K Views
|
9 Replies
|
8 Total Likes
View groups...
Share
Share this post:

Map places of interest in a city

Posted 10 years ago

Can you give me a coding example of how to use GeoGraphics to map museums (and other place of interests) in metropolitan area (e.g., New York City)?

POSTED BY: James Smith
9 Replies

Hi,

there is the new ServiceConnect option for Factual, which you might want to try.

factual = ServiceConnect["Factual"];
results = factual["PlacesDataset", {"Location" -> Entity["City", {"NewYork", "NewYork", "UnitedStates"}], "Radius" -> Quantity[10, "Miles"], "Sort" -> "Distance", "Query" -> "museum"}];
GeoListPlot[Tooltip[#["Location"], Column[{#["Name"], #["HourDisplay"]}]] & /@ results, GeoRangePadding -> Quantity[500, "Yards"]]

This will give you:

enter image description here

The opening hours etc come up if you hover with the mouse over the points. In all fairness this is code from the Documentation of ServiceConnect - only slightly modified to fit your request for NewYork.

Cheers,

M.

POSTED BY: Marco Thiel
POSTED BY: Marco Thiel

Hi,

GeoListPlot and GeoGraphics etc are all quite easy to use. Here is a version with GeoGraphics:

factual = ServiceConnect["Factual"];
results = 
 factual["PlacesDataset", {"Location" -> Entity["City", {"NewYork", "NewYork", "UnitedStates"}], "Radius" -> Quantity[10, "Miles"], "Sort" -> "Distance",  "Query" -> "museum"}]; 
GeoGraphics[GeoMarker /@ Normal[results][[All, 2]], GeoRangePadding -> Quantity[500, "Yards"]]

enter image description here

Cheers,

M.

POSTED BY: Marco Thiel

Hi James,

this is a useful link to a developers page on Factual. You will see that there is an incredibly detailed list of POIs. This here gives you a useful table:

Import["http://developer.factual.com/working-with-categories/index.html", "Data"][[1, 2, 6, 2 ;;]] // TableForm

On this website you will find (under Geographic Entities) what the Wolfram Language has built in.

Particularly for Factual it can be easy to loose track of what the categories are. The following might help.

searchtree = 
  StringSplit[#, ">"] & /@ 
   Import["http://developer.factual.com/working-with-categories/index.\
html", "Data"][[1, 2, 6, 2 ;;]][[All, 2]];
searchtreeclean = 
  Table[If[StringTake[#, -1] == " ", StringDrop[#, -1], #] & /@ 
    searchtree[[k]], {k, 2, Length[searchtree]}];
GraphPlot[
 DeleteCases[
  Join[(*DeleteDuplicates["Area"\[Rule] #&/@searchtreeclean[[All,
   1]]],*)DeleteDuplicates[
    If[Length[#] > 1, #[[1]] -> #[[2]]] & /@ searchtreeclean], 
   DeleteDuplicates[
    If[Length[#] > 2, #[[2]] -> #[[3]]] & /@ searchtreeclean], 
   DeleteDuplicates[
    If[Length[#] > 3, #[[3]] -> #[[4]]] & /@ searchtreeclean]], Null],
  VertexLabeling -> Tooltip]

enter image description here

I hope that this helps.

Cheers,

Marco

POSTED BY: Marco Thiel
Posted 10 years ago

Hi Marco,

As you showed me earlier, when using an outside knowledge source like Factual: I can use the data to get a map so that when I hover over icon I get address, phone # or whatever. (not sure I can do that with Wolfram knowledge base) But here is my main question: How do I copy or export the Map I create to another document so that the icon features are retained, i.e., hovering properties?

POSTED BY: James Smith
Posted 10 years ago

Many thanks again, Marco!

POSTED BY: James Smith
Posted 10 years ago

Thank you for taking the time to educate me on these things, Marco! I wonder if there is a list somewhere of which icons are available to search for using either Wolfram or Factual.

POSTED BY: James Smith
Posted 10 years ago

Terrific--thanks. I'm new to Wolfram and did not know about Factual. I suppose it is the most convenient way of getting the most up-to-date info on city/country icons such as restaurants, museums, etc., from the Wolfram knowledge data base?

POSTED BY: James Smith
Posted 10 years ago

Thanks--that definitely helps and is another path I hadn't thought of (I really like the hovering feature too). I would still like to find a way with GeoGraphics since I want to generalize to other projects I have in mind from there.

POSTED BY: James Smith
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard