# HG changeset patch # User Sascha L. Teichmann # Date 1552994902 -3600 # Node ID 56c8ef515d93604f17ab92b2a236a6f9fb8d5d19 # Parent 2b6f73c300164d88b26787e694d386aedfedcb51 WFS downloader: Use new GML/GeoJSON factory function in gemma. diff -r 2b6f73c30016 -r 56c8ef515d93 pkg/imports/dma.go --- a/pkg/imports/dma.go Tue Mar 19 12:20:54 2019 +0100 +++ b/pkg/imports/dma.go Tue Mar 19 12:28:22 2019 +0100 @@ -138,8 +138,7 @@ return nil, err } - urls, err := wfs.GetFeaturesGET( - caps, dma.FeatureType, wfs.FormatGeoJSON, dma.SortBy) + dl, err := wfs.GetFeatures(caps, dma.FeatureType, dma.SortBy) if err != nil { feedback.Error("Cannot create GetFeature URLs. %v", err) return nil, err @@ -172,7 +171,7 @@ // TODO: Fetch from parameters. user, password := "", "" - if err := wfs.DownloadURLs(user, password, urls, func(url string, r io.Reader) error { + if err := dl.Download(user, password, func(url string, r io.Reader) error { feedback.Info("Get features from: '%s'", url) rfc, err := wfs.ParseRawFeatureCollection(r) if err != nil { diff -r 2b6f73c30016 -r 56c8ef515d93 pkg/imports/fd.go --- a/pkg/imports/fd.go Tue Mar 19 12:20:54 2019 +0100 +++ b/pkg/imports/fd.go Tue Mar 19 12:28:22 2019 +0100 @@ -207,8 +207,7 @@ return nil, err } - urls, err := wfs.GetFeaturesGET( - caps, fd.FeatureType, wfs.FormatGeoJSON, fd.SortBy) + dl, err := wfs.GetFeatures(caps, fd.FeatureType, fd.SortBy) if err != nil { feedback.Error("Cannot create GetFeature URLs. %v", err) return nil, err @@ -238,7 +237,7 @@ // TODO: Fetch from parameters. user, password := "", "" - if err := wfs.DownloadURLs(user, password, urls, func(url string, r io.Reader) error { + if err := dl.Download(user, password, func(url string, r io.Reader) error { feedback.Info("Get features from: '%s'", url) rfc, err := wfs.ParseRawFeatureCollection(r) if err != nil { diff -r 2b6f73c30016 -r 56c8ef515d93 pkg/imports/wa.go --- a/pkg/imports/wa.go Tue Mar 19 12:20:54 2019 +0100 +++ b/pkg/imports/wa.go Tue Mar 19 12:28:22 2019 +0100 @@ -145,8 +145,7 @@ feedback.Info("Features will be sorted by '%s'", wx.SortBy) } - urls, err := wfs.GetFeaturesGET( - caps, wx.FeatureType, wfs.FormatGeoJSON, wx.SortBy) + dl, err := wfs.GetFeatures(caps, wx.FeatureType, wx.SortBy) if err != nil { feedback.Error("Cannot create GetFeature URLs. %v", err) return nil, err @@ -179,7 +178,7 @@ // TODO: Fetch from parameters. user, password := "", "" - if err := wfs.DownloadURLs(user, password, urls, func(url string, r io.Reader) error { + if err := dl.Download(user, password, func(url string, r io.Reader) error { feedback.Info("Get features from: '%s'", url) rfc, err := wfs.ParseRawFeatureCollection(r) if err != nil { diff -r 2b6f73c30016 -r 56c8ef515d93 pkg/imports/wp.go --- a/pkg/imports/wp.go Tue Mar 19 12:20:54 2019 +0100 +++ b/pkg/imports/wp.go Tue Mar 19 12:28:22 2019 +0100 @@ -217,8 +217,7 @@ feedback.Info("Features will be sorted by '%s'", wp.SortBy) } - urls, err := wfs.GetFeaturesGET( - caps, wp.FeatureType, wfs.FormatGeoJSON, wp.SortBy) + dl, err := wfs.GetFeatures(caps, wp.FeatureType, wp.SortBy) if err != nil { feedback.Error("Cannot create GetFeature URLs. %v", err) return err @@ -247,7 +246,7 @@ // TODO: Fetch from parameters. user, password := "", "" - if err := wfs.DownloadURLs(user, password, urls, func(url string, r io.Reader) error { + if err := dl.Download(user, password, func(url string, r io.Reader) error { feedback.Info("Get features from: '%s'", url) rfc, err := wfs.ParseRawFeatureCollection(r) if err != nil { diff -r 2b6f73c30016 -r 56c8ef515d93 pkg/imports/wx.go --- a/pkg/imports/wx.go Tue Mar 19 12:20:54 2019 +0100 +++ b/pkg/imports/wx.go Tue Mar 19 12:28:22 2019 +0100 @@ -145,8 +145,7 @@ feedback.Info("Features will be sorted by '%s'", wx.SortBy) } - urls, err := wfs.GetFeaturesGET( - caps, wx.FeatureType, wfs.FormatGeoJSON, wx.SortBy) + dl, err := wfs.GetFeatures(caps, wx.FeatureType, wx.SortBy) if err != nil { feedback.Error("Cannot create GetFeature URLs. %v", err) return nil, err @@ -179,7 +178,7 @@ // TODO: Fetch from parameters. user, password := "", "" - if err := wfs.DownloadURLs(user, password, urls, func(url string, r io.Reader) error { + if err := dl.Download(user, password, func(url string, r io.Reader) error { feedback.Info("Get features from: '%s'", url) rfc, err := wfs.ParseRawFeatureCollection(r) if err != nil {