Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Put yourself on the Map -- correction

by jens (Pilgrim)
on Aug 20, 2002 at 02:00 UTC ( [id://191366]=monkdiscuss: print w/replies, xml ) Need Help??

I've attempted to follow instructions to Put my self on the Perl Monks Map by using www.MapBlast.com to give me my latitude and longitude.

However, contrary to the normally very helpful instructions to be found, this information is incorrect--there is no latitude or longitude available in the top left hand corner of the mapblast site.

--jens

Instructions are currently listed:

What to do: Find out your Latitude and Longitude Put the correct HTML comment in your homenode Check the significant update box Wait a day for the stats site to parse the page Go have a look Find out : If you're not sure of your latitude and longitude, use MapBlast to locate yourself. It's a pretty decent interface, and you can get near yourself by starting with your ZipCode, or select your country if your non-U.S. *** Be sure to click the lat/long display in the upper left corner of the map to display the correct format lat/long. *** The correct format will have a small degree symbol to the right of the first number in both the latitude and longitude.

Considered by jdporter - Edit the phrase 'Put my self on the Perl Monks Map' to be a link to id://37653. Also MapBlast could be linkifi
(2005-01-02) Unconsidered by castaway: Keep/Edit/Delete: 8/19/0 - We don't do that, folks.

Replies are listed 'Best First'.
Re: Put yourself on the Map -- correction
by theorbtwo (Prior) on Aug 20, 2002 at 02:37 UTC

    You're right, jens, it isn't there any more. The instructions were correct when I found the lat/long for my address some time ago, but it seems they changed their UI.

    You can still get the data from mapblast, though. Fill in your address, and get the map, then zoom at least once so all the CGI parameters will get filled in. Then look for the CT parameter in the URL (it's a GET form, so it's easy to read). Mine reads &CT=40.0706471%3A-76.314855%3A20000, which makes my latutide 40.0706471 degrees N, by 76.314855 degrees W. longitude. However, this is decimal degrees, and we want dotted DMS. So, to convert, in each step I read off int() of the current value, then multiply the decimal part by 60. Thus, I'd put <!-- location:latitude=40.04.14,longitude=-76.18.53 -->. And thanks to you I just checked my homenode and noticed I didn't update it when I moved.

    However, this, while easy, is hardly trivial. Another place to try, from a quick google search, is geocode.com's Eagle (US-centric)

    One place I wouldn't try, BTW, is terraserver.com; not only are they MS, but they don't see to make any useful information without being a "pro user".


    Confession: It does an Immortal Body good.

      To convert a decimal number (dn) to degrees (d), minutes (m) and seconds (s):
      d = int(dn) mi = frac(dn)*60 m = int(mi) s = frac(mi)*60

      Note that int(n) denotes taking the integer part of a number (i.e. int(49.5125) = 49) and frac its fractional part (i.e. frac(49.5125) = 0.5125). mi is an intermediate result.

      Example: To convert 49.5125 decimal degrees to degrees, minutes and seconds:

      d = int(49.5125) = 49 mi = frac(49.5125)*60 = 0.5125*60 = 30.75 m = int(mi) = int(30.75) = 30 s = frac(mi)*60 = 0.75*60 = 45

      Many calculators have a built-in function to compute this - it is often called "dms" or "hms". Switch to scientific mode on your calculator. To convert from decimal to degrees, minutes and seconds, enter the number, then hit the dms button.

      To convert from degrees, minutes and seconds to decimal degrees, enter the degrees, a decimal point, then the minutes (2 digits) and seconds, then hit the [x]Inv (Inverse) button to get the inverse function and hit the dms button again.

      I found that for UK based monks www.streetmap.co.uk will give latitude/longitude for any given postcode or address.
      Once you zoom in, the query string changes so that it includes the lat and long.
      http://www.mapblast.com/myblast/map.mb?CMD=LFILL&CT=45.3974961%3A-122.727504%3A20000&GAD1=... No need to show it all and expand the node. Anyways, here is some code for conversion, go ahead and optimize away:
      #!/usr/local/bin/perl -w use strict; sub convert { $_ = shift; my $a; my $b; /^([0-9-]+)\.([0-9]+)$/; ($a,$_) = ($1,("0." . $2)*60); /^([0-9-]+)\.([0-9]+)$/; ($b,$_) = ($1, ("0." . $2)*60); s/\..*$//; return "$a.$b.$_"; } while(<stdin>){ my $lat; my $lon; if(/.*&CT=([0-9.-]+)%3A([0-9.-]+).*/){ my $lat = $1; my $lon = $2; print "\n\n<!-- location:latitude=" . convert($lat) . ",longit +ude=" . convert($lon) . " -->\n"; } }

      Perhaps, this could be included on the site, somehow.

      Edited, added last idea.
      ==
      Kwyjibo. A big, dumb, balding North American ape. With no chin.
Re: Put yourself on the Map -- correction
by hossman (Prior) on Aug 20, 2002 at 06:32 UTC

      It appears that MapBlast has been usurped into Microsoft and is now BingMaps...
      I didn't realise until I just looked at it that Microsoft has Streetside to complete with Google Streetview.

Re: Put yourself on the Map -- correction
by jdporter (Paladin) on Dec 20, 2005 at 13:57 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: monkdiscuss [id://191366]
Approved by newrisedesigns
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (7)
As of 2024-03-28 09:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found