Coder Social home page Coder Social logo

Comments (11)

tomkralidis avatar tomkralidis commented on July 20, 2024

@rsignell-usgs the CWIC CSW will have to support HTTP POST for GetCapabilities, not just HTTP GET.

from owslib.

rsignell-usgs avatar rsignell-usgs commented on July 20, 2024

Okay, thanks, I'll tell them.

from owslib.

tomkralidis avatar tomkralidis commented on July 20, 2024

@rsignell-usgs turns out for GetCapabilities, HTTP POST is optional, and HTTP GET is mandatory to support. So the CWIC CSW is doing things right. So owslib.csw.CatalogueServiceWeb() needs to be updated to send the GetCapabilities request as HTTP GET.

from owslib.

tomkralidis avatar tomkralidis commented on July 20, 2024

ref: http://portal.opengeospatial.org/files/?artifact_id=20555, table 54.

from owslib.

rsignell-usgs avatar rsignell-usgs commented on July 20, 2024

Great! That will be a nice enhancement for OWSLib. We certainly can't count on optional functionality!

from owslib.

rsignell-usgs avatar rsignell-usgs commented on July 20, 2024

How big a job is this?

from owslib.

tomkralidis avatar tomkralidis commented on July 20, 2024

@rsignell-usgs See branch at https://github.com/tomkralidis/OWSLib/tree/issue-76. I tried it and it works for me (although there are GetRecords which are not related -- another investigation). Does this work for you for GetCapabilities?

from owslib.

rsignell-usgs avatar rsignell-usgs commented on July 20, 2024

Yes, this fixed the GetCapabilities issue! (but as I suspect you are, I'm now getting a 500 server error when I try to get records)

from owslib.

capooti avatar capooti commented on July 20, 2024

Hi @tomkralidis
not sure if it is a related issue and before I open another issue: using this catalog, where POST in getrecords seems to be supported, I get the following error in getrecords:

from owslib.csw import CatalogueServiceWeb
csw = CatalogueServiceWeb('http://www.rndt.gov.it/RNDT/CSW?')
csw.getrecords(keywords=['test'], maxrecords=20)
UserWarning: Please use the updated 'getrecords2' method instead of 'getrecords'.
The 'getrecords' method will be upgraded to use the 'getrecords2' parameters
in a future version of OWSLib.
in a future version of OWSLib.""")
TypeError: int() argument must be a string or a number, not 'NoneType'

any idea? thanks

from owslib.

tomkralidis avatar tomkralidis commented on July 20, 2024

@capooti thanks for the info. My trace:


>>> c=s('http://www.rndt.gov.it/RNDT/CSW?')
>>> c.getrecords(keywords=['test'], maxrecords=20)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "owslib/csw.py", line 236, in getrecords
    self.results['matches'] = int(util.testXMLValue(val, True))
TypeError: int() argument must be a string or a number, not 'NoneType'
>>> print c.response
<?xml version="1.0" encoding="utf-8"?>
<csw:GetRecordsResponse xmlns:csw="http://www.opengis.net/cat/csw/2.0.2">
<csw:RequestId xmlns:ogc="http://www.opengis.net/ogc" xmlns:ows="http://www.opengis.net/ows" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
<csw:SearchStatus />
<csw:SearchResults elementSet="summary" recordSchema="csw:Record" />
</csw:GetRecordsResponse>

. This is not a valid CSW endpoint. CSW 2.0.2 requires the numberOfRecordsReturned and numberOfRecordsMatched attributes within the csw:SearchResults element as part of GetRecords responses.

from owslib.

capooti avatar capooti commented on July 20, 2024

You are right, it was a problem of their implementation, now they have fixed. Thanks

from owslib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.