-
Notifications
You must be signed in to change notification settings - Fork 19
New (breaking) Traits based release #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from 9 commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
0ce3aaa
Moved from GeoInterfaceRFC.jl
evetion 7f7fa43
Renamed all RFC occurences.
evetion 668dc52
Small update.
evetion f7fc274
Merge branch 'master' into v1-traits
evetion d47dd88
Fix review comments.
evetion 5ce639b
Use `isgeometry` as a first check.
evetion 47281c4
Updated integrations.
evetion 27dc9fe
Improved documentation.
evetion b727c07
Updated docs. Fixed bugs.
evetion 4637713
Update src/defaults.jl
evetion 45dd59a
Update docs/src/guides/developer.md
evetion 2ae9581
Changes based on ArchGDAL implementation.
evetion b252cd1
Fixed tests.
evetion 33df32f
Reverted Type traits. Suffixed Trait to all types.
evetion 49a4d11
Add Julia Computing as contributor. Fix `isempty` and add `convert` m…
evetion 7af21e4
Add `asbinary` and `astext` (wkb and wkt) methods.
evetion 1ba01f5
Added iterators. Added feature interface. Updated documentation based…
evetion e6feb6b
Removed unused import.
evetion 0df59c9
add getring function to the interface
rafaqz 497abd3
add getpoint iterators
rafaqz 40c4bcc
bugfix defaults
rafaqz b15d130
fix functions and standardise iterator docstrings
rafaqz c537100
bugfix
rafaqz 49644d7
Merge pull request #47 from JuliaGeo/rs/getrings
evetion 9ab7e2c
Fixed doc reference. Removed duplicate getring function.
evetion 7ee9ace
Added doctests. Expanded the documentation.
evetion 1805746
Fixed bug in coordinates.
evetion 567683b
Fix bug in x, y, z, m lookup in getcoord.
evetion ddee198
Improved performance of coordinate name lookup.
evetion 6303188
standardise trait arg passing
rafaqz 66b68e4
Merge pull request #48 from JuliaGeo/rs/standardise_traitargs
evetion 3305aef
Completed subtrait method.
evetion 19946d7
Fixed doctest.
evetion fa4a26d
Fixed bugs in nested iterator. Expanded tests and enabled code coverage.
evetion 4630f13
rename defaults.jl to fallbacks.jl
visr 2c00af7
editing
visr 69b38a7
replace argument _ with geom
visr 7bef237
drop module name for exported functions
visr d1d9589
fix tests
visr f98a139
export the traits
visr cfadd5e
Merge pull request #50 from JuliaGeo/export-traits
evetion ccd276a
Update .github/workflows/CI.yml
evetion 8468fa9
Merge pull request #49 from JuliaGeo/check
evetion 2cc0e07
Expanded tests.
evetion a22db09
Documented conversion interface.
evetion b5f5675
Expanded test coverage more.
evetion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,7 @@ | ||
| *.jl.cov | ||
| *.jl.mem | ||
| /Manifest.toml | ||
| /docs/build/ | ||
| .DS_Store | ||
| docs/src/reference/integrations.md | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # Packages | ||
| Packages currently integrating with GeoInterface.jl: | ||
| * [AlgebraOfGraphics](https://github.com/JuliaPlots/AlgebraOfGraphics.jl.git) | ||
| * [ArchGDAL](https://github.com/yeesian/ArchGDAL.jl.git) | ||
| * [GADM](https://github.com/JuliaGeo/GADM.jl.git) | ||
| * [GeoData](https://github.com/rafaqz/GeoData.jl.git) | ||
| * [GeoDatasets](https://github.com/JuliaGeo/GeoDatasets.jl.git) | ||
| * [GeoJSON](https://github.com/JuliaGeo/GeoJSON.jl.git) | ||
| * [GeoMakie](https://github.com/JuliaPlots/GeoMakie.jl.git) | ||
| * [GeoTables](https://github.com/JuliaEarth/GeoTables.jl.git) | ||
| * [LibGEOS](https://github.com/JuliaGeo/LibGEOS.jl.git) | ||
| * [Mangal](https://github.com/EcoJulia/Mangal.jl.git) | ||
| * [OmniSci](https://github.com/omnisci/OmniSci.jl.git) | ||
| * [Rasters](https://github.com/rafaqz/Rasters.jl.git) | ||
| * [Shapefile](https://github.com/JuliaGeo/Shapefile.jl.git) | ||
| * [SpatialDependence](https://github.com/javierbarbero/SpatialDependence.jl.git) | ||
| * [Turf](https://github.com/philoez98/Turf.jl.git) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,76 +1,13 @@ | ||
| # GeoInterface.jl | ||
| [](https://juliageo.github.io/GeoInterface.jl/stable) | ||
| [](https://juliageo.github.io/GeoInterface.jl/dev) | ||
| [](https://github.com/JuliaGeo/GeoInterface.jl/actions/workflows/CI.yml?query=branch%3Amain) | ||
|
|
||
| A Julia Protocol for Geospatial Data | ||
| # GeoInterface | ||
| An interface for geospatial vector data in Julia | ||
|
|
||
| ## Motivation | ||
| 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]). | ||
| This Package describe a set of traits based on the [Simple Features standard (SF)](https://www.opengeospatial.org/standards/sfa) | ||
| for geospatial vector data, including the SQL/MM extension with support for circular geometry. | ||
| Using these traits, it should be easy to parse, serialize and use different geometries in the Julia ecosystem, | ||
| without knowing the specifics of each individual package. In that regard it is similar to Tables.jl, but for geometries instead of tables. | ||
|
|
||
| ## GEO Interface | ||
|
|
||
| ### AbstractPosition | ||
| 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: | ||
|
|
||
| - `xcoord(::AbstractPosition)::Float64` | ||
| - `ycoord(::AbstractPosition)::Float64` | ||
| - `zcoord(::AbstractPosition)::Float64` | ||
| - `hasz(::AbstractPosition)::Bool` (`false` by default) | ||
|
|
||
| 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)`. | ||
|
|
||
| ### AbstractGeometry | ||
| Represents vector geometry, and encompasses the following abstract types: `AbstractPoint, AbstractMultiPoint, AbstractLineString, AbstractMultiLineString, AbstractMultiPolygon, AbstractPolygon`. It requires the `coordinates` method, where | ||
|
|
||
| - `coordinates(::AbstractPoint)` returns a single position. | ||
| - `coordinates(::AbstractMultiPoint)` returns a vector of positions. | ||
| - `coordinates(::AbstractLineString)` returns a vector of positions. | ||
| - `coordinates(::AbstractMultiLineString)` returns a vector of linestrings. | ||
| - `coordinates(::AbstractPolygon)` returns a vector of linestrings. | ||
| - `coordinates(::AbstractMultiPolygon)` returns a vector of polygons. | ||
|
|
||
| ### AbstractGeometryCollection | ||
| Represents a collection of geometries, and requires the `geometries` method, which returns a vector of geometries. Is also a subtype of `AbstractGeometry`. | ||
|
|
||
| ### AbstractFeature | ||
| Represents a geometry with additional attributes, and requires the following methods | ||
|
|
||
| - `geometry(::AbstractFeature)::AbstractGeometry` returns the corresponding geometry | ||
| - `properties(::AbstractFeature)::Dict{AbstractString,Any}` returns a dictionary of the properties | ||
|
|
||
| Optionally, you can also provide the following methods | ||
|
|
||
| - `bbox(::AbstractFeature)::AbstractGeometry` returns the bounding box for that feature | ||
| - `crs(::AbstractFeature)::Dict{AbstractString,Any}` returns the coordinate reference system | ||
|
|
||
| ## Geospatial Geometries | ||
| If you don't need to provide your own user types, GeoInterface also provides a set of geometries (below), which implements the GEO Interface: | ||
|
|
||
| - `CRS` | ||
| - `Position` | ||
| - `Geometry <: AbstractGeometry` | ||
| - `Point <: AbstractPoint <: AbstractGeometry` | ||
| - `MultiPoint <: AbstractMultiPoint <: AbstractGeometry` | ||
| - `LineString <: AbstractLineString <: AbstractGeometry` | ||
| - `MultiLineString <: AbstractMultiLineString <: AbstractGeometry` | ||
| - `Polygon <: AbstractPolygon <: AbstractGeometry` | ||
| - `MultiPolygon <: AbstractMultiPolygon <: AbstractGeometry` | ||
| - `GeometryCollection <: AbstractGeometryCollection <: AbstractGeometry` | ||
| - `Feature <: AbstractFeature` | ||
| - `FeatureCollection <: AbstractFeatureCollection` | ||
|
|
||
| ## Remarks | ||
|
|
||
| Conceptually, | ||
|
|
||
| - an `::AbstractGeometryCollection` maps to a `DataArray{::AbstractGeometry}`, and | ||
| - an `::AbstractFeatureCollection` maps to a `DataFrame`, where each row is an `AbstractFeature` | ||
|
|
||
| The design of the types in GeoInterface differs from the GeoJSON specification in the following ways: | ||
|
|
||
| - 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`. | ||
| - 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). | ||
|
|
||
| ## References | ||
|
|
||
| [1]: A Python Protocol for Geospatial Data ([gist](https://gist.github.com/sgillies/2217756)) | ||
|
|
||
| [2]: GeoJSON Specification ([website](http://geojson.org/)) | ||
| Packages which support the GeoInterface.jl interface can be found in [INTEGRATIONS.md](INTEGRATIONS.md). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| # This file is machine-generated - editing it directly is not advised | ||
|
|
||
| julia_version = "1.7.2" | ||
| manifest_format = "2.0" | ||
|
|
||
| [[deps.ANSIColoredPrinters]] | ||
| git-tree-sha1 = "574baf8110975760d391c710b6341da1afa48d8c" | ||
| uuid = "a4c015fc-c6ff-483c-b24f-f7ea428134e9" | ||
| version = "0.0.1" | ||
|
|
||
| [[deps.Base64]] | ||
| uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" | ||
|
|
||
| [[deps.Dates]] | ||
| deps = ["Printf"] | ||
| uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" | ||
|
|
||
| [[deps.DocStringExtensions]] | ||
| deps = ["LibGit2"] | ||
| git-tree-sha1 = "b19534d1895d702889b219c382a6e18010797f0b" | ||
| uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" | ||
| version = "0.8.6" | ||
|
|
||
| [[deps.Documenter]] | ||
| deps = ["ANSIColoredPrinters", "Base64", "Dates", "DocStringExtensions", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"] | ||
| git-tree-sha1 = "7d9a46421aef53cbd6b8ecc40c3dcbacbceaf40e" | ||
| uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4" | ||
| version = "0.27.15" | ||
|
|
||
| [[deps.Extents]] | ||
| git-tree-sha1 = "a087a23129ac079d43ba6b534c6350325fcd41c9" | ||
| uuid = "411431e0-e8b7-467b-b5e0-f676ba4f2910" | ||
| version = "0.1.0" | ||
|
|
||
| [[deps.GeoInterface]] | ||
| deps = ["Extents", "RecipesBase"] | ||
| path = ".." | ||
| uuid = "cf35fbd7-0cd7-5166-be24-54bfbe79505f" | ||
| version = "1.0.0" | ||
|
|
||
| [[deps.IOCapture]] | ||
| deps = ["Logging", "Random"] | ||
| git-tree-sha1 = "f7be53659ab06ddc986428d3a9dcc95f6fa6705a" | ||
| uuid = "b5f81e59-6552-4d32-b1f0-c071b021bf89" | ||
| version = "0.2.2" | ||
|
|
||
| [[deps.InteractiveUtils]] | ||
| deps = ["Markdown"] | ||
| uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" | ||
|
|
||
| [[deps.JSON]] | ||
| deps = ["Dates", "Mmap", "Parsers", "Unicode"] | ||
| git-tree-sha1 = "3c837543ddb02250ef42f4738347454f95079d4e" | ||
| uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" | ||
| version = "0.21.3" | ||
|
|
||
| [[deps.LibGit2]] | ||
| deps = ["Base64", "NetworkOptions", "Printf", "SHA"] | ||
| uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" | ||
|
|
||
| [[deps.Logging]] | ||
| uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" | ||
|
|
||
| [[deps.Markdown]] | ||
| deps = ["Base64"] | ||
| uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" | ||
|
|
||
| [[deps.Mmap]] | ||
| uuid = "a63ad114-7e13-5084-954f-fe012c677804" | ||
|
|
||
| [[deps.NetworkOptions]] | ||
| uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" | ||
|
|
||
| [[deps.Parsers]] | ||
| deps = ["Dates"] | ||
| git-tree-sha1 = "621f4f3b4977325b9128d5fae7a8b4829a0c2222" | ||
| uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" | ||
| version = "2.2.4" | ||
|
|
||
| [[deps.Printf]] | ||
| deps = ["Unicode"] | ||
| uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" | ||
|
|
||
| [[deps.REPL]] | ||
| deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] | ||
| uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" | ||
|
|
||
| [[deps.Random]] | ||
| deps = ["SHA", "Serialization"] | ||
| uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" | ||
|
|
||
| [[deps.RecipesBase]] | ||
| git-tree-sha1 = "6bf3f380ff52ce0832ddd3a2a7b9538ed1bcca7d" | ||
| uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" | ||
| version = "1.2.1" | ||
|
|
||
| [[deps.SHA]] | ||
| uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" | ||
|
|
||
| [[deps.Serialization]] | ||
| uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" | ||
|
|
||
| [[deps.Sockets]] | ||
| uuid = "6462fe0b-24de-5631-8697-dd941f90decc" | ||
|
|
||
| [[deps.Test]] | ||
| deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] | ||
| uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
|
|
||
| [[deps.Unicode]] | ||
| uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| [deps] | ||
| Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" | ||
| GeoInterface = "cf35fbd7-0cd7-5166-be24-54bfbe79505f" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| using GeoInterface | ||
| using Documenter | ||
|
|
||
| DocMeta.setdocmeta!(GeoInterface, :DocTestSetup, :(using GeoInterface); recursive=true) | ||
| cp(joinpath(@__DIR__, "../INTEGRATIONS.md"), joinpath(@__DIR__, "src/reference/integrations.md"); force=true) | ||
|
|
||
| makedocs(; | ||
| modules=[GeoInterface], | ||
| authors="JuliaGeo and contributors", | ||
| repo="https://github.com/JuliaGeo/GeoInterface.jl/blob/{commit}{path}#{line}", | ||
| sitename="GeoInterface.jl", | ||
| format=Documenter.HTML(; | ||
| prettyurls=get(ENV, "CI", "false") == "true", | ||
| canonical="https://juliageo.github.io/GeoInterface.jl", | ||
| assets=String[] | ||
| ), | ||
| pages=[ | ||
| "Home" => "index.md", | ||
| "Background" => Any[ | ||
| "Simple Features"=>"background/sf.md", | ||
| ], | ||
| "Tutorials" => Any[ | ||
| "Installation"=>"tutorials/installation.md", | ||
| "Usage"=>"tutorials/usage.md", | ||
| ], | ||
| "Guides" => Any[ | ||
| "For developers"=>"guides/developer.md", | ||
| "Defaults"=>"guides/defaults.md", | ||
| ], | ||
| "Reference" => Any[ | ||
| "API" => "reference/api.md" | ||
| "Implementations" => "reference/integrations.md" | ||
| ], | ||
| ] | ||
| ) | ||
|
|
||
| deploydocs(; | ||
| repo="github.com/JuliaGeo/GeoInterface.jl", | ||
| devbranch="main" | ||
| ) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.