Skip to content

Commit

Permalink
add a line to the README, and avoid creating string
Browse files Browse the repository at this point in the history
  • Loading branch information
visr committed Dec 22, 2022
1 parent ae09f46 commit 5400bf8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 3 additions & 2 deletions src/crs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5400bf8

Please sign in to comment.