[Gdal-dev] GDAL's Python Identity Crisis (was Re: Import Gdal)

Vincent Schut schut at sarvision.nl
Fri Sep 21 06:34:20 EDT 2007


Howard Butler wrote:
> Chris,
>
> This is something that Frank is probably sick of me whining about. 
> I'm willing to make the changes, but the consequence of doing so is we
> have to suck up the testing, question answering, and other grief a
> change like this will likely cause.  Can you do that with me?  I think
> we should only do this for the next-gen bindings, but I'm open to
> suggestions.
Me too thinks that is a good idea, it would also make a clear (visible)
difference between the old and the ng bindings. NG bindings aren't the
default yet, are they? Any linux distro's install ng bindings by
default? If they aren't, that would make it even more easy to make this
change; likely only reasonably capable pythonistas (hear hear...) will
be using ng now, and they will be able to make the change to a real gdal
package relatively easy. For old bindings users, once the time comes
they want/need to switch to ng, they probably will have to check their
code anyway, so it is a minor extra effort to also change your imports.
And it would be easier to document: old bindings, no change, ng
bindings: gdal package.
>
> The other issue is if we namespace the Python GDAL packages, what do
> we pick for a name?
I'd say follow ruby (and java): gdal namespace, gdal.gdal/osr/ogr. Easy
to update your imports, just add a 'from gdal' before your current
gdal/osr/ogr imports.
>
> Python currently uses:
> >>>  import gdal
> >>>  import osr
> >>>  import ogr
>
> C# uses:
> OSGeo.GDAL
> OSGeo.OSR
> OSGeo.OGR
>
> Ruby uses:
> gdal::gdal
> gdal::osr
> gdal::ogr
>
> Perl uses:
> Geo-GDAL
> Geo-OSR
> Geo-OGR
>
> Java uses:
> org.gdal.gdal
> org.gdal.osr
> org.gdal.osr
>
> What makes sense for a GDAL namespace for Python?  I'm inclined to
> take Ruby's approach, but I could be swayed any way.  GDAL Python
> users please speak up with suggestions.  We probably won't change it
> for another ten years :)
>
> Howard
>
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/gdal-dev
>



More information about the Gdal-dev mailing list