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

Ari Jolma ari.jolma at tkk.fi
Sat Nov 10 16:10:58 EST 2007


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