项目作者: Terradue

项目描述 :
.Net library for working with any SpatioTemporal Asset Catalog (STAC)
高级语言: C#
项目地址: git://github.com/Terradue/DotNetStac.git
创建时间: 2020-06-10T20:26:25Z
项目社区:https://github.com/Terradue/DotNetStac

开源协议:GNU Affero General Public License v3.0

下载


DotNetStac


.Net library for working with Spatio Temporal Asset Catalogs (STAC)





Build Status
NuGet
codecov
Gitter
License
Binder


Features
·
Getting started
·
Documentation
·
Developing

DotNetStac helps you to work with STAC (catalog, collection, item)

In a nutshell, the library allows serialization/desrialization of STAC JSON documents (using Newtonsoft.JSON) to typed object modeling STAC objects with properties represented in enhanced objects such as geometries, time stamp/period/span, numerical values and many more via STAC extension plugins engine. Stac Item object is based on GeoJSON.Net feature.

Features

Getting Started

Install package

  1. $ dotnet add package DotNetStac

Deserialize and validate your first catalog

  1. using Stac;
  2. using Stac.Schemas;
  3. using System;
  4. using System.Net;
  5. using Newtonsoft.Json.Schema;
  6. var webc = new WebClient();
  7. Uri catalogUri = new Uri("https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/catalog.json");
  8. StacValidator stacValidator = new StacValidator(new JSchemaUrlResolver());
  9. // StacConvert.Deserialize is the helper to start loading any STAC document
  10. var json = webc.DownloadString(catalogUri);
  11. bool valid = stacValidator.ValidateJson(json);
  12. StacCatalog catalog = StacConvert.Deserialize<StacCatalog>(json);
  13. Console.Out.WriteLine(catalog.Id + ": " + catalog.Description + (valid ? " [VALID]" : "[INVALID]"));
  14. Console.Out.WriteLine(catalog.StacVersion);

Learn more

A dedicated notebook is available to get started with all DotNetStac features. If you want to play directly with the notebook, you can Binder

Documentation

An API documentation site is available at https://terradue.github.io/DotNetStac.

Developing

To ensure development libraries are installed, restore all dependencies

  1. > dotnet restore src

Unit Tests

Unit tests are in the src/DotNetStac.Test folder. To run unit tests:

  1. > dotnet test src