JU

Working towards #150 /claim #150

Todo:

  • Better and consistent error msgs
  • Figure out the proper workaround of the semi_minor_axis inverse_flattening discrepancy (4275, 4267)
    • Elaborate on the find_diff_paths workaround.
  • Adjust test/jsonutils.jl to project style
  • Decide whether tests can actually depend on DeepDiffs Found better alternative solution.
  • Comply with JuliaFormatter
Tools for live development and debugging
# Use DeepDiffs package to view any differences between GDAL's projjson (j1) and our's (j2).
# Differences are shown red/green color. Few insignificant keys are filtered from (j1),
# though there are still more false-negatives than deltapaths filtering
function deepdiffprojjson(j1::J, j2::J) where {J<:Union{Dict}}
j1 = deepcopy(j1)
keystodelete = ["bbox", "area", "scope", "usages", "\$schema"]
for k in keystodelete
delete!(j1, k)
end
try
delete!(j1["base_crs"], "coordinate_system")
catch
nothing
end
diff = deepdiff(j1, j2)
return diff
end
# For live development or debugging.
# run checkprojjson(4275) to see differences between current and expected json output
# The presence of red/green colored output does not neccesarly mean that there is a bug to be fixed.
# If the last printed line is an empty vector, it means the colored diff is likely a superfluous difference.
function checkprojjson(crs::Int; verbose=true)
gdaljson = gdalprojjsondict(EPSG{crs})
wktdict = GeoIO.epsg2wktdict(crs)
jsondict = GeoIO.wkt2json(wktdict)
# Show pretty-printed WKT if possible
if verbose && isdefined(Main, :PrettyPrinting)
@info "Parsed WKT"
pprintln(wktdict)
elseif verbose
@warn "Formatted printing of WKT or JSON is unavailable because PrettyPrinting is not loaded"
end
# Show deep diff if possible
if verbose && isdefined(Main, :DeepDiffs)
@info "DeepDiff"
display(deepdiffprojjson(gdaljson, jsondict))
elseif verbose
@warn "Detailed colored output is unavailable because DeepDiffs is not loaded."
end
diffkeys = deltaprojjson(gdaljson, jsondict)
@info "JSON keys with a potentially significant difference from expected output:"
display(diffkeys)
end

Claim

Total prize pool $400
Total paid $400
Status Approved
Submitted May 22, 2025
Last updated May 22, 2025

Contributors

OM

Omar Elrefaei

@Omar-Elrefaei

100%

Sponsors

JU

JuliaEarth

@JuliaEarth

$400 paid