Skip to content

Commit

Permalink
Hotfix GeoInterface integration + recipes.
Browse files Browse the repository at this point in the history
  • Loading branch information
evetion committed Jan 12, 2023
1 parent 0e2e695 commit c3d869d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "LazIO"
uuid = "c3605908-9f0f-11e8-0a72-0d361c15a277"
authors = ["Maarten Pronk <[email protected]>"]
version = "0.4.0"
version = "0.4.1"

[deps]
CoordinateTransformations = "150eb455-5306-5404-9cee-2592286d6298"
Expand All @@ -10,6 +10,7 @@ Extents = "411431e0-e8b7-467b-b5e0-f676ba4f2910"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
FixedPointNumbers = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
GeoInterface = "cf35fbd7-0cd7-5166-be24-54bfbe79505f"
GeoInterfaceRecipes = "0329782f-3d07-4b52-b9f6-d3137cf03c7a"
LASzip_jll = "8372b9c3-1e34-5cc3-bfab-1a98e101de11"
LasIO = "570499db-eae3-5eb6-bdd5-a5326f375e68"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Expand All @@ -25,6 +26,7 @@ Extents = "0.1"
FileIO = "1.2"
FixedPointNumbers = "0.5, 0.6, 0.7, 0.8"
GeoInterface = "1"
GeoInterfaceRecipes = "1"
LasIO = "0.3"
StaticArrays = "1"
Tables = "0.2, 1.0"
Expand Down
1 change: 1 addition & 0 deletions src/LazIO.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using Extents
using FileIO
using FixedPointNumbers
using GeoInterface
using GeoInterfaceRecipes
using LasIO
using LASzip_jll
using Libdl
Expand Down
12 changes: 8 additions & 4 deletions src/geointerface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ GeoInterface.z(::PointTrait, p::Point) = p.geometry[3]

GeoInterface.isfeature(feat::Type{<:Point}) = true
GeoInterface.properties(feat::T) where {T<:Point} = NamedTuple(zip(fieldnames(T), getfield(feat, n) for n in fieldnames(T)))
GeoInterface.geometry(feat::Point) = feat.geom
GeoInterface.geometry(feat::Point) = feat.geometry

GeoInterface.isgeometry(::Type{<:Dataset}) = true
GeoInterface.geomtrait(::Dataset) = MultiPointTrait()
GeoInterface.trait(::Dataset) = FeatureCollectionTrait()
GeoInterface.ncoord(::MultiPointTrait, ::LazIO.Dataset) = 2
GeoInterface.ngeom(::MultiPointTrait, ds::Dataset) = length(ds)
GeoInterface.getgeom(::MultiPointTrait, ds::Dataset) = ds
GeoInterface.getgeom(::MultiPointTrait, ds::Dataset, i) = ds[i]
Expand All @@ -27,13 +28,16 @@ GeoInterface.getgeom(::MultiPointTrait, ds::Dataset, i) = ds[i]
GeoInterface.extent(::MultiPointTrait, ds::Dataset) = Extent(X=(ds.header.min_x, ds.header.max_x), Y=(ds.header.min_y, ds.header.max_y), Z=(ds.header.min_z, ds.header.max_z))

GeoInterface.isfeaturecollection(::Type{Dataset}) = true
GeoInterface.getfeature(::MultiPointTrait, ds::Dataset, i) = ds[i]
GeoInterface.getfeature(::MultiPointTrait, ds::Dataset) = ds
GeoInterface.nfeature(::MultiPointTrait, ds::Dataset) = length(ds)
GeoInterface.nfeature(::FeatureCollectionTrait, ds::Dataset) = length(ds)
GeoInterface.getfeature(::FeatureCollectionTrait, ds::Dataset) = ds
GeoInterface.getfeature(::FeatureCollectionTrait, ds::Dataset, i) = ds[i]
GeoInterface.geometrycolumns(::Dataset) = (:geometry,)

GeoInterface.isgeometry(::Type{<:AbstractVector{<:Point}}) = true
GeoInterface.geomtrait(::AbstractVector{<:Point}) = MultiPointTrait()
GeoInterface.ngeom(::MultiPointTrait, ds::AbstractVector{<:Point}) = length(ds)
GeoInterface.getgeom(::MultiPointTrait, ds::AbstractVector{<:Point}) = ds
GeoInterface.getgeom(::MultiPointTrait, ds::AbstractVector{<:Point}, i) = ds[i]

GeoInterfaceRecipes.@enable_geo_plots LazIO.Dataset
GeoInterfaceRecipes.@enable_geo_plots LazIO.Point

2 comments on commit c3d869d

@evetion
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/75560

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.4.1 -m "<description of version>" c3d869d98e3b07565e216ae1238af2e52d4ea432
git push origin v0.4.1

Please sign in to comment.