denisew
Tourist
Reged: 10/24/06
Posts: 2
|
|
Colégio Inovação II
|
ink_polaroid
Sysop
Reged: 01/01/05
Posts: 1868
Loc: SF Bay Area, CA
|
|
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
|
regionator
The Crusader
Reged: 01/24/06
Posts: 63
|
|
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.
|
regionator
The Crusader
Reged: 01/24/06
Posts: 63
|
|
Anyone creating SuperOverlay tools might be interested in this:
http://code.google.com/p/regionator/issues/detail?id=1&can=2&q=
|
PatrickB
Tourist
Reged: 07/28/05
Posts: 17
|
|
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
|
PatrickB
Tourist
Reged: 07/28/05
Posts: 17
|
|
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
|
regionator
The Crusader
Reged: 01/24/06
Posts: 63
|
|
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".
|
PatrickB
Tourist
Reged: 07/28/05
Posts: 17
|
|
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
|
regionator
The Crusader
Reged: 01/24/06
Posts: 63
|
|
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...
|
pawill79
Tourist
Reged: 02/03/05
Posts: 14
|
|
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
|