Skip to content

Commit

Permalink
#181 support M4 - MSR (spatial representation) classes
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Oct 4, 2024
1 parent 3074694 commit 6e828e9
Show file tree
Hide file tree
Showing 40 changed files with 232 additions and 177 deletions.
16 changes: 7 additions & 9 deletions R/ISOCellGeometry.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
#' @keywords ISO cell geometry
#' @return Object of \code{\link{R6Class}} for modelling an ISO CellGeometryCode
#' @format \code{\link{R6Class}} object.
#'
#' @section Methods:
#' \describe{
#' \item{\code{new(xml,value, description)}}{
#' This method is used to instantiate an \code{\link{ISOCellGeometry}}
#' }
#' }
#'
#' @examples
#' #possible values
Expand All @@ -22,15 +15,20 @@
#' pointCode <- ISOCellGeometry$new(value = "point")
#'
#' @references
#' ISO 19115:2003 - Geographic information -- Metadata
#' - ISO 19139 \url{https://schemas.isotc211.org/19139/-/gmd/1.0/gmd/#element_MD_CellGeometryCode}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/msr/1.0/msr/#element_MD_CellGeometryCode}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOCellGeometry <- R6Class("ISOCellGeometry",
inherit = ISOCodeListValue,
private = list(
xmlElement = "MD_CellGeometryCode",
xmlNamespacePrefix = "GMD"
xmlNamespacePrefix = list(
"19139" = "GMD",
"19115-3" = "MSR"
)
),
public = list(

Expand Down
9 changes: 7 additions & 2 deletions R/ISODimension.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,20 @@
#' xml <- md$encode()
#'
#' @references
#' ISO 19115:2003 - Geographic information -- Metadata
#' - ISO 19139 \url{https://schemas.isotc211.org/19139/-/gmd/1.0/gmd/#element_MD_Dimension}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/msr/1.0/msr/#element_MD_Dimension}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISODimension <- R6Class("ISODimension",
inherit = ISOAbstractObject,
private = list(
xmlElement = "MD_Dimension",
xmlNamespacePrefix = "GMD"
xmlNamespacePrefix = list(
"19139" = "GMD",
"19115-3" = "MSR"
)
),
public = list(
#'@field dimensionName dimensionName [1..1]: ISODimensionNameType
Expand Down
9 changes: 7 additions & 2 deletions R/ISODimensionNameType.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@
#' rowType <- ISODimensionNameType$new(value = "row")
#'
#' @references
#' ISO 19115:2003 - Geographic information -- Metadata
#' - ISO 19139 \url{https://schemas.isotc211.org/19139/-/gmd/1.0/gmd/#element_MD_DimensionNameTypeCode}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/msr/1.0/msr/#element_MD_DimensionNameTypeCode}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISODimensionNameType <- R6Class("ISODimensionNameType",
inherit = ISOCodeListValue,
private = list(
xmlElement = "MD_DimensionNameTypeCode",
xmlNamespacePrefix = "GMD"
xmlNamespacePrefix = list(
"19139" = "GMD",
"19115-3" = "MSR"
)
),
public = list(

Expand Down
9 changes: 7 additions & 2 deletions R/ISOGeometricObjectType.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@
#' pt <- ISOGeometricObjectType$new(value = "point")
#'
#' @references
#' ISO 19115:2003 - Geographic information -- Metadata
#' - ISO 19139 \url{https://schemas.isotc211.org/19139/-/gmd/1.0/gmd/#element_MD_GeometricObjectTypeCode}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/msr/1.0/msr/#element_MD_GeometricObjectTypeCode}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOGeometricObjectType <- R6Class("ISOGeometricObjectType",
inherit = ISOCodeListValue,
private = list(
xmlElement = "MD_GeometricObjectTypeCode",
xmlNamespacePrefix = "GMD"
xmlNamespacePrefix = list(
"19139" = "GMD",
"19115-3" = "MSR"
)
),
public = list(

Expand Down
9 changes: 7 additions & 2 deletions R/ISOGeometricObjects.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,20 @@
#' xml <- md$encode()
#'
#' @references
#' ISO 19115:2003 - Geographic information -- Metadata
#' - ISO 19139 \url{https://schemas.isotc211.org/19139/-/gmd/1.0/gmd/#element_MD_GeometricObjects}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/msr/1.0/msr/#element_MD_GeometricObjects}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOGeometricObjects <- R6Class("ISOGeometricObjects",
inherit = ISOAbstractObject,
private = list(
xmlElement = "MD_GeometricObjects",
xmlNamespacePrefix = "GMD"
xmlNamespacePrefix = list(
"19139" = "GMD",
"19115-3" = "MSR"
)
),
public = list(
#'@field geometricObjectType geometricObjectType
Expand Down
9 changes: 7 additions & 2 deletions R/ISOGeorectified.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@
#' @format \code{\link{R6Class}} object.
#'
#' @references
#' ISO 19115:2003 - Geographic information -- Metadata
#' - ISO 19139 \url{https://schemas.isotc211.org/19139/-/gmd/1.0/gmd/#element_MD_Georectified}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/msr/1.0/msr/#element_MD_Georectified}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOGeorectified <- R6Class("ISOGeorectified",
inherit = ISOGridSpatialRepresentation,
private = list(
xmlElement = "MD_Georectified",
xmlNamespacePrefix = "GMD"
xmlNamespacePrefix = list(
"19139" = "GMD",
"19115-3" = "MSR"
)
),
public = list(

Expand Down
9 changes: 7 additions & 2 deletions R/ISOGeoreferenceable.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,20 @@
#' xml <- md$encode()
#'
#' @references
#' ISO 19115:2003 - Geographic information -- Metadata
#' - ISO 19139 \url{https://schemas.isotc211.org/19139/-/gmd/1.0/gmd/#element_MD_Georeferenceable}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/msr/1.0/msr/#element_MD_Georeferenceable}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOGeoreferenceable <- R6Class("ISOGeoreferenceable",
inherit = ISOGridSpatialRepresentation,
private = list(
xmlElement = "MD_Georeferenceable",
xmlNamespacePrefix = "GMD"
xmlNamespacePrefix = list(
"19139" = "GMD",
"19115-3" = "MSR"
)
),
public = list(

Expand Down
9 changes: 7 additions & 2 deletions R/ISOGridSpatialRepresentation.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,20 @@
#' xml <- md$encode()
#'
#' @references
#' ISO 19115:2003 - Geographic information -- Metadata
#' - ISO 19139 \url{https://schemas.isotc211.org/19139/-/gmd/1.0/gmd/#element_MD_GridSpatialRepresentation}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/msr/1.0/msr/#element_MD_GridSpatialRepresentation}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOGridSpatialRepresentation <- R6Class("ISOGridSpatialRepresentation",
inherit = ISOSpatialRepresentation,
private = list(
xmlElement = "MD_GridSpatialRepresentation",
xmlNamespacePrefix = "GMD"
xmlNamespacePrefix = list(
"19139" = "GMD",
"19115-3" = "MSR"
)
),
public = list(

Expand Down
9 changes: 7 additions & 2 deletions R/ISOImageryGCP.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@
#' xml <- md$encode()
#'
#' @references
#' ISO 19115-2:2009 - Geographic information -- Metadata Part 2: Extensions for imagery and gridded data
#' - ISO 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_MI_GCP}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/msr/1.0/msr/#element_MI_GCP}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOImageryGCP <- R6Class("ISOImageryGCP",
inherit = GMLAbstractObject,
private = list(
xmlElement = "MI_GCP",
xmlNamespacePrefix = "GMI"
xmlNamespacePrefix = list(
"19139" = "GMI",
"19115-3" = "MSR"
)
),
public = list(
#'@field geographicCoordinates geographicCoordinates
Expand Down
40 changes: 11 additions & 29 deletions R/ISOImageryGCPCollection.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,6 @@
#' @return Object of \code{\link{R6Class}} for modelling an ISO imagery gcp collection
#' @format \code{\link{R6Class}} object.
#'
#' @section Methods:
#' \describe{
#' \item{\code{new(xml)}}{
#' This method is used to instantiate an \code{\link{ISOImageryGCPCollection}}
#' }
#' \item{\code{setCollectionIdentification(id)}}{
#' Set the identifier, object of class \code{integer}
#' }
#' \item{\code{setCollectionName(name, locales)}}{
#' Sets a name (object of class "character"). Locale names can be
#' specified as \code{list} with the \code{locales} argument.
#' }
#' \item{\code{setCoordinateReferenceSystem(crs)}}{
#' Sets the crs, object of class \code{\link{ISOReferenceSystem}}
#' }
#' \item{\code{addGCP(gcp)}}{
#' Adds a GCP, object of class \code{\link{ISOImageryGCP}}
#' }
#' \item{\code{delGCP(gcp)}}{
#' Deletes a GCP, object of class \code{\link{ISOImageryGCP}}
#' }
#' }
#'
#' @examples
#' md <- ISOImageryGCPCollection$new()
#' md$setCollectionIdentification(1L)
Expand All @@ -41,23 +18,28 @@
#' xml <- md$encode()
#'
#' @references
#' ISO 19115-2:2009 - Geographic information -- Metadata Part 2: Extensions for imagery and gridded data
#' - ISO 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_MI_GCPCollection}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/msr/1.0/msr/#element_MI_GCPCollection}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOImageryGCPCollection <- R6Class("ISOImageryGCPCollection",
inherit = ISOImageryAbstractGeolocationInformation,
private = list(
xmlElement = "MI_GCPCollection",
xmlNamespacePrefix = "GMI"
xmlNamespacePrefix = list(
"19139" = "GMI",
"19115-3" = "MSR"
)
),
public = list(

#'@field collectionIdentification collectionIdentification [1..1]: integer
collectionIdentification = NULL,
#'@field collectionName collectionName [1..1]: character|ISOLocalisedCharacterString
collectionName = NULL,
#'@field coordinateReferenceSystem coordinateReferenceSystem [1..1]: ISOReferenceSystem
#'@field coordinateReferenceSystem coordinateReferenceSystem [1..1]: ISOAbstractReferenceSystem
coordinateReferenceSystem = NULL,
#'@field gcp gcp [0..*]: list of ISOImageryGCP
gcp = list(),
Expand Down Expand Up @@ -92,10 +74,10 @@ ISOImageryGCPCollection <- R6Class("ISOImageryGCPCollection",
},

#'@description Set coordinate reference system
#'@param crs object of class \link{ISOReferenceSystem}
#'@param crs object of class inheriting \link{ISOAbstractReferenceSystem}
setCoordinateReferenceSystem = function(crs){
if(!is(crs, "ISOReferenceSystem")){
stop("The argument should be an object of class 'ISOReferenceSystem'")
if(!is(crs, "ISOAbstractReferenceSystem")){
stop("The argument should be an object inheriting class 'ISOAbstractReferenceSystem'")
}
self$coordinateReferenceSystem <- crs
},
Expand Down
9 changes: 7 additions & 2 deletions R/ISOImageryGeolocationInformation.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,20 @@
#' @note abstract class
#'
#' @references
#' ISO 19115-2:2009 - Geographic information -- Metadata Part 2: Extensions for imagery and gridded data
#' - ISO 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_AbstractMI_GeolocationInformation}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/msr/1.0/msr/#element_AbstractMI_GeolocationInformation}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOImageryAbstractGeolocationInformation <- R6Class("ISOImageryAbstractGeolocationInformation",
inherit = ISOAbstractObject,
private = list(
xmlElement = "AbstractMI_GeolocationInformation",
xmlNamespacePrefix = "GMI"
xmlNamespacePrefix = list(
"19139" = "GMI",
"19115-3" = "MSR"
)
),
public = list(

Expand Down
9 changes: 7 additions & 2 deletions R/ISOImageryGeorectified.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@
#' @format \code{\link{R6Class}} object.
#'
#' @references
#' ISO 19115-2:2009 - Geographic information -- Metadata -- Part 2: Extensions for imagery and gridded data
#' - ISO 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_MI_Georectified}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/msr/1.0/msr/#element_MI_Georectified}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOImageryGeorectified <- R6Class("ISOImageryGeorectified",
inherit = ISOGeorectified,
private = list(
xmlElement = "MI_Georectified",
xmlNamespacePrefix = "GMI"
xmlNamespacePrefix = list(
"19139" = "GMI",
"19115-3" = "MSR"
)
),
public = list(

Expand Down
9 changes: 7 additions & 2 deletions R/ISOImageryGeoreferenceable.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@
#' @format \code{\link{R6Class}} object.
#'
#' @references
#' ISO 19115-2:2009 - Geographic information -- Metadata -- Part 2: Extensions for imagery and gridded data
#' - ISO 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_MI_Georeferenceable}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/msr/1.0/msr/#element_MI_Georeferenceable}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOImageryGeoreferenceable <- R6Class("ISOImageryGeoreferenceable",
inherit = ISOGeoreferenceable,
private = list(
xmlElement = "MI_Georeferenceable",
xmlNamespacePrefix = "GMI"
xmlNamespacePrefix = list(
"19139" = "GMI",
"19115-3" = "MSR"
)
),
public = list(

Expand Down
9 changes: 7 additions & 2 deletions R/ISOPixelOrientation.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@
#' PixelOrientation <- ISOPixelOrientation$new(value = "center")
#'
#' @references
#' ISO 19115:2003 - Geographic information -- Metadata
#' - ISO 19139 \url{https://schemas.isotc211.org/19139/-/gmd/1.0/gmd/#element_MD_PixelOrientationCode}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/msr/1.0/msr/#element_MD_PixelOrientationCode}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOPixelOrientation <- R6Class("ISOPixelOrientation",
inherit = ISOCodeListValue,
private = list(
xmlElement = "MD_PixelOrientationCode",
xmlNamespacePrefix = "GMD"
xmlNamespacePrefix = list(
"19139" = "GMD",
"19115-3" = "MSR"
)
),
public = list(

Expand Down
2 changes: 1 addition & 1 deletion R/ISOReferenceSystem.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOReferenceSystem <- R6Class("ISOReferenceSystem",
inherit = ISOAbstractObject,
inherit = ISOAbstractReferenceSystem,
private = list(
xmlElement = "MD_ReferenceSystem",
xmlNamespacePrefix = list(
Expand Down
Loading

0 comments on commit 6e828e9

Please sign in to comment.