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.
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.
Once started, it writes out invalid KML to $KML_FILECode: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.
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
Point them to some place reasonable on your system, using FULLY QUALIFIED NAMESCode:# 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',
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.
For linux users it's easy (I think Mac is the same???)Code:Geo::Distance Geo::Forward
If it asks to install any prerequisites, just say yes.Code:> perl -MCPAN -e shell > install Geo::Forward > install Geo::Distance
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.
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.
Bump, added resume and progress bar.
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?
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
Obviously the geo functions I need arent easily found.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.
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
well i manged to get Geo:istance isntalled using cmd line ppm install Geo
istance 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
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
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 )
=(
My project: double indash, Golf IV
http://www.mp3car.com/vbulletin/lcd-display/78848-double-indash-2x-lilliput-7-motorized-in-golf-iv.html#post841754
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.
Bookmarks