[R-sig-Geo] WKT coordinate system string (PRJ) to PROJ.4

Roger Bivand Roger.Bivand at nhh.no
Tue Jan 5 12:21:51 CET 2016


On Tue, 5 Jan 2016, Michael Sumner wrote:

>> On Tue, 5 Jan 2016 at 21:09 Michael Sumner <mdsumner at gmail.com> wrote:
>
>> Hello, is there any R-level way to convert a WKT/PRJ *coordinate system*
> string to
>> PROJ.4 used by sp/rgdal?
>
>
>
> I see it in ogr_proj.cpp at line 124:
>
>
> if (hSRS->exportToProj4(&pszProj4) != OGRERR_NONE) {
>
> Roger, Edzer: could we please expose that functionality from rgdal to input
> WKT from R?

That is exposed - the output comes in that of ogrInfo(), but needs the DSN 
and layer too.

I've committed the reverse of showWKT() as showP4() in revision 596 on 
R-Forge - let me know if you need a Windows binary to test.

Roger

>
>
> Is that feasible? I'll have a look at doing it myself . . . I know it's a
> distraction from other goals.
>
>
> Thank you.
>
>
> Cheers, Mike.
>
>
>
>> (Previously I've written out to SHP/PRJ, and read back in with rgdal, but
> that's obviously a
>> bit naff.)
>
>
>> (I know you can rgeos::readWKT and wkb::readWKB for *geometry*).
>
>
>
>> Cheers, Mike.
>
>
>
>

-- 
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 91 00
e-mail: Roger.Bivand at nhh.no



More information about the R-sig-Geo mailing list