Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to read CRS WKT #21

Open
seydar opened this issue Mar 6, 2023 · 1 comment
Open

Unable to read CRS WKT #21

seydar opened this issue Mar 6, 2023 · 1 comment

Comments

@seydar
Copy link

seydar commented Mar 6, 2023

Using proj4rb v0.1.1, I get the following error when trying to use a specific WKT:

The WKT: "+proj=lcc +lat_1=33 +lat_2=45 +lat_0=0 +lon_0=-100 +x_0=0 +y_0=0 +ellps=WGS84 +towgs84=0,0,0,-0,-0,-0,0 +units=m +no_defs"

irb(main):001:0' require 'proj'
=> true
irb(main):002:0> Proj::Crs.new "+proj=lcc +lat_1=33 +lat_2=45 +lat_0=0 +lon_0=-100 +x_0=0 +y_0=0 +ellps=WGS84 +towgs84=0,0,0,-0,-0,-0,0 +units=m +no_defs"
Traceback (most recent call last):
        6: from /Users/ari/.asdf/installs/ruby/3.0.0/bin/irb:23:in `<main>'
        5: from /Users/ari/.asdf/installs/ruby/3.0.0/bin/irb:23:in `load'
        4: from /Users/ari/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/irb-1.3.0/exe/irb:11:in `<top (required)>'
        3: from (irb):2:in `<main>'
        2: from (irb):2:in `new'
        1: from /Users/ari/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/proj4rb-3.0.0/lib/proj/crs.rb:49:in `initialize'
Proj::Error (Invalid crs definition. Proj created an instance of: PJ_TYPE_OTHER_COORDINATE_OPERATION.)
irb(main):003:0>

It can be read by Python's pyproj, so I think this might be a bug in proj4rb.

@cfis
Copy link
Owner

cfis commented Mar 6, 2023

Because what is being returned is not a CRS but instead a coordinate operation. On that version of Proj, maybe PjObject.create will work (if it exists).

What will work is using the master branch. For that, use Proj::Conversion.new. I've spent a lot of time that last couple of weeks getting Proj updated to the Proj 9 and plan on cutting a new release this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants