Archive for the 'python' Category

Run GDAL builders in a batch

Friday, September 14th, 2007

In my daily work, I have to run GDAL builders very often and simultaneously. Each time I need to request new builds, I have to make 20-30 clicks. So, when it’s third or fifth round of building, every click hurts :) and here comes the genius of Python language.

I wrote a simple utility script - gdalbb.py - that simplifies running one:

gdalbb.py -b telascience-quick

or whole family of builders from the GDAL Buildbot instance:

gdalbb.py -f

in one shot. It can also list all builders available from the Buildbot instance:

mloskot@dog:~ gdalbb.py -l
Connecting to GDAL Buildbot instance: http://buildbot.osgeo.org:8500/
List of available builders :
1. telascience-quick
2. telascience-full
3. epimetheus-full
4. szekerest-vc80-full
5. szekerest-vc71-full
6. szekerest-vc80x64-full

It’s very easy to customize the gdalbb.py script to use it with other Buildbot instances available for OSGeo projects. Just edit three values in the configuration block of the script:

### BEGIN CONFIGURATION BLOCK ###
BBURL = 'http://buildbot.osgeo.org:8500/'
BBUSER = 'mloskot'
BBNOTE = 'Routine build'
#### END CONFIGURATION BLOCK ####

That’s it!

Perhaps, as a next step, it would be a good idea to make this script usable as an IRC bot.

FDO goes for Python

Wednesday, March 14th, 2007

A few hours ago, guys from the core development team of Feature Data Objects submitted new cool stuff to the FDO repository - Python scripting support for FDO API.

The Python bindings are generated with SWIG. As Greg Boone reported on the fdo-internals, currently Python bindings can be generated and used on Windows only. Linux support will be available soon. Also, it has been only tested with Python .2.4 so far and 2.5 line is not supported yet.

The Python scripting support for the Feature Data Objects is still under development but I’m sure it’s a great news for the large community of Python users in geospatial field. This is a next step to attract potential FDO users.

There is more about pyFDO subject on Jason Birch’s blog: pyFDO is in the House - Yeah Baby!

New Mapnik Release 0.3.0

Monday, May 22nd, 2006

Mapnik LogoToday, Artem Pavlenko - the leader of Mapnik project - announced new release of Mapnik 0.3.0. Mapnik is a Free Toolkit for developing mapping applications. New version brings rich set of new features.

(more…)

PyEPSGLookup released!

Sunday, January 29th, 2006

Today, I released my new Python module:

PyEPSGLookup is a small Python utility complementary to Projection module derived from Thuban project. It provides user with functionality to query epsg file for projection parameters by its number or name.

If you have any comments please tell me.

PyEPSGLookup package and usage examples are available here.

Running PyLint from Komodo

Sunday, January 15th, 2006

ActiveState Komodo LogoThanks to John’s Get Komodo for free post I started to use Komodo on my laptop. It’s really well-done software, so I put Vim away (for a while or longer :-)) and started to develop my scripts using Komodo.

A few days ago I also read John’s post about PyLint tool. I was looking for something like this as well as for a comprehensive style guide for Python. John points out both in his post.

Update: Command package has been updated - PyLint output parser included. Now, you can navigate to every line of script reported by PyLint with single click! I’d like to say BIG THANKS to Trent for this excellent solution.

Update: I’m still experimenting with Komodo customizations, so here you have Run PyLint command availabled as a package ready to import into your Komodo.

(more…)

DecimalDegrees Python module

Monday, December 26th, 2005

Small things also make us happy. Because I like small software gadgets, I created DecimalDegrees - Python module. Frequently, we - GIS and GPS users - have to convert coordinates between various formats. Here comes DecimalDegrees module which wraps all those higher math calculations into four Python functions. I hope this will be yet another small gadget which make someone happy :-)

Go to py-DecimalDegrees

Programmer’s Toolbox

Saturday, October 29th, 2005

Whatever you do, you need to know what kind of tools you need. That’s obvious rule. Certianly, you can dig a patch with a table spoon if you like :-) but in most cases you will use a specialized tool - spade.

Today, when I was reading Ubuntu Forums I came across a very nice explanation of tools in programmer’s toolbox. In my opinion, this short but condensed overview is all the truth about programming tools. So, in alphabetical order it looks like this:

  • C is a screwdriver
  • C++ is a Phillips-head screwdriver1
  • C# is a screwdriver that has a funny head2
  • Java is a bench saw
  • Python is a mitre saw3
  • Perl is a hammer

Now, I’d draw my own conclusion: best tools are precise3 and more precise1

1 precise as surgical instrument
2 first, I think tool is expected to be usefull, not funny :-)
3 another precise and accureate tool

Disclaimer: Yes, I flame on Java and C# :-)