Language | Created | Last update | Stars | Forks |
---|---|---|---|---|
C# | 2014-04-10T06:56:27Z | 2014-09-02T19:21:13Z | 1 | 1 |
Terradue.OpenSearch is a library targeting .NET 4.0 and above providing an easy way to perform OpenSearch query from a class or an URL to multiple and custom types of results (Atom, Rdf, etc.)
Query
// First create the engine
var engine = new OpenSearchEngine();
// Load the extensions automatically
engine.LoadPlugins();
// Create a generic OpenSearchable from an URL
var entity = new GenericOpenSearchable(new OpenSearchUrl("http://eo-virtual-archive4.esa.int/search/ASA_IM__0P/atom"), engine);
// Specify the requested parameters
var parameters = new NameValueCollection();
parameters.Add("count", "20");
parameters.Add("start", "1992-01-01");
parameters.Add("stop", "2014-04-15");
parameters.Add("bbox", "24,30,42,53");
// Query !
var result = engine.Query(entity, parameters, "Atom");
// Write the result
XmlWriter atomWriter = XmlWriter.Create("result.xml");
Atom10FeedFormatter atomFormatter = new Atom10FeedFormatter((SyndicationFeed)result.Result);
atomFormatter.WriteTo(atomWriter);
atomWriter.Close();
Terradue.OpenSearch is available as NuGet package in releases.
Install-Package Terradue.OpenSearch
Terradue.OpenSearch is a single assembly designed to be easily deployed anywhere.
To compile it yourself, you’ll need:
To clone it locally click the "Clone in Desktop" button above or run the following git commands.
git clone git@github.com:Terradue/Terradue.OpenSearch.git Terradue.OpenSearch
Copyright (c) 2014 Terradue
Licensed under the GPL v2 License