[Gdal-dev] RE: Changes to Geo::OSR::SpatialReference->ImportFromXXX() methods?

Ethan Alpert ealpert at digitalglobe.com
Sat Nov 10 10:40:09 EST 2007


Ari,

Take a look at the diff of _wrap_SpatialReference_ImportFromESRI in
osr_wrap.cpp between the trunk and 1.4.3. The code has changed. All I'm
sure of is that code that ran in 1.4.3 gives me an exit. As far as I can
tell the 1.4.x releases took a single string. I will try the list of
strings approach you suggest.

-e

The code is:


my $from_sr = new Geo::OSR::SpatialReference;

my $prj = read_file("$dir/$base\.prj",bindmode=>':raw');

$from_sr->ImportFromESRI($prj);


The above code worked fine for all 1.4.x releases


-e
-----Original Message-----
From: Ari Jolma [mailto:ari.jolma at tkk.fi] 
Sent: Saturday, November 10, 2007 8:33 AM
To: Ethan Alpert; gdal-dev
Subject: Re: Changes to Geo::OSR::SpatialReference->ImportFromXXX()
methods?

Ethan Alpert kirjoitti:
>
> Greetings, I recently compiled the the svn-trunk from 11/06. It seems 
> the import functions interface has changed and tries to match the 
> char** interface of the native library. I had to patch ImportFromESRI 
> because I couldn't figure out how to pass projection strings.
>
> Do you have an example of how to create a perl array which 
> ImportFromESRI will now accept?
>

In fact I'm not sure what change you refer to. I've so far used these 
functions very little. The ImportFromESRI accepts a reference to an 
options array (similarly to the native library) as you say but I have 
little clue what it should contain. All ESRI prj files I find contain 
WKT, which ImportFromWkt happily accepts. The usage should be

use Geo::GDAL;
$a = Geo::OSR::SpatialReference->new();
$a->ImportFromESRI([ ...list of strings here... ]);

I'm cc'ing this to the gdal-list, probably somebody there can enlighten 
us about the old style prj files.

Ari
>
> Thanks,
>
> -ethan
>


-- 
Prof. Ari Jolma
Geoinformaatio- ja paikannustekniikka / Geoinformation and positioning
Teknillinen Korkeakoulu / Helsinki University of Technology
tel: +358 9 451 3886 address: 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