Google
Official Google Earth Download Site

Google Earth Community System Reliability: HIGH

Support and Answers >> KML Discussions (read only)

Jump to first unread post. Pages: 1 | 2 | 3 | 4 | >> (show all)
denisew
Tourist


Reged: 10/24/06
Posts: 2
Re: A new tool for creating Region-based KML [Re: regionator]
      #662565 - 10/28/06 05:14 PM

Colégio Inovação II

Post Extras: Print Post   Remind Me!   Report this Post  
ink_polaroidAdministrator
Sysop


Reged: 01/01/05
Posts: 1868
Loc: SF Bay Area, CA
Re: A new tool for creating Region-based KML [Re: PatrickB]
      #666448 - 10/31/06 01:05 PM

Internally, GDAL (the heart of the regionator) will work with TIFF files, no matter what you throw at it.

In the case of a very large JPEG, it will decompress that file and convert to TIFF many, many times. This is the source of the slow operations.

You should convert any large source file to TIFF before regionating it...

The brain-off method is to use gdal_translate:

gda_translate img.jpg img.tif


Post Extras: Print Post   Remind Me!   Report this Post  
regionatorModerator
The Crusader


Reged: 01/24/06
Posts: 63
Re: A new tool for creating Region-based KML [Re: ink_polaroid]
      #667449 - 11/01/06 08:22 AM

A 2006 vintage computer with a couple of gig of ram and a ghz or 2 of cpu
completes a 20k x 20k SuperOverlay in less than 15 minutes. Some tiles will
take far longer than others as the process involves downsampling all to most
of the entire image for the coarsest levels in the hierarchy. I most commonly
use an Apple PowerBook G4 (yes, not even an Intel MacBook) with 2gb of ram
and a mere 1.67 ghz PowerPC cpu. This generally presumes TIFF input for
some reasons Ink mentioned previously.


Post Extras: Print Post   Remind Me!   Report this Post  
regionatorModerator
The Crusader


Reged: 01/24/06
Posts: 63
Re: A new tool for creating Region-based KML [Re: regionator]
      #667480 - 11/01/06 08:51 AM

Anyone creating SuperOverlay tools might be interested in this:

http://code.google.com/p/regionator/issues/detail?id=1&can=2&q=


Post Extras: Print Post   Remind Me!   Report this Post  
PatrickB
Tourist


Reged: 07/28/05
Posts: 17
Re: A new tool for creating Region-based KML [Re: regionator]
      #667547 - 11/01/06 10:01 AM

Thanks Ink, Regionator. Converting to a .tiff and using a Windows Server with a 3.80GHz processor and 3.5 GB of RAM solved all my problems!

Converted a 20,000px x 20,000px in 11mins

--------------------
-Pattt
http://adventuresforthecure.com


Post Extras: Print Post   Remind Me!   Report this Post  
PatrickB
Tourist


Reged: 07/28/05
Posts: 17
Re: A new tool for creating Region-based KML [Re: PatrickB]
      #668779 - 11/02/06 08:41 AM

I modified the code in extractor.py starting at line 99.. so that only 1 temporary
file is created. Since on Windows there is a bug in deleting a temporary file using
Python, this change will create only 1 temporary file that will always be used each
time the program is run.

There may be a problem with this change if you run more than one instance of
regionator simultaneously or if the code is modified to be multithreaded.

Any suggestions or corrections would be greatly appreciated

The code in extractor.py after line 99 was changed to the following:

# Have to Create out to GTiff first (?)
tmpfilePath = tempfile.gettempdir()+"\\tmpfile"
tmpfile = open(tmpfilePath, "w")
o_ds = self.__gtiff_driver.Create(tmpfilePath,twid,tht,bands=self.__bands)
o_ds.WriteRaster(0,0,twid,tht,i_data)

# Save off using the specified driver
filename = '%s.%s' % (basename,self.__fmt)
self.__o_driver.CreateCopy(filename,o_ds)

if self.__verbose:
print filename

# Delete the tmp file
tmpfile.close()

# Does not delete the file if running on Windows.
# Will produce the following:
# [Errno 13] Permission denied:
# 'c:\\docume~1\\admini~1\\locals~1\\temp\\tmpfile'
self.__gtiff_driver.Delete(tmpfilePath)

--------------------
-Pattt
http://adventuresforthecure.com


Post Extras: Print Post   Remind Me!   Report this Post  
regionatorModerator
The Crusader


Reged: 01/24/06
Posts: 63
Re: A new tool for creating Region-based KML [Re: PatrickB]
      #668847 - 11/02/06 09:35 AM

What exact version of Python and Windows are you have this problem?
I happen to have a colleague who knows alot about Python :-)
(The original extractor code actually did what you did to your copy,
but as you point out this is unsafe).

Other Python on Windows hackers are free to chime in with their
tmp file creation experiences.

Also, just to make your life difficult kml/extractor.py was just modified
to explicitely set a higher quality level on the JPEG output driver.
The default is "75" which is just plain too low most of the time.
extractor.py now sets it to "90".


Post Extras: Print Post   Remind Me!   Report this Post  
PatrickB
Tourist


Reged: 07/28/05
Posts: 17
Re: A new tool for creating Region-based KML [Re: regionator]
      #668875 - 11/02/06 10:00 AM

I am using Python 2.4 on Windows XP and Windows 2003 Server (both give the same error). I will try using Python 2.5 instead!

--------------------
-Pattt
http://adventuresforthecure.com


Post Extras: Print Post   Remind Me!   Report this Post  
regionatorModerator
The Crusader


Reged: 01/24/06
Posts: 63
Re: A new tool for creating Region-based KML [Re: regionator]
      #669459 - 11/02/06 08:55 PM

The latest release of GE4 (241X) supports GroundOverlays at altitude and
the Regionator code has been updated to support this as well.

superoverlay.py now takes a groundoverlay.kml as input and
parses out LatLonBox, altitude, drawOrder as well as time and
reflects such into the superoverlay.

Here is an example:

http://regionator.googlecode.com/svn/trunk/tests/ksc-llb-a.kml

An update to the KML 2.1 Reference will appear soon...


Post Extras: Print Post   Remind Me!   Report this Post  
pawill79
Tourist


Reged: 02/03/05
Posts: 14
Re: A new tool for creating Region-based KML [Re: regionator]
      #686213 - 11/16/06 01:55 AM

To make the regionator more dynamic for your webserver... You can edit /usr/local/lib/python2.4/site-packages/kml/regionator.py (or your path to python site packages) and change...

link.href = '%s/1.kml' % dir
to...
link.href = 'http://www.yourwebsite.com/%s/1.kml' % dir
or even
link.href = 'http://www.yourwebsite.com:8080/%s/1.kml' % dir
if you have to run your webserver on a different port.

This prevents you from having to edit the root.kml after running the superoverlay.py


Post Extras: Print Post   Remind Me!   Report this Post  
Pages: 1 | 2 | 3 | 4 | >> (show all)




Extra information
0 registered and 21 anonymous users are browsing this forum.

Moderator:  Hill, Jumble, jrohlf, Kempster, mcshea98, jeffryv, dulce, esterrett, regionator, NormB, Frank_McVey, geus, ZeroDeeFeX, LaBelleTerre, vagabondsailor, SupersonicBuddha, DWebb, BeadieJay, TheLedge, Cyclonic, no_stranger, LuciaM, tekgergedan, ManoM, cantarell, toponym2006, Noisette, danescombe, Michal_Drewniak, mutex, marinerfan, Delta102, bebop, MarkAubin 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating: *****
Topic views: 56513

Rate this topic

Jump to

earth.google.com    bbs.keyhole.com

*
UBB.threads™ 6.5.1.1