Message Boards Message Boards

1
|
34039 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Annotation in GeoGraphics?

Hello guys,

Just to know if anyone here has used Annotation[] together with GeoGraphics[]?

I'm trying to insert information (weight type) into Points in GeoGraphics[] and here are some attempts that worked (just a simple example):

{GeoGraphics[{Annotation[Point[GeoPosition[{10, 200}]], {2, 4, 6}, 
    "Mouse"], 
   Annotation[Point[GeoPosition[{10.1, 200}]], {3, 5, 7}, "Mouse"]}], 
 Dynamic[MouseAnnotation[]]}

im1

But that way (above) it only happens with Dynamic[]..

Below, I managed to insert MetaInformation[], but I don't know if it is very good to retrieve the information in a computable way:

b=GeoGraphics[{Point[GeoPosition[{10, 200}]], 
  Point[GeoPosition[{10.1, 200}]]}, 
 MetaInformation -> <|Point[GeoPosition[{10, 200}]] -> {2, 4, 6}, 
   Point[GeoPosition[{10.1, 200}]] -> {3, 5, 7}|>];

AbsoluteOptions[b, MetaInformation]

im2

What I'm looking for is a way to add data internally at each Point and access the internal data for each Point for later use. Any idea?

Thanks,

Claudio Chaib

POSTED BY: Claudio Chaib
2 Replies

You can extract information using patterns:

gr = GeoGraphics[{Annotation[Point[GeoPosition[{10, 200}]], {2, 4, 6},
      "Mouse"], 
    Annotation[Point[GeoPosition[{10.1, 200}]], {3, 5, 7}, 
     "Mouse"]}];
Cases[gr, Annotation[pt_Point, info_, ___] :> {pt, info}, All]
POSTED BY: Gianluca Gorni

Hummm.. interesting and very useful! Thank you, Gianluca!

Claudio Chaib

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

Group Abstract Group Abstract