ISOMetadata | R Documentation |
ISOMetadata
ISOMetadata
R6Class
object.
Object of R6Class
for modelling an ISO Metadata
geometa::geometaLogger
-> geometa::ISOAbstractObject
-> ISOMetadata
fileIdentifier
fileIdentifier [0..1] : character
language
language [0..1] : character
characterSet
characterSet [0..1] : ISOCharacterSet = "utf8"
parentIdentifier
parentIdentifier [0..1] : character
hierarchyLevel
hierarchyLevel [0..*] : ISOScopeCode = "dataset"
hierarchyLevelName
hierarchyLevelName [0..*] : character
contact
contact [1..*] : ISOResponsibleParty
dateStamp
dateStamp : POSIXct/POSIXt
metadataStandardName
metadataStandardName [0..1] : character
metadataStandardVersion
metadataStandardVersion [0..1] : character
dataSetURI
dataSetURI [0..1] : character
locale
locale [0..*]: ISOLocale
spatialRepresentationInfo
spatialRepresentationInfo [0..*]: ISOSpatialRepresentation
referenceSystemInfo
referenceSystemInfo [0..*]: ISOReferenceSystem
metadataExtensionInfo
metadataExtensionInfo [0..*]: ISOMetadataExtensionInformation
identificationInfo
identificationInfo [1..*]: ISOIdentification
contentInfo
contentInfo [0..*]
distributionInfo
distributionInfo [0..1] : ISODistribution
dataQualityInfo
dataQualityInfo [0..*]: ISODataQuality
metadataMaintenance
metadataMaintenance [0..1]: ISOMaintenanceInformation
portrayalCatalogueInfo
portrayalCatalogueInfo [0..*]
applicationSchemaInformation
applicationSchemaInfo [0..*]
geometa::geometaLogger$ERROR()
geometa::geometaLogger$INFO()
geometa::geometaLogger$WARN()
geometa::ISOAbstractObject$addFieldAttrs()
geometa::ISOAbstractObject$addListElement()
geometa::ISOAbstractObject$checkMetadataStandardCompliance()
geometa::ISOAbstractObject$contains()
geometa::ISOAbstractObject$createLocalisedProperty()
geometa::ISOAbstractObject$decode()
geometa::ISOAbstractObject$delListElement()
geometa::ISOAbstractObject$encode()
geometa::ISOAbstractObject$getClass()
geometa::ISOAbstractObject$getClassName()
geometa::ISOAbstractObject$getNamespaceDefinition()
geometa::ISOAbstractObject$isDocument()
geometa::ISOAbstractObject$isFieldInheritedFrom()
geometa::ISOAbstractObject$print()
geometa::ISOAbstractObject$save()
geometa::ISOAbstractObject$setAttr()
geometa::ISOAbstractObject$setCodeList()
geometa::ISOAbstractObject$setCodeListValue()
geometa::ISOAbstractObject$setCodeSpace()
geometa::ISOAbstractObject$setHref()
geometa::ISOAbstractObject$setId()
geometa::ISOAbstractObject$setIsNull()
geometa::ISOAbstractObject$setValue()
geometa::ISOAbstractObject$stopIfMetadataStandardIsNot()
geometa::ISOAbstractObject$validate()
geometa::ISOAbstractObject$wrapBaseElement()
new()
Initializes object
ISOMetadata$new(xml = NULL)
xml
object of class XMLInternalNode-class
setFileIdentifier()
Set file identifier
ISOMetadata$setFileIdentifier(fileIdentifier)
fileIdentifier
file identifier
setLanguage()
Set language
ISOMetadata$setLanguage(locale)
locale
object of class ISOLanguage or any character
from values returned by ISOLanguages$values()
setCharacterSet()
Set charset
ISOMetadata$setCharacterSet(charset)
charset
object of class ISOCharacterSet or any character
from values returned by ISOCharacterSet$values()
setParentIdentifier()
Set parent identifier
ISOMetadata$setParentIdentifier(parentIdentifier)
parentIdentifier
parent identifier
addHierarchyLevel()
Adds hierarchy level
ISOMetadata$addHierarchyLevel(level)
level
object of class ISOScopeCode or any character
from values returned by ISOScopeCode$values()
TRUE
if added, FALSE
otherwise
setHierarchyLevel()
Sets hierarchy level
ISOMetadata$setHierarchyLevel(level)
level
object of class ISOScopeCode or any character
from values returned by ISOScopeCode$values()
TRUE
if added, FALSE
otherwise
delHierarchyLevel()
Deletes hierarchy level
ISOMetadata$delHierarchyLevel(level)
level
object of class ISOScopeCode or any character
from values returned by ISOScopeCode$values()
TRUE
if deleted, FALSE
otherwise
addHierarchyLevelName()
Adds hierarchy level name
ISOMetadata$addHierarchyLevelName(levelName)
levelName
object of class character
TRUE
if added, FALSE
otherwise
delHierarchyLevelName()
Deletes hierarchy level name
ISOMetadata$delHierarchyLevelName(levelName)
levelName
object of class character
TRUE
if deleted, FALSE
otherwise
addContact()
Adds contact
ISOMetadata$addContact(contact)
contact
object of class ISOResponsibleParty
TRUE
if added, FALSE
otherwise
delContact()
Deletes contact
ISOMetadata$delContact(contact)
contact
object of class ISOResponsibleParty
TRUE
if deleted, FALSE
otherwise
setDateStamp()
Set date stamp
ISOMetadata$setDateStamp(date)
date
date
setMetadataStandardName()
Set metadata standard name
ISOMetadata$setMetadataStandardName(name)
name
name
setMetadataStandardVersion()
Set metadata standard version
ISOMetadata$setMetadataStandardVersion(version)
version
version
setDataSetURI()
Set dataset URI
ISOMetadata$setDataSetURI(dataSetURI)
dataSetURI
dataset URI
addLocale()
Adds locale
ISOMetadata$addLocale(locale)
locale
object of class ISOLocale
TRUE
if added, FALSE
otherwise
delLocale()
Deletes locale
ISOMetadata$delLocale(locale)
locale
object of class ISOLocale
TRUE
if deleted, FALSE
otherwise
addSpatialRepresentationInfo()
Adds spatial representation info
ISOMetadata$addSpatialRepresentationInfo(spatialRepresentationInfo)
spatialRepresentationInfo
object of class ISOSpatialRepresentation
TRUE
if added, FALSE
otherwise
setSpatialRepresentationInfo()
Sets spatial representation info
ISOMetadata$setSpatialRepresentationInfo(spatialRepresentationInfo)
spatialRepresentationInfo
object of class ISOSpatialRepresentation
TRUE
if added, FALSE
otherwise
delSpatialRepresentationInfo()
Deletes spatial representation info
ISOMetadata$delSpatialRepresentationInfo(spatialRepresentationInfo)
spatialRepresentationInfo
object of class ISOSpatialRepresentation
TRUE
if deleted, FALSE
otherwise
addReferenceSystemInfo()
Adds reference system info
ISOMetadata$addReferenceSystemInfo(referenceSystemInfo)
referenceSystemInfo
object of class ISOReferenceSystem
TRUE
if added, FALSE
otherwise
setReferenceSystemInfo()
Sets reference system info
ISOMetadata$setReferenceSystemInfo(referenceSystemInfo)
referenceSystemInfo
object of class ISOReferenceSystem
TRUE
if added, FALSE
otherwise
delReferenceSystemInfo()
Deletes reference system info
ISOMetadata$delReferenceSystemInfo(referenceSystemInfo)
referenceSystemInfo
object of class ISOReferenceSystem
TRUE
if deleted, FALSE
otherwise
addMetadataExtensionInfo()
Adds metadata extension info
ISOMetadata$addMetadataExtensionInfo(metadataExtensionInfo)
metadataExtensionInfo
object of class ISOMetadataExtensionInformation
TRUE
if added, FALSE
otherwise
delMetadataExtensionInfo()
Deletes metadata extension info
ISOMetadata$delMetadataExtensionInfo(metadataExtensionInfo)
metadataExtensionInfo
object of class ISOMetadataExtensionInformation
TRUE
if deleted, FALSE
otherwise
addIdentificationInfo()
Adds metadata extension info
ISOMetadata$addIdentificationInfo(identificationInfo)
identificationInfo
object of class inheriting ISOIdentification
TRUE
if added, FALSE
otherwise
setIdentificationInfo()
Sets metadata extension info
ISOMetadata$setIdentificationInfo(identificationInfo)
identificationInfo
object of class inheriting ISOIdentification
TRUE
if added, FALSE
otherwise
delIdentificationInfo()
Deletes metadata extension info
ISOMetadata$delIdentificationInfo(identificationInfo)
identificationInfo
object of class inheriting ISOIdentification
TRUE
if deleted, FALSE
otherwise
setDistributionInfo()
Sets metadata extension info
ISOMetadata$setDistributionInfo(distributionInfo)
distributionInfo
object of class ISODistribution
TRUE
if set, FALSE
otherwise
addDataQualityInfo()
Adds data quality info
ISOMetadata$addDataQualityInfo(dataQualityInfo)
dataQualityInfo
object of class ISODataQuality
TRUE
if added, FALSE
otherwise
setDataQualityInfo()
Sets data quality info
ISOMetadata$setDataQualityInfo(dataQualityInfo)
dataQualityInfo
object of class ISODataQuality
TRUE
if added, FALSE
otherwise
delDataQualityInfo()
Deletes data quality info
ISOMetadata$delDataQualityInfo(dataQualityInfo)
dataQualityInfo
object of class ISODataQuality
TRUE
if deleted, FALSE
otherwise
setMetadataMaintenance()
Sets metadata maintenance
ISOMetadata$setMetadataMaintenance(metadataMaintenance)
metadataMaintenance
object of class ISOMaintenanceInformation
TRUE
if added, FALSE
otherwise
addContentInfo()
Adds content information
ISOMetadata$addContentInfo(contentInfo)
contentInfo
object of class inheriting ISOAbstractContentInformation
TRUE
if added, FALSE
otherwise
delContentInfo()
Deletes content information
ISOMetadata$delContentInfo(contentInfo)
contentInfo
object of class inheriting ISOAbstractContentInformation
TRUE
if deleted, FALSE
otherwise
clone()
The objects of this class are cloneable with this method.
ISOMetadata$clone(deep = FALSE)
deep
Whether to make a deep clone.
Emmanuel Blondel <emmanuel.blondel1@gmail.com>
ISO 19115:2003 - Geographic information – Metadata
#example 1 - WRITE: Create an ISO metadata and encode it as XML
#######################################################
md = ISOMetadata$new()
md$setFileIdentifier("my-metadata-identifier")
md$setParentIdentifier("my-parent-metadata-identifier")
md$setCharacterSet("utf8")
md$setLanguage("eng")
md$setDateStamp(ISOdate(2015, 1, 1, 1))
md$setMetadataStandardName("ISO 19115:2003/19139")
md$setMetadataStandardVersion("1.0")
md$setDataSetURI("my-dataset-identifier")
#add 3 contacts
for(i in 1:3){
rp <- ISOResponsibleParty$new()
rp$setIndividualName(paste0("someone",i))
rp$setOrganisationName("somewhere")
rp$setPositionName(paste0("someposition",i))
rp$setRole("pointOfContact")
contact <- ISOContact$new()
phone <- ISOTelephone$new()
phone$setVoice(paste0("myphonenumber",i))
phone$setFacsimile(paste0("myfacsimile",i))
contact$setPhone(phone)
address <- ISOAddress$new()
address$setDeliveryPoint("theaddress")
address$setCity("thecity")
address$setPostalCode("111")
address$setCountry("France")
address$setEmail("someone@theorg.org")
contact$setAddress(address)
res <- ISOOnlineResource$new()
res$setLinkage("http://somelink")
res$setName("someresourcename")
contact$setOnlineResource(res)
rp$setContactInfo(contact)
md$addContact(rp)
}
#VectorSpatialRepresentation
vsr <- ISOVectorSpatialRepresentation$new()
vsr$setTopologyLevel("geometryOnly")
geomObject <- ISOGeometricObjects$new()
geomObject$setGeometricObjectType("surface")
geomObject$setGeometricObjectCount(5L)
vsr$addGeometricObjects(geomObject)
md$addSpatialRepresentationInfo(vsr)
#ReferenceSystem
rs <- ISOReferenceSystem$new()
rsId <- ISOReferenceIdentifier$new(code = "4326", codeSpace = "EPSG")
rs$setReferenceSystemIdentifier(rsId)
md$addReferenceSystemInfo(rs)
#data identification
ident <- ISODataIdentification$new()
ident$setAbstract("abstract")
ident$setPurpose("purpose")
ident$addCredit("credit1")
ident$addCredit("credit2")
ident$addCredit("credit3")
ident$addStatus("completed")
ident$addLanguage("eng")
ident$addCharacterSet("utf8")
ident$addTopicCategory("biota")
ident$addTopicCategory("oceans")
#adding a point of contact
rp <- ISOResponsibleParty$new()
rp$setIndividualName("someone")
rp$setOrganisationName("somewhere")
rp$setPositionName("someposition")
rp$setRole("pointOfContact")
contact <- ISOContact$new()
phone <- ISOTelephone$new()
phone$setVoice("myphonenumber")
phone$setFacsimile("myfacsimile")
contact$setPhone(phone)
address <- ISOAddress$new()
address$setDeliveryPoint("theaddress")
address$setCity("thecity")
address$setPostalCode("111")
address$setCountry("France")
address$setEmail("someone@theorg.org")
contact$setAddress(address)
res <- ISOOnlineResource$new()
res$setLinkage("http://somelink")
res$setName("somename")
contact$setOnlineResource(res)
rp$setContactInfo(contact)
ident$addPointOfContact(rp)
#citation
ct <- ISOCitation$new()
ct$setTitle("sometitle")
d <- ISODate$new()
d$setDate(ISOdate(2015, 1, 1, 1))
d$setDateType("publication")
ct$addDate(d)
ct$setEdition("1.0")
ct$setEditionDate(as.Date(ISOdate(2015, 1, 1, 1)))
ct$addIdentifier(ISOMetaIdentifier$new(code = "identifier"))
ct$addPresentationForm("mapDigital")
ct$addCitedResponsibleParty(rp)
ident$setCitation(ct)
#graphic overview
go1 <- ISOBrowseGraphic$new(
fileName = "http://wwww.somefile.org/png1",
fileDescription = "Map Overview 1",
fileType = "image/png"
)
go2 <- ISOBrowseGraphic$new(
fileName = "http://www.somefile.org/png2",
fileDescription = "Map Overview 2",
fileType = "image/png"
)
ident$addGraphicOverview(go1)
ident$addGraphicOverview(go2)
#maintenance information
mi <- ISOMaintenanceInformation$new()
mi$setMaintenanceFrequency("daily")
ident$addResourceMaintenance(mi)
#adding legal constraints
lc <- ISOLegalConstraints$new()
lc$addUseLimitation("limitation1")
lc$addUseLimitation("limitation2")
lc$addUseLimitation("limitation3")
lc$addAccessConstraint("copyright")
lc$addAccessConstraint("license")
lc$addUseConstraint("copyright")
lc$addUseConstraint("license")
ident$addResourceConstraints(lc)
#adding security constraints
sc <- ISOSecurityConstraints$new()
sc$setClassification("secret")
sc$setUserNote("ultra secret")
sc$setClassificationSystem("no classification in particular")
sc$setHandlingDescription("description")
ident$addResourceConstraints(sc)
#adding extent
extent <- ISOExtent$new()
bbox <- ISOGeographicBoundingBox$new(minx = -180, miny = -90, maxx = 180, maxy = 90)
extent$addGeographicElement(bbox)
ident$addExtent(extent)
#add keywords
kwds <- ISOKeywords$new()
kwds$addKeyword("keyword1")
kwds$addKeyword("keyword2")
kwds$setKeywordType("theme")
th <- ISOCitation$new()
th$setTitle("General")
th$addDate(d)
kwds$setThesaurusName(th)
ident$addKeywords(kwds)
#add an INSPIRE spatial data theme?
inspire_kwd <- ISOKeywords$new()
anc1 <- ISOAnchor$new(
name = "Environmental monitoring facilities",
href = "http://inspire.ec.europa.eu/theme/ef"
)
inspire_kwd$addKeyword(anc1)
inspire_kwd$setKeywordType("theme")
th <- ISOCitation$new()
th$setTitle(
ISOAnchor$new(
name = "GEMET - INSPIRE themes, version 1.0",
href="http://www.eionet.europa.eu/gemet/inspire_themes"
)
)
inspire_date <- ISODate$new()
inspire_date$setDate(as.Date("2008-06-01"))
inspire_date$setDateType("publication")
th$addDate(inspire_date)
inspire_kwd$setThesaurusName(th)
ident$addKeywords(inspire_kwd)
#supplementalInformation
ident$setSupplementalInformation("some additional information")
#spatial representation type
ident$addSpatialRepresentationType("vector")
md$addIdentificationInfo(ident)
#Distribution
distrib <- ISODistribution$new()
dto <- ISODigitalTransferOptions$new()
for(i in 1:3){
or <- ISOOnlineResource$new()
or$setLinkage(paste0("http://somelink",i))
or$setName(paste0("name",i))
or$setDescription(paste0("description",i))
or$setProtocol("WWW:LINK-1.0-http--link")
dto$addOnlineResource(or)
}
distrib$setDigitalTransferOptions(dto)
md$setDistributionInfo(distrib)
#create dataQuality object with a 'dataset' scope
dq <- ISODataQuality$new()
scope <- ISODataQualityScope$new()
scope$setLevel("dataset")
dq$setScope(scope)
#add data quality reports...
#add a report the data quality
dc <- ISODomainConsistency$new()
result <- ISOConformanceResult$new()
spec <- ISOCitation$new()
spec$setTitle("Data Quality check")
spec$addAlternateTitle("This is is some data quality check report")
d <- ISODate$new()
d$setDate(ISOdate(2015, 1, 1, 1))
d$setDateType("publication")
spec$addDate(d)
result$setSpecification(spec)
result$setExplanation("some explanation about the conformance")
result$setPass(TRUE)
dc$addResult(result)
dq$addReport(dc)
#add INSPIRE reports?
#INSPIRE - interoperability of spatial data sets and services
dc_inspire1 <- ISODomainConsistency$new()
cr_inspire1 <- ISOConformanceResult$new()
cr_inspire_spec1 <- ISOCitation$new()
cr_title1 <- paste(
"Commission Regulation (EU) No 1089/2010 of 23 November 2010 implementing Directive 2007/2/EC",
"of the European Parliament and of the Council as regards interoperability of spatial data",
"sets and services"
)
cr_inspire_spec1$setTitle(cr_title1)
cr_inspire1$setExplanation("See the referenced specification")
cr_inspire_date1 <- ISODate$new()
cr_inspire_date1$setDate(ISOdate(2010,12,8))
cr_inspire_date1$setDateType("publication")
cr_inspire_spec1$addDate(cr_inspire_date1)
cr_inspire1$setSpecification(cr_inspire_spec1)
cr_inspire1$setPass(TRUE)
dc_inspire1$addResult(cr_inspire1)
dq$addReport(dc_inspire1)
#INSPIRE - metadata
dc_inspire2 <- ISODomainConsistency$new()
cr_inspire2 <- ISOConformanceResult$new()
cr_inspire_spec2 <- ISOCitation$new()
cr_title2 <- paste(
"COMMISSION REGULATION (EC) No 1205/2008 of 3 December 2008 implementing Directive 2007/2/EC",
"of the European Parliament and of the Council as regards metadata"
)
cr_inspire_spec2$setTitle(cr_title2)
cr_inspire2$setExplanation("See the referenced specification")
cr_inspire_date2 <- ISODate$new()
cr_inspire_date2$setDate(ISOdate(2008,12,4))
cr_inspire_date2$setDateType("publication")
cr_inspire_spec2$addDate(cr_inspire_date2)
cr_inspire2$setSpecification(cr_inspire_spec2)
cr_inspire2$setPass(TRUE)
dc_inspire2$addResult(cr_inspire2)
dq$addReport(dc_inspire2)
#add lineage
lineage <- ISOLineage$new()
lineage$setStatement("statement")
dq$setLineage(lineage)
md$addDataQualityInfo(dq)
#Content Information
#-------------------------
#add a feature catalogue description
fcd <- ISOFeatureCatalogueDescription$new()
fcd$setComplianceCode(FALSE)
fcd$addLanguage("eng")
fcd$setIncludedWithDataset(FALSE)
cit = ISOCitation$new()
cit$setTitle("sometitle")
d <- ISODate$new()
d$setDate(ISOdate(2015, 1, 1, 1))
d$setDateType("publication")
cit$addDate(d)
cit$setEdition("1.0")
cit$setEditionDate(as.Date(ISOdate(2015, 1, 1, 1)))
contact = ISOContact$new()
fcLink <- ISOOnlineResource$new()
fcLink$setLinkage("http://somelink/featurecatalogue")
contact$setOnlineResource(fcLink)
rp = ISOResponsibleParty$new()
rp$setRole("publisher")
rp$setContactInfo(contact)
cit$addCitedResponsibleParty(rp)
fcd$addFeatureCatalogueCitation(cit)
md$addContentInfo(fcd)
#XML representation of the ISOMetadata
xml <- md$encode()
#example 2 - READ: Create an ISO metadata reading from XML
######################################################
require(XML)
xmlfile <- system.file("extdata/examples", "metadata.xml", package = "geometa")
xml <- xmlParse(xmlfile)
md <- ISOMetadata$new(xml = xml)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.