From 91db74bd78e70a413aefb77418d471c4a459e2a5 Mon Sep 17 00:00:00 2001 From: Martijn Visser Date: Thu, 22 Dec 2022 21:52:03 +0100 Subject: [PATCH] add a line to the README, and avoid creating string --- README.md | 4 +++- src/crs.jl | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8544fbe..0e8c8fc 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,10 @@ Quickstart, based on the [PROJ docs](https://proj.org/development/quickstart.htm using Proj # Proj.jl implements the CoordinateTransformations.jl API. -# A Proj.Transformation needs the source and target coordinate reference systems. +# A Proj.Transformation needs the source and target coordinate reference systems (CRS), +# or a single pipeline. trans = Proj.Transformation("EPSG:4326", "+proj=utm +zone=32 +datum=WGS84") +# The CRS can be a string or the CRS type, which also interfaces with GeoFormatTypes.jl. # Once created, you can call this object to transform points. # The result will be a tuple of Float64s, of length 2, 3 or 4 depending on the input length. diff --git a/src/crs.jl b/src/crs.jl index c4c86f3..c0b7869 100644 --- a/src/crs.jl +++ b/src/crs.jl @@ -127,8 +127,9 @@ function GFT.ProjJSON(crs::CRS; ctx::Ptr{PJ_CONTEXT} = C_NULL) end function GFT.EPSG(crs::CRS) - code = proj_get_id_code(crs) - return GFT.EPSG("EPSG:" * code) + str = proj_get_id_code(crs) + code = parse(Int, str) + return GFT.EPSG(code) end Base.convert(T::Type{<:GFT.CoordinateReferenceSystemFormat}, crs::CRS) = T(crs)