Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: Yet another Cache Builder for Google Earth (Linux/Win/Mac)

  1. #1
    Raw Wave shotgunefx's Avatar
    Join Date
    Apr 2005
    Location
    Boston, MA
    Posts
    1,800

    Cool Yet another Cache Builder for Google Earth (Linux/Win/Mac)

    Here's V1 of my own take at a cache builder for Google Earth.

    It's written in perl, so after installing perl (if you don't have it on your system already), you'll just have to install the required modules.

    Code:
    ge_cachbuild.pl -lat [pos] -lon [pos] -range [meters] -hkm [km] -vkm [km] -sleep [sec]
      -lat   (Northwest corner in decimal degrees) ex: 42.832778
      -lon   (Northwest in decimal degrees) ex: -72.983889
      -range (Range in meters) ex: 600
      -hkm   (Int number of kilometers to scan West to East) ex: 15
      -vkm   (Int number of kilometers to scan North to South) ex: 10
      (Optional)
      -sleep (Int number of seconds to sleep before moving), default 3
      -hres  (Int horiztonal block to resume at)
      -vres  (Int horiztonal block to resume at)
      
    * To resume where you left off, supply the last -hres, -vres parameters that were output.
    Once started, it writes out invalid KML to $KML_FILE
    Add $KML_FILE as a network link to refresh once a second and check the "Fly to" option.

    You should get an error about an invalid token. Click ignore (this prevents it happening mid-run)

    Next it will overlay an image over the area to be scanned, if it's the desired area, hit "y" to continue or "n" to quit.



    The overlay will disappear and scanning begins.

    Install Tips
    ---------------------------------------------------------------------------------
    Just untar (or use winzip) the file into an appropriate directory of your choosing.

    A few things you'll need to do first before it will work.

    You need to change some config variables
    Code:
    # The KML network link file, need a fully qualified path
    my $KML_FILE     = '/home/lee/cachebuild.kml';       
    
    # The overlay file, need a fully qualified path!
    my $OVERLAY_FILE = '/home/lee/ge_cachebuild/cachebuild.gif';
    
    # The icon file, need a fully qualified path!
    my $ICON = '/home/lee/ge_cachebuild/cachebuild-icon.gif',
    Point them to some place reasonable on your system, using FULLY QUALIFIED NAMES
    examples:
    my $KML_FILE = 'C:\ge_cacher\nutwurk-link.kml';

    Don't forget to quote the value.

    You'll need to have perl, but you'll also need to install the following modules.

    Code:
    Geo::Distance
    Geo::Forward
    For linux users it's easy (I think Mac is the same???)
    Code:
    > perl -MCPAN -e shell
    > install Geo::Forward
    > install Geo::Distance
    If it asks to install any prerequisites, just say yes.


    For windows, it will depend on your perl distro. Look at the appropriate docs on loading modules

    Here is a decent Perl for Windows
    http://www.activestate.com/Products/ActivePerl/

    I banged this out pretty quick, I'll probably make some changes (specifying SE lat/long instead of width and height to scan, for instance)

    UPDATED version 1.02
    The source
    Download ge_cachebuild.pl v1.02
    -added resume, % progress to output and GE.





    Feedback welcome.

  2. #2
    Raw Wave shotgunefx's Avatar
    Join Date
    Apr 2005
    Location
    Boston, MA
    Posts
    1,800
    In my haste to clean it up, introduced an error where it would not move down after scanning, so it would keep scanning the same horiztonal line.

    Fixed. Link updated.

  3. #3
    Raw Wave shotgunefx's Avatar
    Join Date
    Apr 2005
    Location
    Boston, MA
    Posts
    1,800
    Bump, added resume and progress bar.

  4. #4
    Constant Bitrate
    Join Date
    Dec 2005
    Posts
    127
    where to get the modules and how to install them ?

  5. #5
    Raw Wave shotgunefx's Avatar
    Join Date
    Apr 2005
    Location
    Boston, MA
    Posts
    1,800
    Quote Originally Posted by 0-0-7 View Post
    where to get the modules and how to install them ?
    If your running linx, you use the commands in the first post to connect to the CPAN repository (Tens of thousands of libraries, Perl's biggest strength),

    If the modules (and the modules they depend on) are pure perl code (which I believe they are), then you can install them the same way on Windows.

    Or if you are using Activeperl, you can install modules with "ppm" (Perl Package Manager) and should go something like this.

    C:>ppm
    PPM>install Module-Name

    Modules names on ppm have the "::" replace with a single or double dash IIRC.

    Check this out (win)
    http://aspn.activestate.com/ASPN/doc...Perl-faq2.html

    They don't have all the modules that exist on CPAN. If it doesn't exist on ppm, then you have to install it directly which may be easy (for pure perl modules) or difficult (for modules that depend on C code), I don't think either of these falls in that category.

    Some more links.

    A guide to installing modules on Win32

    A Practical Guide to Compiling C based Modules under ActiveState using Microsoft C++

    Again, I don't believe you'll have to do any compiling at all so it should be easy (There is a reason I didn't use any XML libraries to generate the markup)

    Have you installed a version of Perl yet?

  6. #6
    Maximum Bitrate Ruffy's Avatar
    Join Date
    Sep 2006
    Location
    Georgia
    Posts
    511
    ive installed activeperl and the perl package manger doesnt have Geo:istance
    It has Geo::Functions which i installed.

    Changed the perl file to point to d:\gearth\ but it's not building a kml file.

    Error
    Can't locate Geo/Distance.pm in @INC (@INC contains: C:/Perl/site/lib C:/Perl/li
    b .) at D:\GEarth\ge_cachebuild.pl line 5.
    BEGIN failed--compilation aborted at D:\GEarth\ge_cachebuild.pl line 5.
    Obviously the geo functions I need arent easily found.
    Car : 00' Chrysler 300M
    Speakers : Rainbow Audio SLC 265 | Subs : Diamond Audio D6 12" Subs X2
    Amp's : Hifonics ZXi 6006 AB | Hifonics BXi 1606 D
    CarPC: HP Laptop AMD Sempron 3000+ | 1.5GB RAM | DVD+RW | 80GB 5400RPM HD | ATI R200 Video

  7. #7
    Maximum Bitrate Ruffy's Avatar
    Join Date
    Sep 2006
    Location
    Georgia
    Posts
    511
    well i manged to get Geo:istance isntalled using cmd line ppm install Geoistance on a copy I found on a repository. Still looking for geo foward
    Car : 00' Chrysler 300M
    Speakers : Rainbow Audio SLC 265 | Subs : Diamond Audio D6 12" Subs X2
    Amp's : Hifonics ZXi 6006 AB | Hifonics BXi 1606 D
    CarPC: HP Laptop AMD Sempron 3000+ | 1.5GB RAM | DVD+RW | 80GB 5400RPM HD | ATI R200 Video

  8. #8
    Maximum Bitrate Ruffy's Avatar
    Join Date
    Sep 2006
    Location
    Georgia
    Posts
    511
    new error. Got both modules installed
    D:\GEarth>ge_cachebuild.pl
    Use of uninitialized value in concatenation (.) or string at D:\GEarth\ge_cachebuild.pl line 47.
    Missing or invalid latitude []
    usage:
    ge_cachbuild.pl -lat [pos] -lon [pos] -range [meters] -hkm [km] -vkm [km] sleep
    [sec]
    -lat (Northwest corner in decimal degrees) ex: 42.832778
    -lon (Northwest in decimal degrees) ex: -72.983889
    -range (Range in meters) ex: 600
    -hkm (Int number of kilometers to scan West to East) ex: 15
    -vkm (Int number of kilometers to scan North to South) ex: 10
    (Optional)
    -sleep (Int number of seconds to sleep before moving), default 3
    -hres (Int horiztonal block to resume at)
    -vres (Int vertical block to resume at)

    * To resume where you left off, supply the last -hres, -vres parameters that were output.

    D:\GEarth>ge_cachebuild.pl
    Car : 00' Chrysler 300M
    Speakers : Rainbow Audio SLC 265 | Subs : Diamond Audio D6 12" Subs X2
    Amp's : Hifonics ZXi 6006 AB | Hifonics BXi 1606 D
    CarPC: HP Laptop AMD Sempron 3000+ | 1.5GB RAM | DVD+RW | 80GB 5400RPM HD | ATI R200 Video

  9. #9
    Low Bitrate eurocarpc's Avatar
    Join Date
    Jun 2006
    Location
    Madrid, Spain
    Posts
    71
    Use of uninitialized value in concatenation (.) or string at ./ge_cachebuild.pl line 48.

    Same thing to me... I had to force the install of Geo:istance.

    ( Ubuntu 6.06 )

    =(

  10. #10
    Raw Wave shotgunefx's Avatar
    Join Date
    Apr 2005
    Location
    Boston, MA
    Posts
    1,800
    Quote Originally Posted by eurocarpc View Post
    Use of uninitialized value in concatenation (.) or string at ./ge_cachebuild.pl line 48.

    Same thing to me... I had to force the install of Geo:istance.

    ( Ubuntu 6.06 )

    =(
    Does it exit?

    By itself, "Use of uninitialized value" is usually a harmless message.

    Line 48 is checking to see if you passed a -lon (longitude) parameter, if you didn't, it will die with a usage message.

    The usage message references $nw_long, which if you haven't passed a -lonvalue, will be "uninitialized", hence the warning. It shouldn't cause the program to exit, as it's a warning, not an error.

    Why am I referencing a value that's not there? I had planned on adding a check to see if it looked like a valid lat/long, hence "Missing or invalid", just never got around to it.

Page 1 of 3 123 LastLast

Similar Threads

  1. Google Earth Cache Builder
    By njwashor in forum Other Cool Stuff
    Replies: 54
    Last Post: 07-27-2007, 11:54 AM
  2. Drop-down menus don't work? Read this!
    By gnomad in forum Announcements
    Replies: 0
    Last Post: 10-14-2005, 02:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •