/claim #150
So, let me explain what I was doing here, how did I end up just using the proj’s c calls directly because all the mappings were just too much with GDAL’s optional fields becoming default, their nonsense ordering etc.
Right now, in this PR, we are directly using the source of Proj’s calls. Without any middle-man, we https://github.com/JuliaBinaryWrappers/PROJ_jll.jl take it from here, https://proj.org/en/stable/development/reference/functions.html which their functions can be found here. Turns out, Proj always provided julia binaries to be used with ccall
of julia. So who else uses this?
https://github.com/JuliaGeo/Proj.jl
Right here, they also made a very small wrapper that is unlike GDAL, they abide by the standards of WKT and they also underhood, basically use proj’s c calls though in my pr it’s an updated version (latest) You guys can easily maintain this, easily add optional fields as you like. I kept it simple, true, strict by using the default behavior of Proj’s API, but it’s up to you to modify it even further if you guys wish for it. (GDAL does it, they add scope, area, bbox which are completely optional and make them default in their calls. Which is also another reason why we shouldn’t compare it against GDAL.)
Here is an example of this pr’s converter and GDAL’s results:
[ Info: String values differ at key 'name': World Geodetic System 1984 (G730) vs World Geodetic System 1984 (Transit)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G873) vs World Geodetic System 1984 (Transit)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G873) vs World Geodetic System 1984 (G730)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G1150) vs World Geodetic System 1984 (Transit)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G1150) vs World Geodetic System 1984 (G730)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G1150) vs World Geodetic System 1984 (G873)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G1674) vs World Geodetic System 1984 (Transit)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G1674) vs World Geodetic System 1984 (G730)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G1674) vs World Geodetic System 1984 (G873)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G1674) vs World Geodetic System 1984 (G1150)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G1762) vs World Geodetic System 1984 (Transit)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G1762) vs World Geodetic System 1984 (G730)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G1762) vs World Geodetic System 1984 (G873)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G1762) vs World Geodetic System 1984 (G1150)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G1762) vs World Geodetic System 1984 (G1674)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G2139) vs World Geodetic System 1984 (Transit)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G2139) vs World Geodetic System 1984 (G730)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G2139) vs World Geodetic System 1984 (G873)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G2139) vs World Geodetic System 1984 (G1150)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G2139) vs World Geodetic System 1984 (G1674)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G2139) vs World Geodetic System 1984 (G1762)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G2296) vs World Geodetic System 1984 (Transit)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G2296) vs World Geodetic System 1984 (G730)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G2296) vs World Geodetic System 1984 (G873)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G2296) vs World Geodetic System 1984 (G1150)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G2296) vs World Geodetic System 1984 (G1674)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G2296) vs World Geodetic System 1984 (G1762)
[ Info: String values differ at key 'name': World Geodetic System 1984 (G2296) vs World Geodetic System 1984 (G2139)
[ Info: String values differ at key 'name': Geodetic longitude vs Geodetic latitude
Obviously left side is this pr, right side is GDAL. This is why I didn’t add GDAL comparison to tests, as it’s just too much work with if/else conditions to one by one get away from GDAL’s nasty behavior.
As for the json file, i provided the default schema we can validate as well so in the test_data folder do these to validate it manually:
npm install -g ajv-cli
Our tool for validating the schema.
then use
ajv validate -s projjson.schema.json -d projjson_epsg4326.json
This will use projjson’s schema against our epsg4326 to prove it’s valid.
Happy easter!
Denizhan Dakılır
@zelosleone
JuliaEarth
@JuliaEarth