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

Vertical transform failed #2074

Closed
aharondavid opened this issue Dec 1, 2019 · 6 comments
Closed

Vertical transform failed #2074

aharondavid opened this issue Dec 1, 2019 · 6 comments

Comments

@aharondavid
Copy link

Expected behavior and actual behavior.

GDAL (probably proj4) failed to read PROJ_LIB environment variable when the file path encoding
is different from the system local

Steps to reproduce the problem.

  1. set the PROJ_LIB environment variable to something different from your current local (for example c:\temp\档案文件\proj )

  2. add a egm96_15.gtx file to the above directory

  3. //source or destination used in WKT that contained the Vertical Datum egm96_15.gtx
    OGRCoordinateTransformation* p =OGRCreateCoordinateTransformation(source,dest);
    p>Transform(1,X,Y,Z) //failed !

Operating system

Windows 10

GDAL version and provenance

GDAL 2.2.2 proj4 4.9.3

@rouault
Copy link
Member

rouault commented Dec 1, 2019

Hum, non ANSI characters in the path. I'm not sure PROJ is ready for that as it uses the ANSI Windows API. In any case this is a PROJ issue. Should be filed at https://github.com/OSGeo/PROJ/issues

@rouault rouault closed this as completed Dec 1, 2019
@aharondavid
Copy link
Author

aharondavid commented Dec 2, 2019

Hello @rouault and thank you for your quick response.
I think that the proj4 already have a solution for that and GDAL just need to use it.
the solution is to overwrite the default file handling by using the proj4 api: pj_ctx_set_fileapi

@rouault
Copy link
Member

rouault commented Dec 2, 2019

I'd perfer not doing that in GDAL, but rahter that PROJ does the right thing by default...

@aharondavid
Copy link
Author

GDAL have a flag for that - GDAL_FILENAME_IS_UTF8.
what you think the PROJ default behavior should be? a new method that get a UNICODE ? maybe UTF8 ?. I think, they will say - we have an API for that - pj_ctx_set_fileapi and you may to use it

@rouault
Copy link
Member

rouault commented Dec 2, 2019

I'm part of the PROJ team as well :-) I'm not completely of the appropriate solution on PROJ side: perhaps indeed a PROJ_FILENAME_IS_UTF8 that we could make the default. But from a pure engineering point of view, as PROJ_LIB is a PROJ variable, that should be up to PROJ to have support for Unicode paths. Not GDAL trying to workaround it. And pj_ctx_set_fileapi is in the obsolete proj_api.h that GDAL 3 no longer uses. There's no direct equivalent in PROJ 6 proj.h API

@aharondavid
Copy link
Author

aharondavid commented Dec 2, 2019

Ok @rouault ,I opened the issue in PROJ:
OSGeo/PROJ#1765

Thanks !

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