Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

CSW info

David Read edited this page Aug 8, 2014 · 1 revision

When data.gov.uk harvests, it does a GetRecords request to get the identifiers and then GetRecordById to get each one. Here is an example of how to mimic it using exactly the same parameters using cURL:

$ curl -X POST -H 'Content-type: text/xml' -d '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?><csw:GetRecords xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" outputSchema="http://www.isotc211.org/2005/gmd" outputFormat="application/xml" version="2.0.2" service="CSW" resultType="results" maxRecords="10" xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd"><csw:Query typeNames="csw:Record"><csw:ElementSetName>brief</csw:ElementSetName></csw:Query></csw:GetRecords>' http://metadata.bgs.ac.uk/geonetwork/srv/en/csw

$ curl -H 'Content-type: text/xml' 'http://metadata.bgs.ac.uk/geonetwork/srv/en/csw?outputFormat=application%2Fxml&service=CSW&outputSchema=http%3A%2F%2Fwww.isotc211.org%2F2005%2Fgmd&request=GetRecordById&version=2.0.2&elementsetname=full&id=9df8df51-63d3-37a8-e044-0003ba9b0d98'

To try on another server, replace the server with your CSW http://metadata.bgs.ac.uk/geonetwork/srv/en/csw and in the second command, replace the id with a record id from the response of the first command.

Clone this wiki locally