Skip to content

Instantly share code, notes, and snippets.

@fvanderbiest
Last active March 26, 2018 11:04
Show Gist options
  • Save fvanderbiest/a476e425ca6c9c8afba75e09deceb8c4 to your computer and use it in GitHub Desktop.
Save fvanderbiest/a476e425ca6c9c8afba75e09deceb8c4 to your computer and use it in GitHub Desktop.
SELECT imagettes FROM (
SELECT DISTINCT
id as metadataid,
unnest(xpath('//gmd:graphicOverview/gmd:MD_BrowseGraphic/gmd:fileName/gco:CharacterString/text()',
data::xml,
ARRAY[
ARRAY['gmd', 'http://www.isotc211.org/2005/gmd'],
ARRAY['gco', 'http://www.isotc211.org/2005/gco']
]))::text AS imagettes
FROM
geonetwork.metadata
WHERE isharvested = 'n'
) AS foo WHERE imagettes ilike '%resources.get%';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment