[OWSLib-users] OWSlib - CSW metadata

Signell, Richard rsignell at usgs.gov
Fri Sep 9 12:31:25 PDT 2016


You might find this notebook useful also:
https://github.com/ioos/notebooks_demos/blob/master/notebooks/csw_search_examples/csw_search_example.ipynb

On Fri, Sep 9, 2016 at 3:04 PM, Tom Kralidis <tomkralidis at gmail.com> wrote:

>
>
> On Fri, 9 Sep 2016, Henrik Schuller wrote:
>
> Date: Fri, 9 Sep 2016 15:11:10 +0200
>> From: Henrik Schuller <hgs716 at gmail.com>
>> To: Tom Kralidis <tomkralidis at gmail.com>, owslib-users at lists.osgeo.org
>> Subject: Re: [OWSLib-users] OWSlib - CSW metadata
>>
>> Thx alot Tom, now i got alot more information out of the CSW :)
>>
>> Maybe just me that is inexperienced, but how do i get information out of
>> objects like the ones i get here:
>>
>> from owslib.csw import CatalogueServiceWeb
>>
>> csw = CatalogueServiceWeb('http://www.geonorge.no/geonetwork/srv/
>> nor/csw-service?')
>> csw.getrecords2(typenames='gmd:MD_Metadata', esn='full',
>> resulttype="results",
>>                outputschema="http://www.isotc211.org/2005/gmd",
>> maxrecords=50)
>>
>> for rec in csw.records:
>>    print((csw.records[rec].identification.contact))
>>
>>
> Your best bet is to inspect OWSLib's ISO implementation [1] to see how we
> parse the XML
> into Python objects.
>
> [1] https://github.com/geopython/OWSLib/blob/master/owslib/iso.py
>
>
> From Henrik
>>
>>
>>
>> 2016-09-09 12:55 GMT+02:00 Tom Kralidis <tomkralidis at gmail.com>:
>>
>>
>>>
>>> On Fri, 9 Sep 2016, Henrik Schuller wrote:
>>>
>>> Date: Fri, 9 Sep 2016 12:57:24 +0200
>>>
>>>> From: Henrik Schuller <hgs716 at gmail.com>
>>>> To: OWSLib-users at lists.osgeo.org
>>>> Subject: [OWSLib-users] OWSlib - CSW metadata
>>>>
>>>> Hi,
>>>>
>>>>
>>>>
>>>> I am using OWSlib to GetRecords from a CSW
>>>> (*http://www.geonorge.no/geonetwork/srv/nor/csw-service
>>>> <http://www.geonorge.no/geonetwork/srv/nor/csw-service>*, but I would
>>>> like
>>>> to get more information about the records than what is given in dublin
>>>> core. Is there any easy way that I could get information like
>>>> gmd:individualName or srv:operatesOn for every record?
>>>>
>>>>
>>>> I can see that this information is available in OWSlib - iso, but I
>>>> don't
>>>> see an easy way to implement it for the csw.records.
>>>>
>>>>
>>>> Try doing the getrecords2 request using ISO as the outputschema (Dublin
>>> Core
>>> is default):
>>>
>>> from owslib.csw import CatalogueServiceWeb
>>>
>>> csw = CatalogueServiceWeb('http://www.geonorge.no/geonetwork/srv/
>>> nor/csw-service')
>>>
>>> csw.getrecords2(outputschema='http://www.isotc211.org/2005/gmd')
>>>
>>> The CSW will then return the ISO representation of matching metadata
>>> records.
>>>
>>> Hope this helps
>>>
>>> ..Tom
>>>
>>>
>>>
>>>> Henrik
>>>>
>>>>
>>>>
>> _______________________________________________
> OWSLib-users mailing list
> OWSLib-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/owslib-users
>



-- 
Dr. Richard P. Signell   (508) 457-2229
USGS, 384 Woods Hole Rd.
Woods Hole, MA 02543-1598
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/owslib-users/attachments/20160909/cd05eaa5/attachment.html>


More information about the OWSLib-users mailing list