regionator
The Crusader
Reged: 01/24/06
Posts: 63
|
|
We have released some code which we hope will be of interest to those working with Region KML.
For more information please visit:
http://code.google.com/p/regionator/
Here is a direct link to the project's README:
http://regionator.googlecode.com/svn/trunk/README
Edited by ink_polaroid (08/10/06 05:06 PM)
|
bplewe
Tourist
Reged: 03/31/05
Posts: 14
Loc: Spanish Fork, Utah
|
|
A non-programmer having some trouble getting regionator to work: We're running under windows (not CygWin), which may be part of the trouble, and python 2.4, GDAL, and numpy seem to be installed and working. The tests in the test folder all worked without a hitch. [ImageMagick was only needed for the image tests, not for regionator in general, right?] However, whenever we try to run a script that opens an image (like superoverlay.py or testextractor.py), we get the following:
self.__in_ds = gdal.Open(imgfile) AtrributeError: 'module' object has no attribute 'Open'
My guess is that this is an installation snafu, not a bug in the program. Any ideas?
|
regionator
The Crusader
Reged: 01/24/06
Posts: 63
|
|
Sounds like a problem with the installation of gdal or the gdal python bindings.
A quick first test of just gdal's python installation might be to start python interactively and enter the following lines manually. This presumes 'screeno01.jpg' exists (yes, ImageMagick is only to create these files for other tests and is not needed for creating a superoverlay). Obviously if you use a different image file the x,y values may be different.
>>> import gdal >>> ds = gdal.Open('screeno01.jpg') >>> print ds.RasterXSize 32 >>> print print ds.RasterYSize 32
|
bplewe
Tourist
Reged: 03/31/05
Posts: 14
Loc: Spanish Fork, Utah
|
|
Yes, it was the installation of GDAL. "import gdal" was interpreted as the gdal folder, not gdal.py, which confused everything. We ended up having to change the folder to "gdal1", then add that folder explicitly to the pythonpath. Not a clean workaround, and not sure what is different from your system, but it works. Works great, in fact. Thanks for the tool!
|
vestigialars
Tourist
Reged: 10/05/06
Posts: 6
|
|
Hi All, I am having similar problems on Windows, I'm keen to try regionator. Anyone willing to help me? I am a newbie on Python and GDAL, all my imagery is on a Novell network and my sysman only allows logins from our Windows machines, so Windows is my only useful option for this work. I've got FWTools installed, which I think means GDAL is installed somehow as well, and have also put GDAL 1.3.2 in a couple other places, all of which are indicated on PYTHONPATH.
However, when I try and run any of the image based test scripts or the superoverlay.py script I am told:
C:\temp\subversion\build\scripts-2.5>superoverlay.py Traceback (most recent call last): File "C:\temp\subversion\build\scripts-2.5\superoverlay.py", line 28, in <module> import kml.superoverlay File "C:\Python25\Lib\site-packages\kml\superoverlay.py", line 27, in <module>
import kml.image File "C:\Python25\Lib\site-packages\kml\image.py", line 25, in <module> import gdal File "C:\gdal-1.3.2\pymod\gdal.py", line 191, in <module> import _gdal ImportError: No module named _gdal
Anyone know what to do? Got any help? Anything at all?
Thanks, Lars
|
regionator
The Crusader
Reged: 01/24/06
Posts: 63
|
|
Python isn't finding gdal. To more directly debug this start python interactively and enter "import gdal". Once that works the regionator code which uses gdal will also work.
Also fwtools includes its own fairly old python so watch you might want to be mindful of mixing different python installations.
|
vestigialars
Tourist
Reged: 10/05/06
Posts: 6
|
|
Okay, gave up on the windows version. My gdal says it is fine but the _gdal is throwing everything off. I am probably missing something simple but can't figure it out right now.
Happily, I have it running on a linux box and it seems to be working. So far so good, thanks!
Lars
|
vestigialars
Tourist
Reged: 10/05/06
Posts: 6
|
|
Hi All, me again.
Any advice on how to improve the output image quality from regionator? I am using it on large high-res imagery showing small villages in Darfur. The output JPEGs are downsampled to a certain extent and I lose some quality overall. Not a lot, but enough that I notice. Any quick fix?
Also, at some point I ran regionator and it produced PNGs. Why did that happen, and do I have control over it?
Thanks for any tips...
|
pawill79
Tourist
Reged: 02/03/05
Posts: 14
|
|
I have been trying to get the "regionator" to output my files as PNG's only. I have found the image.py and extractor.py as possible culprits for automatically choosing my output files but have not successfully edited those files to do what I want.
Has anybody changed these files so that only PNG's are produced, it seems I am only able to create GTiff output files.
|
pawill79
Tourist
Reged: 02/03/05
Posts: 14
|
|
Ok, I figured this one out. Forgot to recompile the regionator after making changes to the extractor.py and image.py files.
|