From 46720082e2c71b80f3338fa698d63a72089a2b6b Mon Sep 17 00:00:00 2001 From: Rafael Schouten Date: Sun, 18 May 2025 00:19:09 +0200 Subject: [PATCH] add GeoFormatyTypes convert method piracy --- src/crs.jl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/crs.jl b/src/crs.jl index f3c8c18..314467c 100644 --- a/src/crs.jl +++ b/src/crs.jl @@ -141,6 +141,12 @@ Base.convert(T::Type{<:GFT.CoordinateReferenceSystemFormat}, crs::CRS) = T(crs) Base.convert(::Type{CRS}, crs::GFT.CoordinateReferenceSystemFormat) = CRS(crs) Base.convert(T::Type{<:GFT.MixedFormat}, crs::CRS) = T(crs) Base.convert(::Type{CRS}, crs::GFT.MixedFormat{<:MaybeGFTCRS}) = CRS(crs) +# Blessed type pyracy +Base.convert(T::Type{<:GFT.GeoFormat}, ::GFT.CRS, crs::GFT.ProjJSON) = + T(CRS(crs)) +Base.convert(T::Type{<:GFT.ProjJSON}, ::GFT.CRS, crs::GFT.GeoFormat) = + T(CRS(crs)) + # Maybe enable later, based on https://github.com/JuliaGeo/GeoFormatTypes.jl/issues/21 # Base.convert(T::Type{<:GFT.CoordinateReferenceSystemFormat}, crs::GFT.CoordinateReferenceSystemFormat) = T(CRS(crs)) @@ -179,4 +185,4 @@ function identify( proj_int_list_destroy(out_confidence[]) end return list -end +end \ No newline at end of file