comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » IDL-Python bridge with GDAL/OGR
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: IDL-Python bridge with GDAL/OGR [message #93691 is a reply to message #93690] Fri, 30 September 2016 12:02 Go to previous message
Gordon Farquharson is currently offline  Gordon Farquharson
Messages: 48
Registered: December 2010
Member
Hi Jim

Thanks for the suggestion.

On Friday, September 30, 2016 at 11:52:30 AM UTC-7, Jim P wrote:
> Instead of the syntax
> IDL> srs = osr.SpatialReference()
> what if you try the following?
> IDL> srs = osr.SpatialReference
>
> The error message indicates that by calling the object creation, you're getting a reference to the proxy SWIG object instead of a reference the underlying python object.

Your idea makes a difference, but results in a different error:

IDL> srs = osr.SpatialReference
IDL> srs
<class 'osgeo.osr.SpatialReference'>
IDL> srs.ImportFromProj4('+proj=utm +zone=10 +ellps=WGS84 +datum=WGS84 +units=m +no_defs')
% PYTHON_CALLMETHOD: Exception: unbound method ImportFromProj4() must be
called with SpatialReference instance as first
argument (got str instance instead).
IDL> srs.ImportFromProj4(srs, '+proj=utm +zone=10 +ellps=WGS84 +datum=WGS84 +units=m +no_defs')
% PYTHON_CALLMETHOD: Exception: unbound method ImportFromProj4() must be
called with SpatialReference instance as first
argument (got type instance instead).

There seem to be subtleties of the IDL-Python bridge that I do not understand.

Gordon
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: get data points of the contoured image
Next Topic: How to read nc variable partly?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Nov 28 08:13:44 PST 2025

Total time taken to generate the page: 0.00810 seconds