Skip to content

Instantly share code, notes, and snippets.

@ping13
Last active December 7, 2015 14:53
Show Gist options
  • Save ping13/d611515452281ac0c840 to your computer and use it in GitHub Desktop.
Save ping13/d611515452281ac0c840 to your computer and use it in GitHub Desktop.
short script to check compliance of WFS,WMS,WMTS,CSW services with eCH-0056
# short script to check compliance with eCH-0056
# http://www.ech.ch/vechweb/page?p=dossier&documentNumber=eCH-0056&documentVersion=1.00
# module ows_checker: https://github.com/gjn/mf-chsdi/tree/master/ows_checker
import ows_checker
esri_services = {
"CSW" : "http://gptogc.esri.com/geoportal/csw",
"WMS" : "http://example.com/arcgis/services/Beispiel/Infrastruktur/MapServer/WMSServer",
"WFS" : "http://example.com/arcgis/services/Beispiel/Infrastruktur/MapServer/WFSServer",
}
geoadmin_services = {
"WMS": "http://wms.geo.admin.ch"
}
def check_services(services):
for service_type, base_url in services.iteritems():
checker = ows_checker.OWSCheck(base_url, cwd="ows_checker/settings", service=service_type)
results = checker.getResultsOverview(aggregate=True)
print "Test {}\n=========".format(service_type)
for msg in results[0]["msg"]:
print " {}".format(msg)
print
for services in [esri_services, geoadmin_services]:
check_services(services)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment