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

Custom World Bonne on Southern Hemisphere not working #3848

Closed
alphaandromeda opened this issue Aug 9, 2023 · 2 comments
Closed

Custom World Bonne on Southern Hemisphere not working #3848

alphaandromeda opened this issue Aug 9, 2023 · 2 comments
Assignees
Labels

Comments

@alphaandromeda
Copy link

alphaandromeda commented Aug 9, 2023

Example of problem

Custom World Bonne on Southern Hemisphere not working

Used wkt (negative Longitude of natural origin):

PROJCRS["World_Bonne",
    BASEGEOGCRS["WGS 84",
        DATUM["World Geodetic System 1984",
            ELLIPSOID["WGS 84",6378137,298.257223563,
                LENGTHUNIT["metre",1,
                    ID["EPSG",9001]]]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8901]]],
    CONVERSION["World_Bonne",
        METHOD["Bonne",
            ID["EPSG",9827]],
        PARAMETER["Latitude of natural origin",-60,
            ANGLEUNIT["Degree",0.0174532925199433],
            ID["EPSG",8801]],
        PARAMETER["Longitude of natural origin",0,
            ANGLEUNIT["Degree",0.0174532925199433],
            ID["EPSG",8802]],
        PARAMETER["False easting",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8806]],
        PARAMETER["False northing",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8807]]],
    CS[Cartesian,2],
        AXIS["(E)",east,
            ORDER[1],
            LENGTHUNIT["metre",1,
                ID["EPSG",9001]]],
        AXIS["(N)",north,
            ORDER[2],
            LENGTHUNIT["metre",1,
                ID["EPSG",9001]]],
    USAGE[
        SCOPE["Not known."],
        AREA["World."],
        BBOX[-90,-180,90,180]]]

C code:

RawByteString srcUtf8 (UTF8Encode (wkt));
srcTmp = proj_create (ProjContext, srcUtf8.c_str());
...
RawByteString tgtUtf8 (UTF8Encode (gcsOfSrc));
tgtTmp = proj_create (ProjContext, tgtUtf8.c_str());
...
const char *const options[] = {"FORCE_OVER=YES", nullptr /* muss mit null terminieren!*/};
ProjTransformer = proj_create_crs_to_crs_from_pj (ProjContext, srcTmp, tgtTmp, nullptr, options);
...
pjPnt = proj_trans (ProjTransformer, PJ_FWD, pjPnt);

Problem description

Transformer from GCS to CRS works as expected: 10°/-40° -> 850976.57/2163022.81.
Transformer from the above CRS to it's GCS (geo) does not work - throws!

Expected Output

850976.57/2163022.81 (CRS) -> 10°/-40° (GCS)

Environment Information

  • PROJ version 9.1.1
  • Operation System Information

Installation method

  • C-Api via DLLs
@mwtoews
Copy link
Member

mwtoews commented Aug 10, 2023

I'm seeing the error:

input string: parsing of user string failed: unhandled parameter value type : **-60**

Is the verbatim WKT in the issue correct? Changing **-60** to -60 should fix the issue.

@alphaandromeda
Copy link
Author

It is not that easy - use -60 as value and you get the error.
(I tried to markup it as bold thats why ** is inside wkt).

@rouault rouault self-assigned this Aug 10, 2023
rouault added a commit to rouault/PROJ that referenced this issue Aug 10, 2023
…SGeo#3848)

The fixes are directly following hints of Snyder's "Map projections: A
working manual"
rouault added a commit to rouault/PROJ that referenced this issue Aug 11, 2023
…SGeo#3848)

The fixes are directly following hints of Snyder's "Map projections: A
working manual"
rouault added a commit that referenced this issue Aug 11, 2023
bonne: fix inverse map projection computations when lat_1 < 0 (fixes #3848)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants