Skip to content

Commit

Permalink
Bugfix for dataset ownership when creating layers (#214)
Browse files Browse the repository at this point in the history
* Bugfix for dataset ownership when creating layers

Fixes #212

* Update type for FeatureLayer

It should have a corresponding dataset for "floating layers" that were constructed "layer-first"
  • Loading branch information
yeesian authored Jul 5, 2021
1 parent 8eb4a28 commit ff2cca8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ogr/featurelayer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ function unsafe_createlayer(;
geom,
options,
),
ownedby = dataset,
spatialref = spatialref,
)
end

Expand Down
10 changes: 10 additions & 0 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,16 @@ end

mutable struct FeatureLayer <: AbstractFeatureLayer
ptr::GDAL.OGRLayerH
ownedby::AbstractDataset
spatialref::AbstractSpatialRef
end

function FeatureLayer(
ptr::GDAL.OGRLayerH = C_NULL;
ownedby::AbstractDataset = Dataset(),
spatialref::AbstractSpatialRef = SpatialRef(),
)
return FeatureLayer(ptr, ownedby, spatialref)
end

mutable struct IFeatureLayer <: AbstractFeatureLayer
Expand Down

0 comments on commit ff2cca8

Please sign in to comment.