-
Notifications
You must be signed in to change notification settings - Fork 9
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
use Clang to wrap PROJ 6.1.0 #27
Conversation
Very cool 🎉 |
Ha, with the new rewriter it becomes much more fun to rewrite wrapped functions. In d1d4bb5 I made all Here is the doxygen.xml.gz for if anyone wants to run it. We could take it further and do this for all essentially optional parameters. That would make some functions much easier to use, for instance Some things left to do:
|
This code is mostly copy pasted from JuliaGeo/GDAL.jl#73. Three transformations are applied: - docstrings are added, created from PROJ Doxygen XML output - functions that return a Cstring are wrapped in unsafe_string to return a String - functions that return a Ptr{Cstring} are wrapped in unsafe_loadstringlist to return a Vector{String}
C_NULL means default context
* add tests * reorder the tests
adds space to `ctx=C_NULL`
This handler, `log_func`, is registered in `__init__`. It simply throws when the level is at error, and ignores otherwise. Based on pyproj4/pyproj#215.
Start using a generic `aftercare` function just like in GDAL.jl.
They always have defaults when C_NULL is passed, so we can just use keyword arguments here.
Ok I still added some error handling support. If PROJ throws an error that is turned into a Julia exception. Note that I am currently not checking each Furthermor I still attempted to make using this interface a bit more pleasant, by turning some arguments into keyword arguments defaulting to C_NULL, when the docs stated this was accepted as well. Test coverage is not yet great, but what we did test works well, and actually I think this is large enough a PR as is. @yeesian do you think this is ok to merge? No rush. |
This is incredible work, thanks! Yeah I think it is god enough to be merged; we can increase coverage after the fact (like with LibGEOS) |
High praise indeed! Ok merging within a day or so, unless someone else wants to have a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Some minor comments.
Thanks for the comments Yeesian, much appreciated. Addressed them in the latest commit. |
I plan to finish JuliaGeo/GDAL.jl#66 first, but since that is now stuck on PROJ_LIB related issues, it's convenient to have the new API at hand. Lessons learned there will probably have to be applied here too.
ref https://discourse.julialang.org/t/setting-env-for-a-shared-library-in-init/24724/