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

Ethan Alpert ealpert at digitalglobe.com
Tue Nov 13 23:21:01 EST 2007


I built the svn-trunk and tried your suggestion:

$from_sr->ImportFromESRI([$prj]);

Now I get:

at ./new_main.pl line 60.
Command exited with non-zero status 2

When I replace the wrapper with the 1.4.2 code it works.

-e

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

Ethan Alpert kirjoitti:
> 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
>   

Does the read_file just return the contents of the file as one string? 
It seems that hobu made the change March 7 2007: "ImportFromESRI takes a

list, unlike all of the other ImportFrom* methods.  Apply the 
appropriate typemap...". I just wonder how it could have worked earlier?

The method in C++ expects a pointer to an array of char pointers 
(strings) and earlier the bindings would have given a pointer to one 
char pointer. Hm, if it earlier was

$from_sr->ImportFromESRI($prj);


then currently

$from_sr->ImportFromESRI([$prj]);

should give the same result. Could you post an example .prj file?


Ari



-- 
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