Skip to content

Instantly share code, notes, and snippets.

@tomkralidis
tomkralidis / python-pycsw.spec
Created July 7, 2014 13:25
pycsw Fedora package draft
%global modname pycsw
Name: python-%{modname}
Version: 1.10.0
Release: 2%{?dist}
Summary: pycsw is an OGC CSW server implementation written in Python.
License: MIT
URL: http://pycsw.org
Source0: http://pypi.python.org/packages/source/p/%{modname}/%{modname}-%{version}.tar.gz
BuildArch: noarch
# proof of concept HTTP Basic Authentication against GN CSW-T
import base64
import sys
import urllib2
if len(sys.argv) < 4:
print('Usage: %s <url> <username> <password>' % sys.argv[0])
sys.exit(1)
@tomkralidis
tomkralidis / csw-harvest-with-filter.xml
Created November 11, 2014 02:07
harvest with filter example
<?xml version="1.0" encoding="UTF-8"?>
<Harvest xmlns="http://www.opengis.net/cat/csw/2.0.2" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-publication.xsd" service="CSW" version="2.0.2">
<Source>http://demo.pycsw.org/cite/csw</Source>
<ResourceType>http://www.opengis.net/cat/csw/2.0.2</ResourceType>
<ResourceFormat>application/xml</ResourceFormat>
<Constraint version="1.1.0">
<ogc:Filter>
<ogc:BBOX>
<ogc:PropertyName>ows:BoundingBox</ogc:PropertyName>
<gml:Envelope>
@tomkralidis
tomkralidis / 00README.txt
Last active August 29, 2015 14:10
metador2 repository plugin ideas
Copy https://github.com/geopython/pycsw/blob/master/pycsw/repository.py to https://github.com/geopython/pycsw/blob/master/pycsw/plugins/repository/metador2/metador2.py and edit the insert/update/delete functions accordingly.
@tomkralidis
tomkralidis / harvest-csw.py
Last active April 6, 2016 14:13
simple CSW metadata download design pattern
# -*- coding: utf-8 -*-
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
#
# Copyright (c) 2016 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
@tomkralidis
tomkralidis / download-csw-metadata.py
Last active August 29, 2015 14:20
Download CSW metadata
import sys
from owslib.csw import CatalogueServiceWeb
if len(sys.argv) < 3:
print 'Usage: %s <csw-endpoint> <max-records>'
sys.exit(1)
URL = sys.argv[1]
MAXRECORDS = sys.argv[2] or 10
@tomkralidis
tomkralidis / ogc-csw3-specification-cr-list.md
Last active August 29, 2015 14:20
OGC CSW3 specification change request items

OGC CSW 3.0.0 specification change request items

  1. fix typo in examples (2015-05-11)
sed 's/FedeartedCatalogues/FederatedCatalogues/g' http://pvretano.com/schemas/csw/3.0/examples/Capabilities.xml
sed 's/FedeartedCatalogues/FederatedCatalogues/g' http://test.schemas.opengis.net/csw/3.0/examples/Capabilities.xml
  1. pre 2.9 versions of libxml2 (or dervied bindings) fail to validate XML Schemas. Options:
@tomkralidis
tomkralidis / 00README.md
Last active August 29, 2015 14:22
OGC CITE setup / orchestration

CITE CSW helper script

  • automates building of CSW 3.0.0, CSW 2.0.2 and teamengine packages
  • set the MAVEN variable accordingly in build-cite-csw.sh
@tomkralidis
tomkralidis / README.md
Last active February 9, 2016 09:27
Simple Pythonic Wrapper to INSPIRE Metadata Validation Service