/**
*
* Clase para generar la estructura del metadato en los diferentes formatos admitidos por GEONETWORK
* @author Joguer Tacas Misaico(tacasmisaico@gmail.com)
* @version 1.0.0
*
*/
class Metadata{
private $_xmlns;
private $_gmd;
private $_xsi;
private $_gml;
private $_gts;
private $_gco;
private $_geonet;
private $_codeList;
private $_srv;
/**
*
* Método constructor que inicializa los atributos estáticos
*/
public function __construct(){
$this->_xmlns = 'http://www.w3.org/2000/xmlns/';
$this->_gmd = 'http://www.isotc211.org/2005/gmd';
$this->_xsi = 'http://www.w3.org/2001/XMLSchema-instance';
$this->_gml = 'http://www.opengis.net/gml';
$this->_gts = 'http://www.isotc211.org/2005/gts';
$this->_gco = 'http://www.isotc211.org/2005/gco';
$this->_geonet = 'http://www.fao.org/geonetwork';
$this->_codeList = 'http://www.isotc211.org/2005/resources/codeList.xml';
$this->_srv = 'http://www.isotc211.org/2005/srv';
}
/**
*
* Método que se encarga de generar la estructura del xml a almacenar como metadata del documento
* @access private
* @param
* @return DOMDocument
*/
public function generate19139($pName, $pDateTime, $pAbstract, $pGUID, $pLanguage,
$pAuthorName, $pAuthorEntity, $pAuthorEmail, $pProviderName, $pProviderEntity,
$pProviderEmail, $pKeywords, $pUrlDocument, $pFormat, $pVersion,
$pLogo, $pCategory, $pNorma, $pRSIdentifier, $pRSCode){
$doc=new DOMDocument();
$doc->preserveWhiteSpace=false;
$doc->formatOutput=true;
$mdMetadata=$doc->createElementNS($this->_gmd,'gmd:MD_Metadata');
$mdMetadata->setAttributeNS($this->_xmlns, 'xmlns:xsi', $this->_xsi);
$mdMetadata->setAttributeNS($this->_xmlns, 'xmlns:gml', $this->_gml);
$mdMetadata->setAttributeNS($this->_xmlns, 'xmlns:gts', $this->_gts);
$mdMetadata->setAttributeNS($this->_xmlns, 'xmlns:gco', $this->_gco);
$mdMetadata->setAttributeNS($this->_xmlns, 'xmlns:geonet', $this->_geonet);
$doc->appendChild($mdMetadata);
$fileIdentifier = $doc->createElementNS($this->_gmd, 'fileIdentifier');
$mdMetadata->appendChild($fileIdentifier);
$characterString = $doc->createElementNS($this->_gco, 'CharacterString',$pGUID);
$fileIdentifier->appendChild($characterString);
$language=$doc->createElementNS($this->_gmd,'language');
$mdMetadata->appendChild($language);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString','spa');
$language->appendChild($characterString);
$characterSet=$doc->createElementNS($this->_gmd, 'characterSet');
$mdMetadata->appendChild($characterSet);
$mdCharacterSetCode=$doc->createElementNS($this->_gmd,'MD_CharacterSetCode');
$mdCharacterSetCode->setAttribute('codeListValue', 'utf8');
$mdCharacterSetCode->setAttribute('codeList', $this->_codeList.'#MD_CharacterSetCode');
$characterSet->appendChild($mdCharacterSetCode);
$contact= $doc->createElementNS($this->_gmd,'contact');
$mdMetadata->appendChild($contact);
$ciResponsibleParty=$doc->createElementNS($this->_gmd, 'CI_ResponsibleParty');
$contact->appendChild($ciResponsibleParty);
$individualName=$doc->createElementNS($this->_gmd,'individualName');
$ciResponsibleParty->appendChild($individualName);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString',$pAuthorName);//nombre del autor
$individualName->appendChild($characterString);
$organisationName=$doc->createElementNS($this->_gmd, 'organisationName');
$ciResponsibleParty->appendChild($organisationName);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString',$pAuthorEntity);//institucion del autor
$organisationName->appendChild($characterString);
$contactInfo=$doc->createElementNS($this->_gmd,'contactInfo');
$ciResponsibleParty->appendChild($contactInfo);
$ciContact=$doc->createElementNS($this->_gmd, 'CI_Contact');
$contactInfo->appendChild($ciContact);
$phone=$doc->createElementNS($this->_gmd,'phone');
$ciContact->appendChild($phone);
$ciTelephone=$doc->createElementNS($this->_gmd, 'CI_Telephone');
$phone->appendChild($ciTelephone);
$address=$doc->createElementNS($this->_gmd, 'address');
$ciContact->appendChild($address);
$ciAddress=$doc->createElementNS($this->_gmd,'CI_Address');
$address->appendChild($ciAddress);
$electronicMailAddress=$doc->createElementNS($this->_gmd,'electronicMailAddress');
$ciAddress->appendChild($electronicMailAddress);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString',$pAuthorEmail);//correo electronico del author
$electronicMailAddress->appendChild($characterString);
$role= $doc->createElementNS($this->_gmd,'role');
$ciResponsibleParty->appendChild($role);
$ciRoleCode= $doc->createElementNS($this->_gmd,'CI_RoleCode');
$ciRoleCode->setAttribute('codeListValue', '001');
$ciRoleCode->setAttribute('codeList', $this->_codeList.'#CI_RoleCode');
$role->appendChild($ciRoleCode);
$dateStamp= $doc->createElementNS($this->_gmd,'dateStamp');
$mdMetadata->appendChild($dateStamp);
$dateTime=$doc->createElementNS($this->_gco,'DateTime',$pDateTime);//fecha del metadato
$dateTime->setAttributeNS($this->_xmlns,'xmlns:srv', $this->_srv);
$dateStamp->appendChild($dateTime);
$metadataStandardName=$doc->createElementNS($this->_gmd, 'metadataStandardName');
$mdMetadata->appendChild($metadataStandardName);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString','ISO 19115:2003/19139');
$characterString->setAttributeNS($this->_xmlns,'xmlns:srv', $this->_srv);
$metadataStandardName->appendChild($characterString);
$metadataStandardVersion=$doc->createElementNS($this->_gmd, 'metadataStandardVersion');
$mdMetadata->appendChild($metadataStandardVersion);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString','1.0');
$characterString->setAttributeNS($this->_xmlns,'xmlns:srv', $this->_srv);
$metadataStandardVersion->appendChild($characterString);
$spatialRepresentationInfo=$doc->createElementNS($this->_gmd,'spatialRepresentationInfo');
$mdMetadata->appendChild($spatialRepresentationInfo);
$mdVectorSpatialRepresentation=$doc->createElementNS($this->_gmd,'MD_VectorSpatialRepresentation');
$spatialRepresentationInfo->appendChild($mdVectorSpatialRepresentation);
$topologyLevel =$doc->createElementNS($this->_gmd, 'topologyLevel');
$mdVectorSpatialRepresentation->appendChild($topologyLevel);
$mdTopologyLevelCode=$doc->createElementNS($this->_gmd,'MD_TopologyLevelCode');
$mdTopologyLevelCode->setAttribute('codeListValue', '001');
$mdTopologyLevelCode->setAttribute('codeList', $this->_codeList.'#MD_TopologyLevelCode');
$topologyLevel->appendChild($mdTopologyLevelCode);
$geometricObjects=$doc->createElementNS($this->_gmd, 'geometricObjects');
$mdVectorSpatialRepresentation->appendChild($geometricObjects);
$mdgeometricObjects=$doc->createElementNS($this->_gmd,'MD_GeometricObjects');
$geometricObjects->appendChild($mdgeometricObjects);
$geometricObjectType=$doc->createElementNS($this->_gmd, 'geometricObjectType');
$mdgeometricObjects->appendChild($geometricObjectType);
$mdGeometricObjectTypeCode=$doc->createElementNS($this->_gmd,'MD_GeometricObjectTypeCode');
$mdGeometricObjectTypeCode->setAttribute('codeListValue', '001');
$mdGeometricObjectTypeCode->setAttribute('codeList', $this->_codeList.'#MD_GeometricObjectTypeCode');
$geometricObjectType->appendChild($mdGeometricObjectTypeCode);
$referenceSystemInfo =$doc->createElementNS($this->_gmd,'referenceSystemInfo');
$mdMetadata->appendChild($referenceSystemInfo);
$mdReferenceSystem= $doc->createElementNS($this->_gmd,'MD_ReferenceSystem');
$referenceSystemInfo->appendChild($mdReferenceSystem);
$referenceSysemIdentifier=$doc->createElementNS($this->_gmd,'referenceSystemIdentifier');
$mdReferenceSystem->appendChild($referenceSysemIdentifier);
$rsIdentifier=$doc->createElementNS($this->_gmd, 'RS_Identifier');
$referenceSysemIdentifier->appendChild($rsIdentifier);
$code=$doc->createElementNS($this->_gmd,'code');
$rsIdentifier->appendChild($code);
$characterString=$doc->createElementNS($this->_gco,'CharacterString',$pRSIdentifier); //RS Identifier
$code->appendChild($characterString);
$codeSpace=$doc->createElementNS($this->_gmd,'codeSpace');
$rsIdentifier->appendChild($codeSpace);
$characterString=$doc->createElementNS($this->_gco,'CharacterString',$pRSCode); //WGS 84 Zone
$codeSpace->appendChild($characterString);
$identificationInfo =$doc->createElementNS($this->_gmd, 'identificationInfo');
$mdMetadata->appendChild($identificationInfo);
$mdDataIdentification = $doc->createElementNS($this->_gmd,'MD_DataIdentification');
$identificationInfo->appendChild($mdDataIdentification);
$citation=$doc->createElementNS($this->_gmd,'citation');
$mdDataIdentification->appendChild($citation);
$ciCitation =$doc->createElementNS($this->_gmd, 'CI_Citation');
$citation->appendChild($ciCitation);
$title=$doc->createElementNS($this->_gmd, 'title');
$ciCitation->appendChild($title);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString',$pName);//nombre de metadato
$title->appendChild($characterString);
$date =$doc->createElementNS($this->_gmd,'date');
$ciCitation->appendChild($date);
$ciDate=$doc->createElementNS($this->_gmd,'CI_Date');
$date->appendChild($ciDate);
$date =$doc->createElementNS($this->_gmd,'date');
$ciDate->appendChild($date);
$dateTime=$doc->createElementNS($this->_gco,'DateTime',$pDateTime);//fecha
$date->appendChild($dateTime);
$dateType=$doc->createElementNS($this->_gmd,'dateType');
$ciDate->appendChild($dateType);
$ciDateTypeCode= $doc->createElementNS($this->_gmd,'CI_DateTypeCode');
$ciDateTypeCode->setAttribute('codeListValue', '001');
$ciDateTypeCode->setAttribute('codeList', $this->_codeList.'#CI_DateTypeCode');
$dateType->appendChild($ciDateTypeCode);
$presentationForm= $doc->createElementNS($this->_gmd, 'presentationForm');
$ciCitation->appendChild($presentationForm);
$ciPresentationFormCode=$doc->createElementNS($this->_gmd,'CI_PresentationFormCode');
$ciPresentationFormCode->setAttribute('codeListValue', '005');
$ciPresentationFormCode->setAttribute('codeList', $this->_codeList.'#CI_PresentationFormCode');
$presentationForm->appendChild($ciPresentationFormCode);
$abstract=$doc->createElementNS($this->_gmd,'abstract');
$mdDataIdentification->appendChild($abstract);
$characterString=$doc->createElementNS($this->_gco,'CharacterString',$pAbstract);//resumen
$abstract->appendChild($characterString);
$status = $doc->createElementNS($this->_gmd, 'status');
$mdDataIdentification->appendChild($status);
$mdProgressCode=$doc->createElementNS($this->_gmd, 'MD_ProgressCode');
$mdProgressCode->setAttribute('codeListValue', '001');
$mdProgressCode->setAttribute('codeList', $this->_codeList.'#MD_ProgressCode');
$status->appendChild($mdProgressCode);
$pointOfContact=$doc->createElementNS($this->_gmd,'pointOfContact');
$mdDataIdentification->appendChild($pointOfContact);
$ciResponsibleParty=$doc->createElementNS($this->_gmd,'CI_ResponsibleParty');
$pointOfContact->appendChild($ciResponsibleParty);
$individualName=$doc->createElementNS($this->_gmd,'individualName');
$ciResponsibleParty->appendChild($individualName);
$characterString=$doc->createElementNS($this->_gco,'CharacterString', $pProviderName);//author del dato
$individualName->appendChild($characterString);
$organisationName= $doc->createElementNS($this->_gmd, 'organisationName');
$ciResponsibleParty->appendChild($organisationName);
$characterString=$doc->createElementNS($this->_gco,'CharacterString', $pProviderEntity);//institucion del author
$organisationName->appendChild($characterString);
$contactInfo=$doc->createElementNS($this->_gmd,'contactInfo');
$ciResponsibleParty->appendChild($contactInfo);
$ciContact=$doc->createElementNS($this->_gmd, 'CI_Contact');
$contactInfo->appendChild($ciContact);
$phone=$doc->createElementNS($this->_gmd,'phone');
$ciContact->appendChild($phone);
$ciTelephone=$doc->createElementNS($this->_gmd, 'CI_Telephone');
$phone->appendChild($ciTelephone);
$address = $doc->createElementNS($this->_gmd, 'address');
$ciContact->appendChild($address);
$ciAddress = $doc->createElementNS($this->_gmd,'CI_Address');
$address->appendChild($ciAddress);
$electronicMailAddress = $doc->createElementNS($this->_gmd,'electronicMailAddress');
$ciAddress->appendChild($electronicMailAddress);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString',$pProviderEmail);//correo electronico del author
$electronicMailAddress->appendChild($characterString);
$role= $doc->createElementNS($this->_gmd,'role');
$ciResponsibleParty->appendChild($role);
$ciRoleCode = $doc->createElementNS($this->_gmd,'CI_RoleCode');
$ciRoleCode->setAttribute('codeListValue', '002');
$ciRoleCode->setAttribute('codeList', $this->_codeList.'#CI_RoleCode');
$role->appendChild($ciRoleCode);
$graphicOverview = $doc->createElementNS($this->_gmd, 'graphicOverview');
$mdDataIdentification->appendChild($graphicOverview);
$mdBrowseGraphic = $doc->createElementNS($this->_gmd,'MD_BrowseGraphic');
$graphicOverview->appendChild($mdBrowseGraphic);
$fileName = $doc->createElementNS($this->_gmd, 'fileName');
$mdBrowseGraphic->appendChild($fileName);
$characterString = $doc->createElementNS($this->_gco,'CharacterString',$pLogo);//logo de la institucion
$fileName->appendChild($characterString);
$fileDescription=$doc->createElementNS($this->_gmd,'fileDescription');
$mdBrowseGraphic->appendChild($fileDescription);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','thumbnail');
$fileDescription->appendChild($characterString);
$fileType=$doc->createElementNS($this->_gmd,'fileType');
$mdBrowseGraphic->appendChild($fileType);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','png');
$fileType->appendChild($characterString);
$descriptiveKeywords = $doc->createElementNS($this->_gmd,'descriptiveKeywords');
$mdDataIdentification->appendChild($descriptiveKeywords);
$mdKeywords=$doc->createElementNS($this->_gmd,'MD_Keywords');
$descriptiveKeywords->appendChild($mdKeywords);
$keyword = $doc->createElementNS($this->_gmd, 'keyword');
$mdKeywords->appendChild($keyword);
$characterString = $doc->createElementNS($this->_gco,'CharacterString',$pKeywords);//keywords
$keyword->appendChild($characterString);
$type = $doc->createElementNS($this->_gmd,'type');
$mdKeywords->appendChild($type);
$mdKeywordTypeCode=$doc->createElementNS($this->_gmd, 'MD_KeywordTypeCode');
$mdKeywordTypeCode->setAttribute('codeListValue', '005');
$mdKeywordTypeCode->setAttribute('codeList', $this->_codeList.'#MD_KeywordTypeCode');
$type->appendChild($mdKeywordTypeCode);
$spatialRepresentationType = $doc->createElementNS($this->_gmd, 'spatialRepresentationType');
$mdDataIdentification->appendChild($spatialRepresentationType);
$mdSpatialRepresentationTypeCode= $doc->createElementNS($this->_gmd, 'MD_SpatialRepresentationTypeCode');
$mdSpatialRepresentationTypeCode->setAttribute('codeListValue', '001');
$mdSpatialRepresentationTypeCode->setAttribute('codeList', $this->_codeList.'#MD_SpatialRepresentationTypeCode');
$spatialRepresentationType->appendChild($mdSpatialRepresentationTypeCode);
$spatialResolution = $doc->createElementNS($this->_gmd, 'spatialResolution');
$mdDataIdentification->appendChild($spatialResolution);
$mdResolution = $doc->createElementNS($this->_gmd,'MD_Resolution');
$spatialResolution->appendChild($mdResolution);
$equivalentScale= $doc->createElementNS($this->_gmd,'equivalentScale');
$mdResolution->appendChild($equivalentScale);
$mdRepresentativeFraction = $doc->createElementNS($this->_gmd,'MD_RepresentativeFraction');
$equivalentScale->appendChild($mdRepresentativeFraction);
$denominator= $doc->createElementNS($this->_gmd,'denominator');
$mdRepresentativeFraction->appendChild($denominator);
$integer = $doc->createElementNS($this->_gco,'Integer','50000');//la scala
$denominator->appendChild($integer);
$language = $doc->createElementNS($this->_gmd,'language');
$mdDataIdentification->appendChild($language);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString',$pLanguage);//idioma
$language->appendChild($characterString);
$characterSet = $doc->createElementNS($this->_gmd, 'characterSet');
$mdDataIdentification->appendChild($characterSet);
$mdCharacterSetCode = $doc->createElementNS($this->_gmd,'MD_CharacterSetCode');
$mdCharacterSetCode->setAttribute('codeListValue', 'utf8');
$mdCharacterSetCode->setAttribute('codeList', $this->_codeList.'#MD_CharacterSetCode');
$characterSet->appendChild($mdCharacterSetCode);
$topicCategory = $doc->createElementNS($this->_gmd,'topicCategory');
$mdDataIdentification->appendChild($topicCategory);
$mdTopicCategoryCode = $doc->createElementNS($this->_gmd,'MD_TopicCategoryCode',$pCategory);//categoría
$topicCategory->appendChild($mdTopicCategoryCode);
$extent = $doc->createElementNS($this->_gmd,'extent');
$mdDataIdentification->appendChild($extent);
$exExtent = $doc->createElementNS($this->_gmd, 'EX_Extent');
$extent->appendChild($exExtent);
$geographicElement = $doc->createElementNS($this->_gmd, 'geographicElement');
$exExtent->appendChild($geographicElement);
$exGeographicBoundingBox = $doc->createElementNS($this->_gmd,'EX_GeographicBoundingBox');
$geographicElement->appendChild($exGeographicBoundingBox);
$westBoundLongitude = $doc->createElementNS($this->_gmd,'westBoundLongitude');
$exGeographicBoundingBox->appendChild($westBoundLongitude);
$decimal = $doc->createElementNS($this->_gco,'Decimal', -81.35515);
$westBoundLongitude->appendChild($decimal);
$eastBoundLongitude = $doc->createElementNS($this->_gmd,'eastBoundLongitude');
$exGeographicBoundingBox->appendChild($eastBoundLongitude);
$decimal = $doc->createElementNS($this->_gco,'Decimal', -68.6739);
$eastBoundLongitude->appendChild($decimal);
$southBoundLatitude = $doc->createElementNS($this->_gmd,'southBoundLatitude');
$exGeographicBoundingBox->appendChild($southBoundLatitude);
$decimal = $doc->createElementNS($this->_gco,'Decimal', -18.34855);
$southBoundLatitude->appendChild($decimal);
$northBoundLatitude = $doc->createElementNS($this->_gmd,'northBoundLatitude');
$exGeographicBoundingBox->appendChild($northBoundLatitude);
$decimal = $doc->createElementNS($this->_gco,'Decimal', -0.03687);
$northBoundLatitude->appendChild($decimal);
$distributionInfo = $doc->createElementNS($this->_gmd, 'distributionInfo');
$mdMetadata->appendChild($distributionInfo);
$mdDistribution = $doc->createElementNS($this->_gmd, 'MD_Distribution');
$distributionInfo->appendChild($mdDistribution);
$distributionFormat = $doc->createElementNS($this->_gmd, 'distributionFormat');
$mdDistribution->appendChild($distributionFormat);
$mdFormat = $doc->createElementNS($this->_gmd,'MD_Format');
$distributionFormat->appendChild($mdFormat);
$name = $doc->createElementNS($this->_gmd,'name');
$mdFormat->appendChild($name);
$characterString = $doc->createElementNS($this->_gco,'CharacterString', $pFormat);//formato
$name->appendChild($characterString);
$version = $doc->createElementNS($this->_gmd,'version');
$mdFormat->appendChild($version);
$characterString = $doc->createElementNS($this->_gco,'CharacterString', $pVersion);//version
$version->appendChild($characterString);
$transferOptions = $doc->createElementNS($this->_gmd, 'transferOptions');
$mdDistribution->appendChild($transferOptions);
$mdDigitalTransferOptions = $doc->createElementNS($this->_gmd, 'MD_DigitalTransferOptions');
$transferOptions->appendChild($mdDigitalTransferOptions);
$onLine = $doc->createElementNS($this->_gmd, 'onLine');
$mdDigitalTransferOptions->appendChild($onLine);
$ciOnLineResource = $doc->createElementNS($this->_gmd, 'CI_OnlineResource');
$onLine->appendChild($ciOnLineResource);
$linkAge = $doc->createElementNS($this->_gmd, 'linkage');
$ciOnLineResource->appendChild($linkAge);
$url = $doc->createElementNS($this->_gmd, 'URL',$pUrlDocument); //url
$linkAge->appendChild($url);
$protocol = $doc->createElementNS($this->_gmd, 'protocol');
$ciOnLineResource->appendChild($protocol);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','WWW:LINK-1.0-http--link' ); //protocolo
$protocol->appendChild($characterString);
$name = $doc->createElementNS($this->_gmd, 'name');
$name->setAttribute('gco:nilReason', 'missing');
$ciOnLineResource->appendChild($name);
$characterString = $doc->createElementNS($this->_gco,'CharacterString');
$name->appendChild($characterString);
$onLine = $doc->createElementNS($this->_gmd, 'onLine');
$mdDigitalTransferOptions->appendChild($onLine);
$ciOnLineResource = $doc->createElementNS($this->_gmd, 'CI_OnlineResource');
$onLine->appendChild($ciOnLineResource);
$linkAge = $doc->createElementNS($this->_gmd, 'linkage');
$ciOnLineResource->appendChild($linkAge);
$url = $doc->createElementNS($this->_gmd, 'URL',''); //url wms
$linkAge->appendChild($url);
$protocol = $doc->createElementNS($this->_gmd, 'protocol');
$ciOnLineResource->appendChild($protocol);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','' ); //protocolo OGC:WMS-1.1.1-http-get-map
$protocol->appendChild($characterString);
$name = $doc->createElementNS($this->_gmd, 'name');
$ciOnLineResource->appendChild($name);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','');//Nombre de capas o layer separado por comas
$name->appendChild($characterString);
$description = $doc->createElementNS($this->_gmd, 'description');
$ciOnLineResource->appendChild($description);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','');//Url del servicio WMS o Descripcion del servicio
$description->appendChild($characterString);
$dataQualityInfo = $doc->createElementNS($this->_gmd,'dataQualityInfo');
$mdMetadata->appendChild($dataQualityInfo);
$dqDataQuality = $doc->createElementNS($this->_gmd, 'DQ_DataQuality');
$dataQualityInfo->appendChild($dqDataQuality);
$scope = $doc->createElementNS($this->_gmd, 'scope');
$dqDataQuality->appendChild($scope);
$dqScope = $doc->createElementNS($this->_gmd,'DQ_Scope');
$scope->appendChild($dqScope);
$level = $doc->createElementNS($this->_gmd,'level');
$dqScope->appendChild($level);
$mdScopeCode = $doc->createElementNS($this->_gmd, 'MD_ScopeCode');
$mdScopeCode->setAttribute('codeListValue', '001');
$mdScopeCode->setAttribute('codeList', $this->_codeList.'#MD_ScopeCode');
$level->appendChild($mdScopeCode);
$lineage = $doc->createElementNS($this->_gmd,'lineage');
$dqDataQuality->appendChild($lineage);
$liLineage = $doc->createElementNS($this->_gmd, 'LI_Lineage');
$lineage->appendChild($liLineage);
$statement = $doc->createElementNS($this->_gmd, 'statement');
$liLineage->appendChild($statement);
$characterString = $doc->createElementNS($this->_gco, 'CharacterString',$pNorma); // norma de los metadatos
$statement->appendChild($characterString);
$metadataConstraints = $doc->createElementNS($this->_gmd,'metadataConstraints');
$mdMetadata->appendChild($metadataConstraints);
$mdLegalConstraints = $doc->createElementNS($this->_gmd, 'MD_LegalConstraints');
$metadataConstraints->appendChild($mdLegalConstraints);
$accessConstraints = $doc->createElementNS($this->_gmd, 'accessConstraints');
$mdLegalConstraints->appendChild($accessConstraints);
$mdRestrictionCode = $doc->createElementNS($this->_gmd, 'MD_RestrictionCode');
$mdRestrictionCode->setAttribute('codeListValue', '001');
$mdRestrictionCode->setAttribute('codeList', $this->_codeList.'#MD_RestrictionCode');
$accessConstraints->appendChild($mdRestrictionCode);
$useConstraints = $doc->createElementNS($this->_gmd, 'useConstraints');
$mdLegalConstraints->appendChild($useConstraints);
$mdRestrictionCode = $doc->createElementNS($this->_gmd, 'MD_RestrictionCode');
$mdRestrictionCode->setAttribute('codeListValue', '001');
$mdRestrictionCode->setAttribute('codeList', $this->_codeList.'#MD_RestrictionCode');
$useConstraints->appendChild($mdRestrictionCode);
$otherConstraints = $doc->createElementNS($this->_gmd,'otherConstraints');
$mdLegalConstraints->appendChild($otherConstraints);
$characterString = $doc->createElementNS($this->_gco,'CharacterString', '');//otras restricciones
$otherConstraints->appendChild($characterString);
$metadataMaintenance = $doc->createElementNS($this->_gmd, 'metadataMaintenance');
$mdMetadata->appendChild($metadataMaintenance);
$mdMaintenanceInformation = $doc->createElementNS($this->_gmd, 'MD_MaintenanceInformation');
$metadataMaintenance->appendChild($mdMaintenanceInformation);
$maintenanceAndUpdateFrequency = $doc->createElementNS($this->_gmd, 'maintenanceAndUpdateFrequency');
$mdMaintenanceInformation->appendChild($maintenanceAndUpdateFrequency);
$mdMaintenanceFrequencyCode = $doc->createElementNS($this->_gmd,'MD_MaintenanceFrequencyCode');
$mdMaintenanceFrequencyCode->setAttribute('codeListValue', '001');
$mdMaintenanceFrequencyCode->setAttribute('codeList', $this->_codeList.'#MD_MaintenanceFrequencyCode');
$maintenanceAndUpdateFrequency->appendChild($mdMaintenanceFrequencyCode);
$metadata= $doc->saveXML($mdMetadata);
return $metadata;
}
public function generate191392($name,$dateTime,$abstract, $authorName,$authorEntity,$authorEmail,
$providerName,$providerEntity,$providerEmail,$logo,$keywords, $category, $formato, $version, $urlDocument,$norma){
$doc=new DOMDocument();
$doc->preserveWhiteSpace=false;
$doc->formatOutput=true;
$mdMetadata=$doc->createElementNS($this->_gmd,'gmd:MD_Metadata');
$mdMetadata->setAttributeNS($this->_xmlns, 'xmlns:xsi', $this->_xsi);
$mdMetadata->setAttributeNS($this->_xmlns, 'xmlns:gml', $this->_gml);
$mdMetadata->setAttributeNS($this->_xmlns, 'xmlns:gts', $this->_gts);
$mdMetadata->setAttributeNS($this->_xmlns, 'xmlns:gco', $this->_gco);
$mdMetadata->setAttributeNS($this->_xmlns, 'xmlns:geonet', $this->_geonet);
$doc->appendChild($mdMetadata);
$fileIdentifier = $doc->createElementNS($this->_gmd, 'fileIdentifier');
$mdMetadata->appendChild($fileIdentifier);
$characterString = $doc->createElementNS($this->_gco, 'CharacterString','0e677227-c1be-4b16-bfe9-4c4d0b81ac98');
$fileIdentifier->appendChild($characterString);
$language=$doc->createElementNS($this->_gmd,'language');
$mdMetadata->appendChild($language);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString','spa');
$language->appendChild($characterString);
$characterSet=$doc->createElementNS($this->_gmd, 'characterSet');
$mdMetadata->appendChild($characterSet);
$mdCharacterSetCode=$doc->createElementNS($this->_gmd,'MD_CharacterSetCode');
$mdCharacterSetCode->setAttribute('codeListValue', 'utf8');
$mdCharacterSetCode->setAttribute('codeList', $this->_codeList.'#MD_CharacterSetCode');
$characterSet->appendChild($mdCharacterSetCode);
$contact= $doc->createElementNS($this->_gmd,'contact');
$mdMetadata->appendChild($contact);
$ciResponsibleParty=$doc->createElementNS($this->_gmd, 'CI_ResponsibleParty');
$contact->appendChild($ciResponsibleParty);
$individualName=$doc->createElementNS($this->_gmd,'individualName');
$ciResponsibleParty->appendChild($individualName);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString','Nombre del autor del Metadato');//nombre del autor
$individualName->appendChild($characterString);
$organisationName=$doc->createElementNS($this->_gmd, 'organisationName');
$ciResponsibleParty->appendChild($organisationName);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString','Institución al que pertenece');//institucion del autor
$organisationName->appendChild($characterString);
$contactInfo=$doc->createElementNS($this->_gmd,'contactInfo');
$ciResponsibleParty->appendChild($contactInfo);
$ciContact=$doc->createElementNS($this->_gmd, 'CI_Contact');
$contactInfo->appendChild($ciContact);
$phone=$doc->createElementNS($this->_gmd,'phone');
$ciContact->appendChild($phone);
$ciTelephone=$doc->createElementNS($this->_gmd, 'CI_Telephone');
$phone->appendChild($ciTelephone);
$address=$doc->createElementNS($this->_gmd, 'address');
$ciContact->appendChild($address);
$ciAddress=$doc->createElementNS($this->_gmd,'CI_Address');
$address->appendChild($ciAddress);
$electronicMailAddress=$doc->createElementNS($this->_gmd,'electronicMailAddress');
$ciAddress->appendChild($electronicMailAddress);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString','correo@institucion.gob.pe');//correo electronico del author
$electronicMailAddress->appendChild($characterString);
$role= $doc->createElementNS($this->_gmd,'role');
$ciResponsibleParty->appendChild($role);
$ciRoleCode= $doc->createElementNS($this->_gmd,'CI_RoleCode');
$ciRoleCode->setAttribute('codeListValue', '001');
$ciRoleCode->setAttribute('codeList', $this->_codeList.'#CI_RoleCode');
$role->appendChild($ciRoleCode);
$dateStamp= $doc->createElementNS($this->_gmd,'dateStamp');
$mdMetadata->appendChild($dateStamp);
$dateTime=$doc->createElementNS($this->_gco,'DateTime','2008-10-17T13:00:17');//fecha del metadato
$dateTime->setAttributeNS($this->_xmlns,'xmlns:srv', $this->_srv);
$dateStamp->appendChild($dateTime);
$metadataStandardName=$doc->createElementNS($this->_gmd, 'metadataStandardName');
$mdMetadata->appendChild($metadataStandardName);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString','ISO 19115:2003/19139');
$characterString->setAttributeNS($this->_xmlns,'xmlns:srv', $this->_srv);
$metadataStandardName->appendChild($characterString);
$metadataStandardVersion=$doc->createElementNS($this->_gmd, 'metadataStandardVersion');
$mdMetadata->appendChild($metadataStandardVersion);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString','1.0');
$characterString->setAttributeNS($this->_xmlns,'xmlns:srv', $this->_srv);
$metadataStandardVersion->appendChild($characterString);
$spatialRepresentationInfo=$doc->createElementNS($this->_gmd,'spatialRepresentationInfo');
$mdMetadata->appendChild($spatialRepresentationInfo);
$mdVectorSpatialRepresentation=$doc->createElementNS($this->_gmd,'MD_VectorSpatialRepresentation');
$spatialRepresentationInfo->appendChild($mdVectorSpatialRepresentation);
$topologyLevel =$doc->createElementNS($this->_gmd, 'topologyLevel');
$mdVectorSpatialRepresentation->appendChild($topologyLevel);
$mdTopologyLevelCode=$doc->createElementNS($this->_gmd,'MD_TopologyLevelCode');
$mdTopologyLevelCode->setAttribute('codeListValue', '001');
$mdTopologyLevelCode->setAttribute('codeList', $this->_codeList.'#MD_TopologyLevelCode');
$topologyLevel->appendChild($mdTopologyLevelCode);
$geometricObjects=$doc->createElementNS($this->_gmd, 'geometricObjects');
$mdVectorSpatialRepresentation->appendChild($geometricObjects);
$mdgeometricObjects=$doc->createElementNS($this->_gmd,'MD_GeometricObjects');
$geometricObjects->appendChild($mdgeometricObjects);
$geometricObjectType=$doc->createElementNS($this->_gmd, 'geometricObjectType');
$mdgeometricObjects->appendChild($geometricObjectType);
$mdGeometricObjectTypeCode=$doc->createElementNS($this->_gmd,'MD_GeometricObjectTypeCode');
$mdGeometricObjectTypeCode->setAttribute('codeListValue', '001');
$mdGeometricObjectTypeCode->setAttribute('codeList', $this->_codeList.'#MD_GeometricObjectTypeCode');
$geometricObjectType->appendChild($mdGeometricObjectTypeCode);
$referenceSystemInfo =$doc->createElementNS($this->_gmd,'referenceSystemInfo');
$mdMetadata->appendChild($referenceSystemInfo);
$mdReferenceSystem= $doc->createElementNS($this->_gmd,'MD_ReferenceSystem');
$referenceSystemInfo->appendChild($mdReferenceSystem);
$referenceSysemIdentifier=$doc->createElementNS($this->_gmd,'referenceSystemIdentifier');
$mdReferenceSystem->appendChild($referenceSysemIdentifier);
$rsIdentifier=$doc->createElementNS($this->_gmd, 'RS_Identifier');
$referenceSysemIdentifier->appendChild($rsIdentifier);
$code=$doc->createElementNS($this->_gmd,'code');
$rsIdentifier->appendChild($code);
$characterString=$doc->createElementNS($this->_gco,'CharacterString','EPSG:32718');
$code->appendChild($characterString);
$codeSpace=$doc->createElementNS($this->_gmd,'codeSpace');
$rsIdentifier->appendChild($codeSpace);
$characterString=$doc->createElementNS($this->_gco,'CharacterString','WGS 84 / UTM zona 18S');
$codeSpace->appendChild($characterString);
$identificationInfo =$doc->createElementNS($this->_gmd, 'identificationInfo');
$mdMetadata->appendChild($identificationInfo);
$mdDataIdentification = $doc->createElementNS($this->_gmd,'MD_DataIdentification');
$identificationInfo->appendChild($mdDataIdentification);
$citation=$doc->createElementNS($this->_gmd,'citation');
$mdDataIdentification->appendChild($citation);
$ciCitation =$doc->createElementNS($this->_gmd, 'CI_Citation');
$citation->appendChild($ciCitation);
$title=$doc->createElementNS($this->_gmd, 'title');
$ciCitation->appendChild($title);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString','Plantilla de Metadatos Generado por Yoguer');//nombre de metadato
$title->appendChild($characterString);
$date =$doc->createElementNS($this->_gmd,'date');
$ciCitation->appendChild($date);
$ciDate=$doc->createElementNS($this->_gmd,'CI_Date');
$date->appendChild($ciDate);
$date =$doc->createElementNS($this->_gmd,'date');
$ciDate->appendChild($date);
$dateTime=$doc->createElementNS($this->_gco,'DateTime','2008-05-05T16:14:00');//fecha
$date->appendChild($dateTime);
$dateType=$doc->createElementNS($this->_gmd,'dateType');
$ciDate->appendChild($dateType);
$ciDateTypeCode= $doc->createElementNS($this->_gmd,'CI_DateTypeCode');
$ciDateTypeCode->setAttribute('codeListValue', '001');
$ciDateTypeCode->setAttribute('codeList', $this->_codeList.'#CI_DateTypeCode');
$dateType->appendChild($ciDateTypeCode);
$presentationForm= $doc->createElementNS($this->_gmd, 'presentationForm');
$ciCitation->appendChild($presentationForm);
$ciPresentationFormCode=$doc->createElementNS($this->_gmd,'CI_PresentationFormCode');
$ciPresentationFormCode->setAttribute('codeListValue', '005');
$ciPresentationFormCode->setAttribute('codeList', $this->_codeList.'#CI_PresentationFormCode');
$presentationForm->appendChild($ciPresentationFormCode);
$abstract=$doc->createElementNS($this->_gmd,'abstract');
$mdDataIdentification->appendChild($abstract);
$characterString=$doc->createElementNS($this->_gco,'CharacterString','Una sIntesis que proporcione un resumen narrativo del contenido de datos');//resumen
$abstract->appendChild($characterString);
$status = $doc->createElementNS($this->_gmd, 'status');
$mdDataIdentification->appendChild($status);
$mdProgressCode=$doc->createElementNS($this->_gmd, 'MD_ProgressCode');
$mdProgressCode->setAttribute('codeListValue', '001');
$mdProgressCode->setAttribute('codeList', $this->_codeList.'#MD_ProgressCode');
$status->appendChild($mdProgressCode);
$pointOfContact=$doc->createElementNS($this->_gmd,'pointOfContact');
$mdDataIdentification->appendChild($pointOfContact);
$ciResponsibleParty=$doc->createElementNS($this->_gmd,'CI_ResponsibleParty');
$pointOfContact->appendChild($ciResponsibleParty);
$individualName=$doc->createElementNS($this->_gmd,'individualName');
$ciResponsibleParty->appendChild($individualName);
$characterString=$doc->createElementNS($this->_gco,'CharacterString', 'Nombre del proveedor o creador de los datos');//author del dato
$individualName->appendChild($characterString);
$organisationName= $doc->createElementNS($this->_gmd, 'organisationName');
$ciResponsibleParty->appendChild($organisationName);
$characterString=$doc->createElementNS($this->_gco,'CharacterString', 'Institucion al que pertenece');//institucion del author
$organisationName->appendChild($characterString);
$contactInfo=$doc->createElementNS($this->_gmd,'contactInfo');
$ciResponsibleParty->appendChild($contactInfo);
$ciContact=$doc->createElementNS($this->_gmd, 'CI_Contact');
$contactInfo->appendChild($ciContact);
$phone=$doc->createElementNS($this->_gmd,'phone');
$ciContact->appendChild($phone);
$ciTelephone=$doc->createElementNS($this->_gmd, 'CI_Telephone');
$phone->appendChild($ciTelephone);
$address = $doc->createElementNS($this->_gmd, 'address');
$ciContact->appendChild($address);
$ciAddress = $doc->createElementNS($this->_gmd,'CI_Address');
$address->appendChild($ciAddress);
$electronicMailAddress = $doc->createElementNS($this->_gmd,'electronicMailAddress');
$ciAddress->appendChild($electronicMailAddress);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString','correo@institucion.gob.pe');//correo electronico del author
$electronicMailAddress->appendChild($characterString);
$role= $doc->createElementNS($this->_gmd,'role');
$ciResponsibleParty->appendChild($role);
$ciRoleCode = $doc->createElementNS($this->_gmd,'CI_RoleCode');
$ciRoleCode->setAttribute('codeListValue', '002');
$ciRoleCode->setAttribute('codeList', $this->_codeList.'#CI_RoleCode');
$role->appendChild($ciRoleCode);
$graphicOverview = $doc->createElementNS($this->_gmd, 'graphicOverview');
$mdDataIdentification->appendChild($graphicOverview);
$mdBrowseGraphic = $doc->createElementNS($this->_gmd,'MD_BrowseGraphic');
$graphicOverview->appendChild($mdBrowseGraphic);
$fileName = $doc->createElementNS($this->_gmd, 'fileName');
$mdBrowseGraphic->appendChild($fileName);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','ideplogo_s.png');//logo de la institucion
$fileName->appendChild($characterString);
$fileDescription=$doc->createElementNS($this->_gmd,'fileDescription');
$mdBrowseGraphic->appendChild($fileDescription);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','thumbnail');
$fileDescription->appendChild($characterString);
$fileType=$doc->createElementNS($this->_gmd,'fileType');
$mdBrowseGraphic->appendChild($fileType);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','png');
$fileType->appendChild($characterString);
$descriptiveKeywords = $doc->createElementNS($this->_gmd,'descriptiveKeywords');
$mdDataIdentification->appendChild($descriptiveKeywords);
$mdKeywords=$doc->createElementNS($this->_gmd,'MD_Keywords');
$descriptiveKeywords->appendChild($mdKeywords);
$keyword = $doc->createElementNS($this->_gmd, 'keyword');
$mdKeywords->appendChild($keyword);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','Ejemplo: Geologia, Fisica');//keywords
$keyword->appendChild($characterString);
$type = $doc->createElementNS($this->_gmd,'type');
$mdKeywords->appendChild($type);
$mdKeywordTypeCode=$doc->createElementNS($this->_gmd, 'MD_KeywordTypeCode');
$mdKeywordTypeCode->setAttribute('codeListValue', '005');
$mdKeywordTypeCode->setAttribute('codeList', $this->_codeList.'#MD_KeywordTypeCode');
$type->appendChild($mdKeywordTypeCode);
$spatialRepresentationType = $doc->createElementNS($this->_gmd, 'spatialRepresentationType');
$mdDataIdentification->appendChild($spatialRepresentationType);
$mdSpatialRepresentationTypeCode= $doc->createElementNS($this->_gmd, 'MD_SpatialRepresentationTypeCode');
$mdSpatialRepresentationTypeCode->setAttribute('codeListValue', '001');
$mdSpatialRepresentationTypeCode->setAttribute('codeList', $this->_codeList.'#MD_SpatialRepresentationTypeCode');
$spatialRepresentationType->appendChild($mdSpatialRepresentationTypeCode);
$spatialResolution = $doc->createElementNS($this->_gmd, 'spatialResolution');
$mdDataIdentification->appendChild($spatialResolution);
$mdResolution = $doc->createElementNS($this->_gmd,'MD_Resolution');
$spatialResolution->appendChild($mdResolution);
$equivalentScale= $doc->createElementNS($this->_gmd,'equivalentScale');
$mdResolution->appendChild($equivalentScale);
$mdRepresentativeFraction = $doc->createElementNS($this->_gmd,'MD_RepresentativeFraction');
$equivalentScale->appendChild($mdRepresentativeFraction);
$denominator= $doc->createElementNS($this->_gmd,'denominator');
$mdRepresentativeFraction->appendChild($denominator);
$integer = $doc->createElementNS($this->_gco,'Integer','50000');//la scala
$denominator->appendChild($integer);
$language = $doc->createElementNS($this->_gmd,'language');
$mdDataIdentification->appendChild($language);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString','spa');
$language->appendChild($characterString);
$characterSet = $doc->createElementNS($this->_gmd, 'characterSet');
$mdDataIdentification->appendChild($characterSet);
$mdCharacterSetCode = $doc->createElementNS($this->_gmd,'MD_CharacterSetCode');
$mdCharacterSetCode->setAttribute('codeListValue', 'utf8');
$mdCharacterSetCode->setAttribute('codeList', $this->_codeList.'#MD_CharacterSetCode');
$characterSet->appendChild($mdCharacterSetCode);
$topicCategory = $doc->createElementNS($this->_gmd,'topicCategory');
$mdDataIdentification->appendChild($topicCategory);
$mdTopicCategoryCode = $doc->createElementNS($this->_gmd,'MD_TopicCategoryCode','geoscientificInformation');//categoría
$topicCategory->appendChild($mdTopicCategoryCode);
$extent = $doc->createElementNS($this->_gmd,'extent');
$mdDataIdentification->appendChild($extent);
$exExtent = $doc->createElementNS($this->_gmd, 'EX_Extent');
$extent->appendChild($exExtent);
$geographicElement = $doc->createElementNS($this->_gmd, 'geographicElement');
$exExtent->appendChild($geographicElement);
$exGeographicBoundingBox = $doc->createElementNS($this->_gmd,'EX_GeographicBoundingBox');
$geographicElement->appendChild($exGeographicBoundingBox);
$westBoundLongitude = $doc->createElementNS($this->_gmd,'westBoundLongitude');
$exGeographicBoundingBox->appendChild($westBoundLongitude);
$decimal = $doc->createElementNS($this->_gco,'Decimal', -81.35515);
$westBoundLongitude->appendChild($decimal);
$eastBoundLongitude = $doc->createElementNS($this->_gmd,'eastBoundLongitude');
$exGeographicBoundingBox->appendChild($eastBoundLongitude);
$decimal = $doc->createElementNS($this->_gco,'Decimal', -68.6739);
$eastBoundLongitude->appendChild($decimal);
$southBoundLatitude = $doc->createElementNS($this->_gmd,'southBoundLatitude');
$exGeographicBoundingBox->appendChild($southBoundLatitude);
$decimal = $doc->createElementNS($this->_gco,'Decimal', -18.34855);
$southBoundLatitude->appendChild($decimal);
$northBoundLatitude = $doc->createElementNS($this->_gmd,'northBoundLatitude');
$exGeographicBoundingBox->appendChild($northBoundLatitude);
$decimal = $doc->createElementNS($this->_gco,'Decimal', -0.03687);
$northBoundLatitude->appendChild($decimal);
$distributionInfo = $doc->createElementNS($this->_gmd, 'distributionInfo');
$mdMetadata->appendChild($distributionInfo);
$mdDistribution = $doc->createElementNS($this->_gmd, 'MD_Distribution');
$distributionInfo->appendChild($mdDistribution);
$distributionFormat = $doc->createElementNS($this->_gmd, 'distributionFormat');
$mdDistribution->appendChild($distributionFormat);
$mdFormat = $doc->createElementNS($this->_gmd,'MD_Format');
$distributionFormat->appendChild($mdFormat);
$name = $doc->createElementNS($this->_gmd,'name');
$mdFormat->appendChild($name);
$characterString = $doc->createElementNS($this->_gco,'CharacterString', 'ArcGIS');//formato
$name->appendChild($characterString);
$version = $doc->createElementNS($this->_gmd,'version');
$mdFormat->appendChild($version);
$characterString = $doc->createElementNS($this->_gco,'CharacterString', '10.0');//version
$version->appendChild($characterString);
$transferOptions = $doc->createElementNS($this->_gmd, 'transferOptions');
$mdDistribution->appendChild($transferOptions);
$mdDigitalTransferOptions = $doc->createElementNS($this->_gmd, 'MD_DigitalTransferOptions');
$transferOptions->appendChild($mdDigitalTransferOptions);
$onLine = $doc->createElementNS($this->_gmd, 'onLine');
$mdDigitalTransferOptions->appendChild($onLine);
$ciOnLineResource = $doc->createElementNS($this->_gmd, 'CI_OnlineResource');
$onLine->appendChild($ciOnLineResource);
$linkAge = $doc->createElementNS($this->_gmd, 'linkage');
$ciOnLineResource->appendChild($linkAge);
$url = $doc->createElementNS($this->_gmd, 'URL','www.institucion.com'); //url
$linkAge->appendChild($url);
$protocol = $doc->createElementNS($this->_gmd, 'protocol');
$ciOnLineResource->appendChild($protocol);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','WWW:LINK-1.0-http--link' ); //protocolo
$protocol->appendChild($characterString);
$name = $doc->createElementNS($this->_gmd, 'name');
$name->setAttribute('gco:nilReason', 'missing');
$ciOnLineResource->appendChild($name);
$characterString = $doc->createElementNS($this->_gco,'CharacterString');
$name->appendChild($characterString);
$onLine = $doc->createElementNS($this->_gmd, 'onLine');
$mdDigitalTransferOptions->appendChild($onLine);
$ciOnLineResource = $doc->createElementNS($this->_gmd, 'CI_OnlineResource');
$onLine->appendChild($ciOnLineResource);
$linkAge = $doc->createElementNS($this->_gmd, 'linkage');
$ciOnLineResource->appendChild($linkAge);
$url = $doc->createElementNS($this->_gmd, 'URL','Direccion Sevicio WMS'); //url
$linkAge->appendChild($url);
$protocol = $doc->createElementNS($this->_gmd, 'protocol');
$ciOnLineResource->appendChild($protocol);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','OGC:WMS-1.1.1-http-get-map' ); //protocolo
$protocol->appendChild($characterString);
$name = $doc->createElementNS($this->_gmd, 'name');
$ciOnLineResource->appendChild($name);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','Nombre de capas o layer separado por comas');
$name->appendChild($characterString);
$description = $doc->createElementNS($this->_gmd, 'description');
$ciOnLineResource->appendChild($description);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','Url del servicio WMS o Descripcion del servicio');
$description->appendChild($characterString);
$dataQualityInfo = $doc->createElementNS($this->_gmd,'dataQualityInfo');
$mdMetadata->appendChild($dataQualityInfo);
$dqDataQuality = $doc->createElementNS($this->_gmd, 'DQ_DataQuality');
$dataQualityInfo->appendChild($dqDataQuality);
$scope = $doc->createElementNS($this->_gmd, 'scope');
$dqDataQuality->appendChild($scope);
$dqScope = $doc->createElementNS($this->_gmd,'DQ_Scope');
$scope->appendChild($dqScope);
$level = $doc->createElementNS($this->_gmd,'level');
$dqScope->appendChild($level);
$mdScopeCode = $doc->createElementNS($this->_gmd, 'MD_ScopeCode');
$mdScopeCode->setAttribute('codeListValue', '001');
$mdScopeCode->setAttribute('codeList', $this->_codeList.'#MD_ScopeCode');
$level->appendChild($mdScopeCode);
$lineage = $doc->createElementNS($this->_gmd,'lineage');
$dqDataQuality->appendChild($lineage);
$liLineage = $doc->createElementNS($this->_gmd, 'LI_Lineage');
$lineage->appendChild($liLineage);
$statement = $doc->createElementNS($this->_gmd, 'statement');
$liLineage->appendChild($statement);
$characterString = $doc->createElementNS($this->_gco, 'CharacterString','Declaracion o resumen de como fueron producidos los datos bajo normas parametros estandares de medicion, Aproximaciones, errores minimos, etc.'); // norma de los metadatos
$statement->appendChild($characterString);
$metadataConstraints = $doc->createElementNS($this->_gmd,'metadataConstraints');
$mdMetadata->appendChild($metadataConstraints);
$mdLegalConstraints = $doc->createElementNS($this->_gmd, 'MD_LegalConstraints');
$metadataConstraints->appendChild($mdLegalConstraints);
$accessConstraints = $doc->createElementNS($this->_gmd, 'accessConstraints');
$mdLegalConstraints->appendChild($accessConstraints);
$mdRestrictionCode = $doc->createElementNS($this->_gmd, 'MD_RestrictionCode');
$mdRestrictionCode->setAttribute('codeListValue', '001');
$mdRestrictionCode->setAttribute('codeList', $this->_codeList.'#MD_RestrictionCode');
$accessConstraints->appendChild($mdRestrictionCode);
$useConstraints = $doc->createElementNS($this->_gmd, 'useConstraints');
$mdLegalConstraints->appendChild($useConstraints);
$mdRestrictionCode = $doc->createElementNS($this->_gmd, 'MD_RestrictionCode');
$mdRestrictionCode->setAttribute('codeListValue', '001');
$mdRestrictionCode->setAttribute('codeList', $this->_codeList.'#MD_RestrictionCode');
$useConstraints->appendChild($mdRestrictionCode);
$otherConstraints = $doc->createElementNS($this->_gmd,'otherConstraints');
$mdLegalConstraints->appendChild($otherConstraints);
$characterString = $doc->createElementNS($this->_gco,'CharacterString', 'Descripcion de otras restricciones');//otras restricciones
$otherConstraints->appendChild($characterString);
$metadataMaintenance = $doc->createElementNS($this->_gmd, 'metadataMaintenance');
$mdMetadata->appendChild($metadataMaintenance);
$mdMaintenanceInformation = $doc->createElementNS($this->_gmd, 'MD_MaintenanceInformation');
$metadataMaintenance->appendChild($mdMaintenanceInformation);
$maintenanceAndUpdateFrequency = $doc->createElementNS($this->_gmd, 'maintenanceAndUpdateFrequency');
$mdMaintenanceInformation->appendChild($maintenanceAndUpdateFrequency);
$mdMaintenanceFrequencyCode = $doc->createElementNS($this->_gmd,'MD_MaintenanceFrequencyCode');
$mdMaintenanceFrequencyCode->setAttribute('codeListValue', '001');
$mdMaintenanceFrequencyCode->setAttribute('codeList', $this->_codeList.'#MD_MaintenanceFrequencyCode');
$maintenanceAndUpdateFrequency->appendChild($mdMaintenanceFrequencyCode);
$metadata= $doc->saveXML();
return $metadata;
}
}