Showing posts with label python. Show all posts
Showing posts with label python. Show all posts

Wednesday, 13 August 2014

Polygontool

Hi all,
this fast post is intended to be an overview of the new open source software Polygontool, an application our friend +Szabolcs Köllö (aka +keulemaster) developed for Arc-Team. This tool is helping us in defining an automatic data processing protocol, in order to directly convert raw data files (collected with RTK GPS or total station during survey campaigns) into GIS readable formats. Currently the tool is under an hard test phase, being used during an interreg project (leaded by +Rupert Gietl) about the Great War between the Austrian and Italian border, but it had already positive effects on our work-flow, reducing the time expensive operations of manual data processing. The short video below is a demo to explain how the software works and what it can do.




The source code (in Python) can be found on github and it is already usable (if you want to test it) and open to contributions (if you want to help us in the development). Currently the configuration files (in the "config" folder) are optimized for our interreg project, but you can, of course, modify the terminology to make them fit to any other archaeological database.
Soon I will post other reports about Polygontool. By now I hope this preview will be useful for some of you (and maybe for us, if someone will join the project).
Have a nice day!

Friday, 30 August 2013

gdal_edit.py: if you can think it, you can do it

Hi all,
today I'll write a post about a python script I used to edit the projection of an old geotiff, to import it in the GIS I am managing for Aramus archaeological mission 2013. To understand why I needed to use such a script, I have to explain briefly the problem occurred this year.
Since eight years (2006), Arc-Team is supporting the excavation in Aramus (AR), currently leaded by Dott. Walter Kuntner of Insbruck University (Institut für Alte Geschichte und Altorientalistik), in colaboration with Prof. Hayk Avetissian (Yerevan State University). In 2006 Ing. Klaus Kerkow and Christine Hanisch produced an high resolution aerial map of Aramus hill, using S-42 geodetic datum (with the Krassowsky ellipsoid). Unfortunatley, since 2004, Aramus project has been set up on a modified version of S-42, to avoid bureaucratic problems. This is the reason why I had to convert the aerial map geotif from the Krassowsky-Pulkovo to the local Aramus system. If I could work with a georeferenced raster and a plain world file, it would have been simple to solve the problem, just modifying the coordinates directly in the code... but working with a geotiff, things became more complicated. I could georeference again the aerial map, but I wanted to spare time and keep the same quality of the original raster. Luckily Walter Kuntner found the right solution in internet: gdal_edit.py, a simple scrit able to "edit in place various information of an existing GDAL dataset (projection, geotransform, nodata, metadata)". I checked quickly If I had this script in my GDAL files, but I did not find it, so I simply copied the source code from the OSGeo SVN repository, at (this link) and I saved it in a .py file. Than I get the coordinates of the upper left and lower right corner of my geotiff in OpenJUMP ...


Copying the upper left coordinates of the geotif

... and finally I modified the GDAL dataset with this command:

python gdal_edit -a_ullr ulx uly lrx lry

where ulx and uly stand for the new x and y coordinates of the upper left corner of the geotif, while lrx and lry are the new x and y coordinates for the lower right corner.
I know that this problem is not very common, but I hope that this post will be anyway somehow useful to ATOR readers.
Have a nice day!
BlogItalia - La directory italiana dei blog Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.