Skip to content

Commit d8c7c22

Browse files
authored
Merge pull request #33 from JuliaGeo/v1-traits
New (breaking) Traits based release
2 parents 5faebcf + b5f5675 commit d8c7c22

30 files changed

+1878
-558
lines changed

.github/workflows/CI.yml

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
name: CI
22
on:
3-
pull_request:
43
push:
54
branches:
6-
- master
7-
tags: '*'
5+
- main
6+
tags: "*"
7+
pull_request:
8+
concurrency:
9+
# Skip intermediate builds: always.
10+
# Cancel intermediate builds: only if it is a pull request build.
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
813
jobs:
914
test:
1015
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
@@ -13,13 +18,11 @@ jobs:
1318
fail-fast: false
1419
matrix:
1520
version:
16-
- '1.0'
17-
- '1'
18-
- 'nightly'
21+
- "1"
22+
- "1.6"
23+
- "nightly"
1924
os:
2025
- ubuntu-latest
21-
- macOS-latest
22-
- windows-latest
2326
arch:
2427
- x64
2528
steps:
@@ -28,19 +31,29 @@ jobs:
2831
with:
2932
version: ${{ matrix.version }}
3033
arch: ${{ matrix.arch }}
31-
- uses: actions/cache@v1
32-
env:
33-
cache-name: cache-artifacts
34-
with:
35-
path: ~/.julia/artifacts
36-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
37-
restore-keys: |
38-
${{ runner.os }}-test-${{ env.cache-name }}-
39-
${{ runner.os }}-test-
40-
${{ runner.os }}-
34+
- uses: julia-actions/cache@v1
4135
- uses: julia-actions/julia-buildpkg@v1
4236
- uses: julia-actions/julia-runtest@v1
4337
- uses: julia-actions/julia-processcoverage@v1
44-
- uses: codecov/codecov-action@v1
38+
- uses: codecov/codecov-action@v2
39+
with:
40+
files: lcov.info
41+
docs:
42+
name: Documentation
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v2
46+
- uses: julia-actions/setup-julia@v1
4547
with:
46-
file: lcov.info
48+
version: "1"
49+
- uses: julia-actions/julia-buildpkg@v1
50+
- uses: julia-actions/julia-docdeploy@v1
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
54+
- run: |
55+
julia --project=docs -e '
56+
using Documenter: DocMeta, doctest
57+
using GeoInterface
58+
DocMeta.setdocmeta!(GeoInterface, :DocTestSetup, :(using GeoInterface); recursive=true)
59+
doctest(GeoInterface)'

.github/workflows/CompatHelper.yml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,10 @@ jobs:
77
CompatHelper:
88
runs-on: ubuntu-latest
99
steps:
10-
- name: "Add the General registry via Git"
11-
run: |
12-
import Pkg
13-
ENV["JULIA_PKG_SERVER"] = ""
14-
Pkg.Registry.add("General")
15-
shell: julia --color=yes {0}
16-
- name: "Install CompatHelper"
17-
run: |
18-
import Pkg
19-
name = "CompatHelper"
20-
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
21-
version = "3"
22-
Pkg.add(; name, uuid, version)
23-
shell: julia --color=yes {0}
24-
- name: "Run CompatHelper"
25-
run: |
26-
import CompatHelper
27-
CompatHelper.main()
28-
shell: julia --color=yes {0}
10+
- name: Pkg.add("CompatHelper")
11+
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
12+
- name: CompatHelper.main()
2913
env:
3014
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3115
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
32-
# COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}
16+
run: julia -e 'using CompatHelper; CompatHelper.main()'

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
*.jl.cov
22
*.jl.mem
3+
/Manifest.toml
4+
/docs/build/
5+
.DS_Store
6+
docs/src/reference/integrations.md

INTEGRATIONS.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Packages
2+
Packages currently integrating with GeoInterface.jl:
3+
* [AlgebraOfGraphics](https://github.com/JuliaPlots/AlgebraOfGraphics.jl.git)
4+
* [ArchGDAL](https://github.com/yeesian/ArchGDAL.jl.git)
5+
* [GADM](https://github.com/JuliaGeo/GADM.jl.git)
6+
* [GeoData](https://github.com/rafaqz/GeoData.jl.git)
7+
* [GeoDatasets](https://github.com/JuliaGeo/GeoDatasets.jl.git)
8+
* [GeoJSON](https://github.com/JuliaGeo/GeoJSON.jl.git)
9+
* [GeoMakie](https://github.com/JuliaPlots/GeoMakie.jl.git)
10+
* [GeoTables](https://github.com/JuliaEarth/GeoTables.jl.git)
11+
* [LibGEOS](https://github.com/JuliaGeo/LibGEOS.jl.git)
12+
* [Mangal](https://github.com/EcoJulia/Mangal.jl.git)
13+
* [OmniSci](https://github.com/omnisci/OmniSci.jl.git)
14+
* [Rasters](https://github.com/rafaqz/Rasters.jl.git)
15+
* [Shapefile](https://github.com/JuliaGeo/Shapefile.jl.git)
16+
* [SpatialDependence](https://github.com/javierbarbero/SpatialDependence.jl.git)
17+
* [Turf](https://github.com/philoez98/Turf.jl.git)

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The GeoInterface.jl package is licensed under the MIT "Expat" License:
22

3-
> Copyright (c) 2015: Yeesian Ng.
3+
> Copyright (c) 2015: Yeesian Ng, Julia Computing
44
>
55
> Permission is hereby granted, free of charge, to any person obtaining
66
> a copy of this software and associated documentation files (the

Project.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
name = "GeoInterface"
22
uuid = "cf35fbd7-0cd7-5166-be24-54bfbe79505f"
3-
license = "MIT"
4-
version = "0.5.7"
3+
authors = ["JuliaGeo and contributors"]
4+
version = "1.0.0"
55

66
[deps]
7-
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
7+
Extents = "411431e0-e8b7-467b-b5e0-f676ba4f2910"
88

99
[compat]
10-
RecipesBase = "0.6, 0.7, 0.8, 1.0"
1110
julia = "1"
1211

1312
[extras]
13+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
1414
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1515

1616
[targets]
17-
test = ["Test"]
17+
test = ["Test", "Documenter"]

README.md

Lines changed: 14 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,18 @@
1-
# GeoInterface.jl
1+
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://juliageo.github.io/GeoInterface.jl/stable)
2+
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://juliageo.github.io/GeoInterface.jl/dev)
3+
[![Build Status](https://github.com/JuliaGeo/GeoInterface.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/JuliaGeo/GeoInterface.jl/actions/workflows/CI.yml?query=branch%3Amain)
24

3-
A Julia Protocol for Geospatial Data
5+
# GeoInterface
6+
An interface for geospatial vector data in [Julia](https://julialang.org/).
47

5-
## Motivation
6-
To support operations or visualization of multiple (but similar) implementations of vector data (across `GeoJSON.jl`, `LibGEOS.jl`, etc). As a starting point, it will follow the [GEO interface](https://gist.github.com/sgillies/2217756) [1] in Python (which in turn borrows its design from the [GeoJSON specification](http://geojson.org/) [2]).
8+
This Package describe a set of traits based on the [Simple Features standard
9+
(SF)](https://www.opengeospatial.org/standards/sfa) for geospatial vector data, including
10+
the SQL/MM extension with support for circular geometry. Using these traits, it should be
11+
easy to parse, serialize and use different geometries in the Julia ecosystem, without
12+
knowing the specifics of each individual package. In that regard it is similar to
13+
[Tables.jl](https://github.com/JuliaData/Tables.jl), but for geometries instead of tables.
714

8-
## GEO Interface
15+
Packages which support the GeoInterface.jl interface can be found in
16+
[INTEGRATIONS.md](INTEGRATIONS.md).
917

10-
### AbstractPosition
11-
A position can be thought of as a tuple of numbers. There must be at least two elements, and may be more. The order of elements must follow `x`, `y`, `z` order (e.g. easting, northing, altitude for coordinates in a projected coordinate reference system, or longitude, latitude, altitude for coordinates in a geographic coordinate reference system). It requires the following methods:
12-
13-
- `xcoord(::AbstractPosition)::Float64`
14-
- `ycoord(::AbstractPosition)::Float64`
15-
- `zcoord(::AbstractPosition)::Float64`
16-
- `hasz(::AbstractPosition)::Bool` (`false` by default)
17-
18-
Remark: Although the specification allows the representation of up to 3 dimensions, not all algorithms support require all 3 dimensions. Also, if you are working with an arbitrary `obj::AbstractPosition`, you should call `hasz(obj)` before calling `zcoord(obj)`.
19-
20-
### AbstractGeometry
21-
Represents vector geometry, and encompasses the following abstract types: `AbstractPoint, AbstractMultiPoint, AbstractLineString, AbstractMultiLineString, AbstractMultiPolygon, AbstractPolygon`. It requires the `coordinates` method, where
22-
23-
- `coordinates(::AbstractPoint)` returns a single position.
24-
- `coordinates(::AbstractMultiPoint)` returns a vector of positions.
25-
- `coordinates(::AbstractLineString)` returns a vector of positions.
26-
- `coordinates(::AbstractMultiLineString)` returns a vector of linestrings.
27-
- `coordinates(::AbstractPolygon)` returns a vector of linestrings.
28-
- `coordinates(::AbstractMultiPolygon)` returns a vector of polygons.
29-
30-
### AbstractGeometryCollection
31-
Represents a collection of geometries, and requires the `geometries` method, which returns a vector of geometries. Is also a subtype of `AbstractGeometry`.
32-
33-
### AbstractFeature
34-
Represents a geometry with additional attributes, and requires the following methods
35-
36-
- `geometry(::AbstractFeature)::AbstractGeometry` returns the corresponding geometry
37-
- `properties(::AbstractFeature)::Dict{AbstractString,Any}` returns a dictionary of the properties
38-
39-
Optionally, you can also provide the following methods
40-
41-
- `bbox(::AbstractFeature)::AbstractGeometry` returns the bounding box for that feature
42-
- `crs(::AbstractFeature)::Dict{AbstractString,Any}` returns the coordinate reference system
43-
44-
## Geospatial Geometries
45-
If you don't need to provide your own user types, GeoInterface also provides a set of geometries (below), which implements the GEO Interface:
46-
47-
- `CRS`
48-
- `Position`
49-
- `Geometry <: AbstractGeometry`
50-
- `Point <: AbstractPoint <: AbstractGeometry`
51-
- `MultiPoint <: AbstractMultiPoint <: AbstractGeometry`
52-
- `LineString <: AbstractLineString <: AbstractGeometry`
53-
- `MultiLineString <: AbstractMultiLineString <: AbstractGeometry`
54-
- `Polygon <: AbstractPolygon <: AbstractGeometry`
55-
- `MultiPolygon <: AbstractMultiPolygon <: AbstractGeometry`
56-
- `GeometryCollection <: AbstractGeometryCollection <: AbstractGeometry`
57-
- `Feature <: AbstractFeature`
58-
- `FeatureCollection <: AbstractFeatureCollection`
59-
60-
## Remarks
61-
62-
Conceptually,
63-
64-
- an `::AbstractGeometryCollection` maps to a `DataArray{::AbstractGeometry}`, and
65-
- an `::AbstractFeatureCollection` maps to a `DataFrame`, where each row is an `AbstractFeature`
66-
67-
The design of the types in GeoInterface differs from the GeoJSON specification in the following ways:
68-
69-
- Julia Geometries do not provide a `bbox` and `crs` method. If you wish to provide a `bbox` or `crs` attribute, wrap the geometry into a `Feature` or `FeatureCollection`.
70-
- Features do not have special fields for `id`, `bbox`, and `crs`. These are to be provided (or found) in the `properties` field, under the keys `featureid`, `bbox`, and `crs` respectively (if they exist).
71-
72-
## References
73-
74-
[1]: A Python Protocol for Geospatial Data ([gist](https://gist.github.com/sgillies/2217756))
75-
76-
[2]: GeoJSON Specification ([website](http://geojson.org/))
18+
We thank Julia Computing for supporting contributions to this package.

docs/Manifest.toml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# This file is machine-generated - editing it directly is not advised
2+
3+
julia_version = "1.7.2"
4+
manifest_format = "2.0"
5+
6+
[[deps.ANSIColoredPrinters]]
7+
git-tree-sha1 = "574baf8110975760d391c710b6341da1afa48d8c"
8+
uuid = "a4c015fc-c6ff-483c-b24f-f7ea428134e9"
9+
version = "0.0.1"
10+
11+
[[deps.Base64]]
12+
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
13+
14+
[[deps.Dates]]
15+
deps = ["Printf"]
16+
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
17+
18+
[[deps.DocStringExtensions]]
19+
deps = ["LibGit2"]
20+
git-tree-sha1 = "b19534d1895d702889b219c382a6e18010797f0b"
21+
uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
22+
version = "0.8.6"
23+
24+
[[deps.Documenter]]
25+
deps = ["ANSIColoredPrinters", "Base64", "Dates", "DocStringExtensions", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"]
26+
git-tree-sha1 = "7d9a46421aef53cbd6b8ecc40c3dcbacbceaf40e"
27+
uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
28+
version = "0.27.15"
29+
30+
[[deps.Extents]]
31+
git-tree-sha1 = "a087a23129ac079d43ba6b534c6350325fcd41c9"
32+
uuid = "411431e0-e8b7-467b-b5e0-f676ba4f2910"
33+
version = "0.1.0"
34+
35+
[[deps.GeoInterface]]
36+
deps = ["Extents", "RecipesBase"]
37+
path = ".."
38+
uuid = "cf35fbd7-0cd7-5166-be24-54bfbe79505f"
39+
version = "1.0.0"
40+
41+
[[deps.IOCapture]]
42+
deps = ["Logging", "Random"]
43+
git-tree-sha1 = "f7be53659ab06ddc986428d3a9dcc95f6fa6705a"
44+
uuid = "b5f81e59-6552-4d32-b1f0-c071b021bf89"
45+
version = "0.2.2"
46+
47+
[[deps.InteractiveUtils]]
48+
deps = ["Markdown"]
49+
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
50+
51+
[[deps.JSON]]
52+
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
53+
git-tree-sha1 = "3c837543ddb02250ef42f4738347454f95079d4e"
54+
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
55+
version = "0.21.3"
56+
57+
[[deps.LibGit2]]
58+
deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
59+
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
60+
61+
[[deps.Logging]]
62+
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
63+
64+
[[deps.Markdown]]
65+
deps = ["Base64"]
66+
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
67+
68+
[[deps.Mmap]]
69+
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
70+
71+
[[deps.NetworkOptions]]
72+
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
73+
74+
[[deps.Parsers]]
75+
deps = ["Dates"]
76+
git-tree-sha1 = "621f4f3b4977325b9128d5fae7a8b4829a0c2222"
77+
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
78+
version = "2.2.4"
79+
80+
[[deps.Printf]]
81+
deps = ["Unicode"]
82+
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
83+
84+
[[deps.REPL]]
85+
deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"]
86+
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
87+
88+
[[deps.Random]]
89+
deps = ["SHA", "Serialization"]
90+
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
91+
92+
[[deps.RecipesBase]]
93+
git-tree-sha1 = "6bf3f380ff52ce0832ddd3a2a7b9538ed1bcca7d"
94+
uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
95+
version = "1.2.1"
96+
97+
[[deps.SHA]]
98+
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
99+
100+
[[deps.Serialization]]
101+
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
102+
103+
[[deps.Sockets]]
104+
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
105+
106+
[[deps.Test]]
107+
deps = ["InteractiveUtils", "Logging", "Random", "Serialization"]
108+
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
109+
110+
[[deps.Unicode]]
111+
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"

docs/Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[deps]
2+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
GeoInterface = "cf35fbd7-0cd7-5166-be24-54bfbe79505f"

0 commit comments

Comments
 (0)