This script does basically what jcwren's infamous monkmap is doing, but isn't it cool to have a script like that on your own computer?
The version of this script requires a monks.xml file, listing all the monks coordinates. Thanks to jcwren, a daily updated XML file is now available at his site! Writing the script that grabs from the site XML is left as an exercise to the reader (the most lazy of you could probably try to convince me to post it too). Update: All the necessary files are now available for download (.tgz 2M).
If you like this node, be sure to ++ Corion's node too!
New! Daily updated pictures of the North American, Europe and World are available here
Caution, big pictures!
There's still some features to add, namely
Find a way toelegantlymanage the overlapping namesdone!Generate an Imagemapdone!- The ability to dynamically zoom in/out in an area
- Plenty of other things I'll think of in a few minutes
the up-to-date code is now located at the node drawmap.pl
Updates
- 2001/06/15:
- Fixed the text color, it's now really white
Added preview pics - 2001/06/16
- v.0.02 : Now using Getopt::Mixed to parse the arguments, so much cleaner!
Added a bad attempt to fix the overlapping name problem - 2001/06/17
- v.0.03 : A better way to avoid overlaps, thanks to Corion!
- 2001/06/17
- v.0.04 : An even better way to avoid overlaps and some changes in the logic, thanks again to Corion!
my $OeufMayo = new PerlMonger::Paris({http => 'paris.mongueurs.net'});</kbd>
|
---|
Replies are listed 'Best First'. | |
---|---|
Banish the overlap (was:Re: drawmap.pl - Spot The Monk!)
by Corion (Patriarch) on Jun 17, 2001 at 19:18 UTC | |
After burning my mouth by giving incomplete intersection hints in the chatterbox and on my home node, I reworked the great program by jcwren (idea) and OeufMayo (realization) to reduce the overlap. There are some small glitches which I haven't yet worked out (for example, Tortue vs. Elgon), but the overlap has been reduced greatly. What would be interesting now would be some nice optimization to locate each monk as close as possible to the map marker, but I guess that's quite out of scope for a weekend hack :) Test imagesUpdate:
| [reply] [Watch: Dir/Any] [d/l] |
(jcwren) Re: drawmap.pl - Spot The Monk!
by jcwren (Prior) on Jun 15, 2001 at 20:29 UTC | |
Cool! If anyone is interested, I could export the Monk Map data as an XML file. This would prevent anyone from having to write a script to parse the pages (which means it won't break if the format changes), and generate unnecessary hits on the server. I can also make the map available. Jeffa did a great job reducing the map from about 40 colors to 5 or 6 (I think). I'd like to see it reduced further to a *true* three color map, with all the lines fixed up. --Chris | [reply] [Watch: Dir/Any] |
(jcwren) Re: drawmap.pl - Spot The Monk! (XML Available)
by jcwren (Prior) on Jun 19, 2001 at 07:45 UTC | |
I've added a cronjob entry that creates a monks.xml from the stats database every night around 03:30 EST/EDT. The URL is www.tinymicros.com/pm/monks.xml. This file is generated immediately after the stats run, which can take as long as half an hour to complete. I modified one item in the format. The opening <monkmap> tag contains the GMT date the file was generated, and the originating URL. Example:
I think I got the format correct, but I'm not sure of all the characters that should be escaped or not. If you find a problem with it, please let me know. I do know that the XML view in IE didn't whine about it, for whatever that's worth. If you have a program that uses this data, please consider cacheing it locally, and updating it around 05:00 EST/EDT. This will help reduce traffic on the IDSL line. --Chris | [reply] [Watch: Dir/Any] |
Re: drawmap.pl - Spot The Monk!
by grinder (Bishop) on Jun 16, 2001 at 13:02 UTC | |
Find a way to elegantly manage the overlapping names You want to get in touch with Léon Brocard, and ask him how he solved this problem on the Perl Monger World Map. (Zoom in on a section to see what I mean). I'm sure he'll give you the source if you ask nicely. -- g r i n d e r | [reply] [Watch: Dir/Any] |
Re: drawmap.pl - Spot The Monk!
by stefp (Vicar) on Jun 17, 2001 at 18:02 UTC | |
See map projections and Mercator Projection at britannica.com for more info. -- stefp | [reply] [Watch: Dir/Any] |
by Tiefling (Monk) on Jun 19, 2001 at 15:56 UTC | |
This has been your daily Irrelevant Iconoclasm. Tiefling (who thinks there are better ways of highlighting the plight of the 'South' than lying about cartography)
| [reply] [Watch: Dir/Any] [d/l] |
Re: drawmap.pl - Spot The Monk!
by Jouke (Curate) on Jun 15, 2001 at 18:09 UTC | |
I guess you originally used PNG as output format ;-) ? Jouke Visser, Perl 'Adept' Using Perl to help the disabled: pVoice and pStory | [reply] [Watch: Dir/Any] [d/l] |