georust / proj

Rust bindings for the latest stable release of PROJ
https://docs.rs/proj
Apache License 2.0
146 stars 46 forks source link

Puzzled about how to create projection #200

Open CGenie opened 7 months ago

CGenie commented 7 months ago

Hello,

I have make this projection:

echo '19 50' | proj -f '%.8f' +proj=ob_tran +o_proj=longlat +lon_0=19.3 +o_lat_p=37.5 +datum=WGS84 +no_defs

which produces:

-0.00336882     -0.04362623

I can do, in Python:

import pyproj
p = pyproj.Proj("+proj=ob_tran +o_proj=longlat +lon_0=19.3 +o_lat_p=37.5")
p(longitude=19, latitude=50)
>> (-0.003368824387898672, -0.043626234267364894)

However, when I do:

let proj = proj::Proj::new("+proj=ob_tran +o_proj=longlat +lon_0=19.3 +o_lat_p=37.5");
let point = proj.convert((19.0, 50.0));

However, I get:

ob_tran: Invalid latitude

What do I do wrong?