Skip to content

Commit

Permalink
Add metadata function (#2)
Browse files Browse the repository at this point in the history
* Add 'metadata' function

* Add missing parameters

* Update comments

* Update kwargs

* Update code order

* Rename arguments

* Fix code
  • Loading branch information
eliascarv authored Nov 7, 2024
1 parent 199eeeb commit 5cd0186
Show file tree
Hide file tree
Showing 3 changed files with 284 additions and 80 deletions.
1 change: 1 addition & 0 deletions src/GeoTIFF.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ using FixedPointNumbers: Fixed, Normed

import TiffImages

include("geokeys.jl")
include("metadata.jl")
include("image.jl")
include("load.jl")
Expand Down
76 changes: 76 additions & 0 deletions src/geokeys.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# -----------------------------------------------------------------
# Licensed under the MIT License. See LICENSE in the project root.
# -----------------------------------------------------------------

@enum GeoKeyID::UInt16 begin
GTRasterTypeGeoKey = 1025
GTModelTypeGeoKey = 1024
ProjectedCRSGeoKey = 3072
GeodeticCRSGeoKey = 2048
VerticalGeoKey = 4096
GTCitationGeoKey = 1026
GeodeticCitationGeoKey = 2049
ProjectedCitationGeoKey = 3073
VerticalCitationGeoKey = 4097
GeogAngularUnitsGeoKey = 2054
GeogAzimuthUnitsGeoKey = 2060
GeogLinearUnitsGeoKey = 2052
ProjLinearUnitsGeoKey = 3076
VerticalUnitsGeoKey = 4099
GeogAngularUnitSizeGeoKey = 2055
GeogLinearUnitSizeGeoKey = 2053
ProjLinearUnitSizeGeoKey = 3077
GeodeticDatumGeoKey = 2050
PrimeMeridianGeoKey = 2051
PrimeMeridianLongitudeGeoKey = 2061
EllipsoidGeoKey = 2056
EllipsoidSemiMajorAxisGeoKey = 2057
EllipsoidSemiMinorAxisGeoKey = 2058
EllipsoidInvFlatteningGeoKey = 2059
VerticalDatumGeoKey = 4098
ProjectionGeoKey = 3074
ProjMethodGeoKey = 3075
ProjStdParallel1GeoKey = 3078
ProjStdParallel2GeoKey = 3079
ProjNatOriginLongGeoKey = 3080
ProjNatOriginLatGeoKey = 3081
ProjFalseOriginLongGeoKey = 3084
ProjFalseOriginLatGeoKey = 3085
ProjCenterLongGeoKey = 3088
ProjCenterLatGeoKey = 3089
ProjStraightVertPoleLongGeoKey = 3095
ProjAzimuthAngleGeoKey = 3094
ProjFalseEastingGeoKey = 3082
ProjFalseNorthingGeoKey = 3083
ProjFalseOriginEastingGeoKey = 3086
ProjFalseOriginNorthingGeoKey = 3087
ProjCenterEastingGeoKey = 3090
ProjCenterNorthingGeoKey = 3091
ProjScaleAtNatOriginGeoKey = 3092
ProjScaleAtCenterGeoKey = 3093
end

# Corresponding names in the GeoTIFF specification:
# id - KeyID
# tag - TIFFTagLocation
# count - Count
# value - ValueOffset
struct GeoKey
id::GeoKeyID
tag::UInt16
count::UInt16
value::UInt16
end

# generic values
const Undefined = UInt16(0)
const UserDefined = UInt16(32767)

# GTRasterTypeGeoKey values
const PixelIsArea = UInt16(1)
const PixelIsPoint = UInt16(2)

# GTModelTypeGeoKey values
const Projected2D = UInt16(1)
const Geographic2D = UInt16(2)
const Geocentric3D = UInt16(3)
Loading

0 comments on commit 5cd0186

Please sign in to comment.