Skip to content

Commit c3d869d

Browse files
committed
Hotfix GeoInterface integration + recipes.
1 parent 0e2e695 commit c3d869d

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "LazIO"
22
uuid = "c3605908-9f0f-11e8-0a72-0d361c15a277"
33
authors = ["Maarten Pronk <git@evetion.nl>"]
4-
version = "0.4.0"
4+
version = "0.4.1"
55

66
[deps]
77
CoordinateTransformations = "150eb455-5306-5404-9cee-2592286d6298"
@@ -10,6 +10,7 @@ Extents = "411431e0-e8b7-467b-b5e0-f676ba4f2910"
1010
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
1111
FixedPointNumbers = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
1212
GeoInterface = "cf35fbd7-0cd7-5166-be24-54bfbe79505f"
13+
GeoInterfaceRecipes = "0329782f-3d07-4b52-b9f6-d3137cf03c7a"
1314
LASzip_jll = "8372b9c3-1e34-5cc3-bfab-1a98e101de11"
1415
LasIO = "570499db-eae3-5eb6-bdd5-a5326f375e68"
1516
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
@@ -25,6 +26,7 @@ Extents = "0.1"
2526
FileIO = "1.2"
2627
FixedPointNumbers = "0.5, 0.6, 0.7, 0.8"
2728
GeoInterface = "1"
29+
GeoInterfaceRecipes = "1"
2830
LasIO = "0.3"
2931
StaticArrays = "1"
3032
Tables = "0.2, 1.0"

src/LazIO.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ using Extents
66
using FileIO
77
using FixedPointNumbers
88
using GeoInterface
9+
using GeoInterfaceRecipes
910
using LasIO
1011
using LASzip_jll
1112
using Libdl

src/geointerface.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ GeoInterface.z(::PointTrait, p::Point) = p.geometry[3]
1414

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

1919
GeoInterface.isgeometry(::Type{<:Dataset}) = true
2020
GeoInterface.geomtrait(::Dataset) = MultiPointTrait()
2121
GeoInterface.trait(::Dataset) = FeatureCollectionTrait()
22+
GeoInterface.ncoord(::MultiPointTrait, ::LazIO.Dataset) = 2
2223
GeoInterface.ngeom(::MultiPointTrait, ds::Dataset) = length(ds)
2324
GeoInterface.getgeom(::MultiPointTrait, ds::Dataset) = ds
2425
GeoInterface.getgeom(::MultiPointTrait, ds::Dataset, i) = ds[i]
@@ -27,13 +28,16 @@ GeoInterface.getgeom(::MultiPointTrait, ds::Dataset, i) = ds[i]
2728
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))
2829

2930
GeoInterface.isfeaturecollection(::Type{Dataset}) = true
30-
GeoInterface.getfeature(::MultiPointTrait, ds::Dataset, i) = ds[i]
31-
GeoInterface.getfeature(::MultiPointTrait, ds::Dataset) = ds
32-
GeoInterface.nfeature(::MultiPointTrait, ds::Dataset) = length(ds)
31+
GeoInterface.nfeature(::FeatureCollectionTrait, ds::Dataset) = length(ds)
32+
GeoInterface.getfeature(::FeatureCollectionTrait, ds::Dataset) = ds
33+
GeoInterface.getfeature(::FeatureCollectionTrait, ds::Dataset, i) = ds[i]
3334
GeoInterface.geometrycolumns(::Dataset) = (:geometry,)
3435

3536
GeoInterface.isgeometry(::Type{<:AbstractVector{<:Point}}) = true
3637
GeoInterface.geomtrait(::AbstractVector{<:Point}) = MultiPointTrait()
3738
GeoInterface.ngeom(::MultiPointTrait, ds::AbstractVector{<:Point}) = length(ds)
3839
GeoInterface.getgeom(::MultiPointTrait, ds::AbstractVector{<:Point}) = ds
3940
GeoInterface.getgeom(::MultiPointTrait, ds::AbstractVector{<:Point}, i) = ds[i]
41+
42+
GeoInterfaceRecipes.@enable_geo_plots LazIO.Dataset
43+
GeoInterfaceRecipes.@enable_geo_plots LazIO.Point

0 commit comments

Comments
 (0)