diff --git a/dev/considerations/index.html b/dev/considerations/index.html index e6b4ec17..ca0ba3a8 100644 --- a/dev/considerations/index.html +++ b/dev/considerations/index.html @@ -17,4 +17,4 @@ GCI_YCbCr_CrBand => "b"
the entry for GDAL.GCI_YCbCr_CrBand => "a"
got overwritten by GDAL.GCI_Max => "b"
because both GDAL.GCI_YCbCr_CrBand
and GDAL.GCI_Max
corresponded to the same value.
To avoid such forms of behavior, this package uses Base.Enums
instead, so the above example would result in the following behavior:
julia> Dict(ArchGDAL.GCI_YCbCr_CrBand => "a", ArchGDAL.GCI_Max => "b")
Dict{ArchGDAL.GDALColorInterp, String} with 2 entries:
GCI_YCbCr_CrBand => "a"
- GCI_Max => "b"
To maintain parity with GDAL behavior, ArchGDAL.jl provides conversion methods to map from the enums in ArchGDAL to the corresponding cenums from GDAL.jl when calling the corresponding GDAL functions.
Rather than encouraging operations on colortables (with very limited functionality from GDAL), users are better served by arrays of ColorTypes using Colors.jl, for example
range(startcolor, stop=endcolor, length=15)
instead of
createcolorramp!(colortable, startindex, startcolor, startindex+15, endcolor)
To differentiate 2d arrays of colors from 3d arrays with band as the third dimension:
In general, read()
will return Array{UInt8}
, and imread()
will return Array{<:Colorant}
.
The interface is implemented in src/tables.jl
, and is only for feature and geometries in OGR (and not for images and rasters). The current API from GDAL makes it row-based in the conventions of Tables.jl. Therefore,
ArchGDAL.Feature
meets the criteria for an AbstractRow
based on https://github.com/yeesian/ArchGDAL.jl/blob/a665f3407930b8221269f8949c246db022c3a85c/src/tables.jl#L31-L58.ArchGDAL.FeatureLayer
meets the criteria for an AbstractRow
-iterator based on the previous bullet and meeting the criteria for Iteration
in base/iterators.jl
.ArchGDAL.AbstractDataset
might contain multiple layers, and might correspond to multiple tables. The way to construct tables would be to get the layers before forming the corresponding tables.When reading the fields of a feature using getfield(feature, i)
, ArchGDAL observes the following behavior:
Field | null | notnull |
---|---|---|
set | missing | value |
unset | N/A | nothing |
This reflects that
missing
: use isfieldnull(feature, i)
to determine if a field has been set.nothing
(and a field that unset will always return nothing
): use isfieldset(feature, i)
to determine if a field has been set.isfieldsetandnotnull(feature, i)
to test for it.When writing the fields of a feature using setfield!(feature, i, value)
, ArchGDAL observes the following behavior:
Field | nullable | notnullable |
---|---|---|
nothing | unset | unset |
missing | null | getdefault() |
value | value | value |
This reflects that
nothing
will cause the field to be unset.missing
will cause the field to be null. In the cause of a notnullable field, it will take the default value (see https://gdal.org/development/rfc/rfc53ogrnotnull_default.html for details). If there is no default value, getdefault()
will return nothing
, causing the field to be unset.For additional references, see
Settings
This document was generated with Documenter.jl on Monday 6 May 2024. Using Julia version 1.10.3.