Geospatial Catalogue in Go
Clone or download
tomkralidis Merge pull request #6 from sam-radiant/master
use set basic auth code when connecting to elasticsearch
Latest commit f3dcee2 Mar 28, 2018


Build Status Report Card Godoc


Geospatial Catalogue in Go



geocatalogo's default backend is Elasticsearch and requires an Elasticsearch endpoint as defined in configuration.

# create directory for local env
mkdir /path/to/golang-env
export GOPATH=/path/to/golang-env
# install dependencies
go get
go get
go get
go get
go get
# install geocatalogo
go get
cd $GOPATH/src/
# set configuration
# (sample in $GOPATH/src/
cp geocatalogo-config.env local.env
vi local.env  # update accordingly
# GEOCATALOGO_SERVER_OPENAPI_DEF: path to stac-api.json
# GEOCATALOGO_SERVER_URL: URL of geocatalogo instance for serving via HTTP
. local.env


Using the geocatalogo command line utility

# list commands

# index a metadata record
geocatalogo index --file=/path/to/record.xml

# index a directory of metadata records
geocatalogo index --dir=/path/to/dir

# dedicated importers

# Landsat on AWS (
curl | gunzip > /tmp/scene_list
landsat-aws-importer --file /tmp/scene_list

# OpenAerialMap Catalog (
curl > /tmp/oam.json
oam-catalog-importer --file /tmp/scene_list

# search index
geocatalogo search --term=landsat

# search by bbox
geocatalogo search --bbox -152,42,-52,84

# search by time instant
geocatalogo search --time 2018-01-19T18:28:02Z

# search by time range
geocatalogo search --time 2007-11-11T12:43:29Z,2018-01-19T18:28:02Z

# search by any combination exclusively (term, bbox, time)
geocatalogo search --time 2007-11-11T12:43:29Z,2018-01-19T18:28:02Z --bbox -152,42,-52,84 --term landsat

# get a metadata record by id
geocatalogo get --id=12345

# get a metadata record by list of ids
geocatalogo get --id=12345,67890

# run as an HTTP server (default port 8000)
geocatalogo serve
# run as an HTTP server on a custom port
geocatalogo serve --port 8001
# run as an HTTP server honouring the STAC API
geocatalogo serve --api stac

# get version
geocatalogo version

Using the API

// init a Geocatalogue from environment
import (

cat, err := geocatalogo.NewFromEnv()
if err != nil {

// index a Dublin Core metadata record
source, err := ioutil.ReadFile(file)
if err != nil {
	fmt.Printf("Could not read file: %s\n", err)
metadataRecord, err := parsers.ParseCSWRecord(source)
if err != nil {
	fmt.Printf("Could not parse metadata: %s\n", err)
result := cat.Index(metadataRecord)
if !result {
	fmt.Println("Error Indexing")

// search records and present records 0 - 10
results := cat.Search("birds", 0, 10)

// get record by id
results := cat.Get("record-id-123")

// process results
for _, result := range results.Records {
	b, _ := json.MarshalIndent(result, "", "    ")
	fmt.Printf("%s\n", b)


Running Tests


Bugs and Issues

All bugs, enhancements and issues are managed on GitHub.