.. _csw_tutorial: Catalog Services for the Web (CSW) tutorial =========================================== This tutorial will show how to use the CSW module. It assumes a fresh installation of GeoServer with the :ref:`CSW module installed `. Configuration ------------- In the :file:`/csw` directory, create a new file named :file:`MD_Metadata` (ISO Metadata Profile mapping file) with the following contents:: @fileIdentifier.CharacterString=prefixedName identificationInfo.AbstractMD_Identification.citation.CI_Citation.title.CharacterString=title identificationInfo.AbstractMD_Identification.descriptiveKeywords.MD_Keywords.keyword.CharacterString=keywords identificationInfo.AbstractMD_Identification.abstract.CharacterString=abstract $dateStamp.Date= if_then_else ( isNull("metadata.date") , 'Unknown', "metadata.date") hierarchyLevel.MD_ScopeCode.@codeListValue='http://purl.org/dc/dcmitype/Dataset' $contact.CI_ResponsibleParty.individualName.CharacterString='John Smith' Services -------- With GeoServer running (and responding on ``http://localhost:8080``), test GeoServer CSW in a web browser by querying the CSW capabilities as follows:: http://localhost:8080/geoserver/csw?service=csw&version=2.0.2&request=GetCapabilities We can request a description of our Metadata record:: http://localhost:8080/geoserver/csw?service=CSW&version=2.0.2&request=DescribeRecord&typeName=gmd:MD_Metadata This yields the following result:: Geographic MetaData (GMD) extensible markup language is a component of the XML Schema Implementation of Geographic Information Metadata documented in ISO/TS 19139:2007. GMD includes all the definitions of http://www.isotc211.org/2005/gmd namespace. The root document of this namespace is the file gmd.xsd. This identification.xsd schema implements the UML conceptual schema defined in A.2.2 of ISO 19115:2003. It contains the implementation of the following classes: MD_Identification, MD_BrowseGraphic, MD_DataIdentification, MD_ServiceIdentification, MD_RepresentativeFraction, MD_Usage, MD_Keywords, DS_Association, MD_AggregateInformation, MD_CharacterSetCode, MD_SpatialRepresentationTypeCode, MD_TopicCategoryCode, MD_ProgressCode, MD_KeywordTypeCode, DS_AssociationTypeCode, DS_InitiativeTypeCode, MD_ResolutionType. ... Query all layers as follows:: http://localhost:8080/geoserver/csw?service=CSW&version=2.0.2&request=GetRecords&typeNames=gmd:MD_Metadata&resultType=results&elementSetName=full&outputSchema=http://www.isotc211.org/2005/gmd Request a particular layer by ID...:: http://localhost:8080/geoserver/csw?service=CSW&version=2.0.2&request=GetRecordById&elementsetname=summary&id=CoverageInfoImpl--4a9eec43:132d48aac79:-8000&typeNames=gmd:MD_Metadata&resultType=results&elementSetName=full&outputSchema=http://www.isotc211.org/2005/gmd ...or use a filter to retrieve it by Title:: http://localhost:8080/geoserver/csw?service=CSW&version=2.0.2&request=GetRecords&typeNames=gmd:MD_Metadata&resultType=results&elementSetName=full&outputSchema=http://www.isotc211.org/2005/gmd&constraint=Title=%27mosaic%27 Either case should return:: CoverageInfoImpl--4a9eec43:132d48aac79:-8000 Unknown 36.492 6.346 46.591 20.83 mosaic WCS ImageMosaic mosaic John Smith We can request the domain of a property. For example, all values of "Title":: http://localhost:8080/geoserver/csw?service=csw&version=2.0.2&request=GetDomain&propertyName=Title This should yield the following result:: Title A sample ArcGrid file Manhattan (NY) landmarks Manhattan (NY) points of interest Manhattan (NY) roads North America sample imagery Pk50095 is a A raster file accompanied by a spatial data file Spearfish archeological sites Spearfish bug locations Spearfish restricted areas Spearfish roads Spearfish streams Tasmania cities Tasmania roads Tasmania state boundaries Tasmania water bodies USA Population World rectangle mosaic sfdem is a Tagged Image File Format with Geographic information