[Gdal-dev] Using the Geo::GDAL namespace for the Perl wrappers

Ari Jolma ari.jolma at tkk.fi
Thu Jun 8 16:15:12 EDT 2006


This is long overdue, hopefully it is not too late.

The Perl wrappers have had names gdalconst, gdal, ogr, and osr. In the 
Perl world, the namespace is global (literally) and CPAN (Comprehensive 
Perl Archive Network) is the realization. So, these modules should be in 
the Geo::GDAL namespace.

I've just been playing with it and I think I know how to configure 
things so that users can say something like:

use Geo::GDAL qw(:geom_types);
...
my $driver = Geo::GDAL::GetOGRDriver('..');
...
my $geom = Geo::GDAL::Geometry->new($wkbPolygon);
...

I.e. the module Geo::GDAL takes care of importing the workhorse modules, 
which are renamed Geo::GDAL::gdal etc. and exporting, if user wishes, 
variables like $wkbPolygon. There are few problems in putting GDAL and 
OGR into same namespace, for example both have GetDriver, but it feels 
unnecessary to have Geo::GDAL::OGR. Or what do you think?

Besides the obvious problem of breaking working code, do you see any 
other issues in this proposal?

This would let me or somebody design a bootstrap Geo::GDAL module for 
inclusion into CPAN, which either prints out: "go and install GDAL" or 
does it automagically (that would be serious AI :-) for him/her.

Ari

-- 
Prof. Ari Jolma
Kartografia ja Geoinformatiikka / Cartography and Geoinformatics
Teknillinen Korkeakoulu / Helsinki University of Technology
POBox 1200, 02015 TKK, Finland
Email: ari.jolma at tkk.fi URL: http://www.tkk.fi/~jolma




More information about the Gdal-dev mailing list