view cmd/wfs/main.go @ 1615:95641748383f

refac: extracted staging details view
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 18 Dec 2018 12:56:05 +0100
parents 427f9010b4a9
children f59550310143
line wrap: on
line source

// This is Free Software under GNU Affero General Public License v >= 3.0
// without warranty, see README.md and license for details.
//
// SPDX-License-Identifier: AGPL-3.0-or-later
// License-Filename: LICENSES/AGPL-3.0.txt
//
// Copyright (C) 2018 by via donau
//   – Österreichische Wasserstraßen-Gesellschaft mbH
// Software engineering by Intevation GmbH
//
// Author(s):
//  * Sascha L. Teichmann <sascha.teichmann@intevation.de>

package main

import (
	"flag"
	"log"

	"gemma.intevation.de/gemma/pkg/wfs"
)

func main() {
	var (
		dumpCaps    = flag.Bool("dump-caps", false, "Dump capabilities document")
		featureType = flag.String("features", "ws-wamos:ienc_wtwaxs", "feature to get")
	)
	flag.Parse()

	for _, arg := range flag.Args() {
		caps, err := wfs.GetCapabilities(arg)
		if err != nil {
			log.Fatalf("error: %v\n", err)
		}
		if *dumpCaps {
			dump(caps)
		}

		if err := wfs.GetFeaturesGET(caps, *featureType); err != nil {
			log.Fatalf("error: %v\n", err)
		}
	}
}