Message Boards Message Boards

0
|
2755 Views
|
3 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Cloud: GeoGraphic only showing map of Champaign

Posted 10 years ago

Anytime I create a GeoGraphic it is only showing a map of Champaign and I cannot get anything to show a map of my current location?

Any examples of what should work, then I can try it out and ensure it does, or if it might be a permissions problem on my computer forcing it to default to Champaign.

thanks!

--mark

POSTED BY: mark spivey
3 Replies

It will default to the location of the computer on which the Mathematica Kernel is running, if that can be figured out.

The symbol (dollar sign)GeoLocation can be set to your latitude and longitude. For example,

$GeoLocation = {37.76 , -122.4 } ; 

can be added at the top of your Mathematica notebook or in the Kernel's init.m file
(in the Kernel/init.m file under the base directory or userbase directory, as given in
http://reference.wolfram.com/mathematica/tutorial/ConfigurationFiles.html ).

$GeoLocation = {37.76, -122.4}; GeoGraphics[]

gives a map of San Francisco (in Wolfram Programming Cloud).

line of code and map of S.F. area

POSTED BY: Bruce Miller

Setting the GeoLocation does help. I noticed that there is a difference whether one write

== current geoIP location

or

= current geoIP location

in the cloud. The first one does give the correct location. Is it possible to use that somehow. I tried to use direct commands such as:

WolframAlpha["current location", {{"IPAddress", 1}, "ComputableData"}][[1, 2]]

that work locally but not in the Cloud. But the fact that the double == sign gives the "outside" IP geo-location might be useful. Can that be used somehow?

I even tried to import the wolfram alpha website directly

Import["http://www.wolframalpha.com/input/?i=current+location"]

but that does not seem to work in the Cloud either. It would be nice if this would work without "hard-coding" it. Having said that, it seems that this is only an issue before (!) deploying it. This command

CloudDeploy[GeoGraphics[Here]]

generates a website which uses the correct location.

M.

POSTED BY: Marco Thiel

That is interesting. Are you talking about the Wolfram Cloud?

Note that you get different outputs depending on how you ask for your current location:

== current geoIP location

, i.e. using the double equal sign, gives you your correct IP address. This does work in the Wolfram Programming Cloud.

= current geoIP location 

gives the IP address a server that Wolfram Alpha believes is registered to Amazon, see:

http://www.wolframalpha.com/input/?i=+54.209.144.183

GeoGraphics[]

indeed gives a map of Champaign.

FindGeoLocation[]

in the Cloud gives

GeoPosition[{40.11,-88.24}]

which is Champain, I presume. On the RaspberryPi it does work as expected. Perhaps it is worth reporting that to the developers?

M.

POSTED BY: Marco Thiel
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