Skip to content

Commit

Permalink
Implements non standard Linearring. (#38)
Browse files Browse the repository at this point in the history
* Implements non standard Linearring.

* Update CI to use LTS.

* Update to lts.
  • Loading branch information
evetion authored Nov 6, 2024
1 parent a34201e commit 6682a25
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
version:
- "1.6"
- "lts"
- "1"
- "nightly"
os:
Expand All @@ -44,8 +44,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: "1"
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-docdeploy@v1
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: "1.6"
version: "1.10"
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ uuid = "0f680547-7be7-4555-8820-bb198eeb646b"
authors = [
"Maarten Pronk <[email protected]> and contributors."
]
version = "0.2.4"
version = "0.2.5"

[deps]
GeoFormatTypes = "68eda718-8dee-11e9-39e7-89f7f65f511f"
Expand All @@ -12,7 +12,7 @@ GeoInterface = "cf35fbd7-0cd7-5166-be24-54bfbe79505f"
[compat]
GeoFormatTypes = "0.4"
GeoInterface = "1.0"
julia = "1.6"
julia = "1.10"

[extras]
ArchGDAL = "c9ce4bd3-c3d5-55b8-8973-c0e20141b8c3"
Expand Down
2 changes: 1 addition & 1 deletion src/wkb.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ is true for a GeometryCollection, when the subgeometry types are not known befor
const PointTraitCode = UInt32(1)
geometry_code(::GI.PointTrait) = PointTraitCode
const LineStringTraitCode = UInt32(2)
geometry_code(::GI.LineStringTrait) = LineStringTraitCode
geometry_code(::GI.AbstractLineStringTrait) = LineStringTraitCode
const PolygonTraitCode = UInt32(3)
geometry_code(::GI.PolygonTrait) = PolygonTraitCode
const MultiPointTraitCode = UInt32(4)
Expand Down
1 change: 1 addition & 0 deletions src/wkt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ POLYGON (((35 10, 45 45, 15 40, 10 20, 35 10),
const geowkt = Dict{DataType,String}(
GI.PointTrait => "POINT",
GI.LineStringTrait => "LINESTRING",
GI.LinearRingTrait => "LINEARRING",
GI.PolygonTrait => "POLYGON",
GI.MultiPointTrait => "MULTIPOINT",
GI.MultiLineStringTrait => "MULTILINESTRING",
Expand Down
12 changes: 12 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,16 @@ import LibGEOS
0x00,
0x40]
end

@testset "Simple wrapper Polygon #37" begin
GI.astext(GI.Polygon([GI.LinearRing([(50, 60), (50, 61), (51, 61), (51, 60), (50, 60)])]))
GI.asbinary(GI.Polygon([GI.LinearRing([(50, 60), (50, 61), (51, 61), (51, 60), (50, 60)])]))
end

@testset "LinearRing #36" begin
rings = GI.astext(GI.LinearRing([(50, 60), (50, 61), (51, 61), (51, 60), (50, 60)]))
@test GI.geomtrait(rings) == GI.LinearRingTrait()
ringb = GI.asbinary(GI.LinearRing([(50, 60), (50, 61), (51, 61), (51, 60), (50, 60)]))
@test GI.geomtrait(ringb) == GI.LineStringTrait()
end
end

0 comments on commit 6682a25

Please sign in to comment.