Coder Social home page Coder Social logo

ogcapi.net's People

Contributors

alxmcs avatar bam-samis avatar danlla avatar eraserh avatar kolyanch avatar valttlapp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ogcapi.net's Issues

Upgrade to .NET 8

.NET 6 is currently out of support. It's time to upgrade to .NET 8 LTS

Update documentation

Current readme does not match the latest version of the code.

Changes that have been made recently:

  • new configuration structure
  • new OGC API Tiles
  • new NuGet packages names
  • new MbTiles package

Configuration settings restructuring

In the current version the API settings in JSON look like this:

{
	"FeaturesOptions": {
		"LandingPage": {
			"Title": "API Title",
			"Description": "API Description",
			"Version": "1.0",
			"ContactName": "API Contacts",
			"ContactUrl": "https://example.com/",
			"ApiDocumentPage": "https://api.com/index.html",
			"ApiDescriptionPage": "https://api.com/swagger.json"
		},
		"UseApiKeyAuthorization": true,
		"Collections": {
			"Items": [				
				{
					"SourceType": "PostGis",
					"Id": "Collection1",
					"Title": "Collection title",
					"Description": "Collection description",
					"Crs": [
						"http://www.opengis.net/def/crs/OGC/1.3/CRS84",
						"http://www.opengis.net/def/crs/EPSG/0/3857"
					],
					"StorageCrs": "http://www.opengis.net/def/crs/EPSG/0/3857",
					"AllowCreate": true,
					"AllowReplace": true,
					"AllowUpdate": true
				}
			]
		}
	},
	"FeaturesPostGisOptions": {
		"Sources": [			
			{
				"Id": "Collection1",
				"ConnectionString": "Host=127.0.0.1;User Id=user;Password=user;Database=pgdb;Port=5432",
				"Schema": "api",
				"Table": "collection1",
				"GeometryColumn": "geom",
				"GeometrySrid": 3857,
				"GeometryDataType": "geometry",
				"GeometryGeoJsonType": "MultiPolygon",
				"IdentifierColumn": "id",
				"Properties": [
					"prop1",
					"prop2"					
				],
				"ApiKeyPredicateForGet": "EXISTS(SELECT ... WHERE @ApiKey = apiKey)",
				"ApiKeyPredicateForCreate": "EXISTS(SELECT ... WHERE @ApiKey = apiKey)",
				"ApiKeyPredicateForUpdate": "EXISTS(SELECT ... WHERE @ApiKey = apiKey)"
			}
		]
	}
}

Collection options like title or storage coordinate system are separated from the data provider options.
This is done for the following reasons:

  • Base assembly must not know anything about concrete data providers
  • Every data provider can have unique settings options
  • Polymorphic deserialization is not supported in the current release of STJ: dotnet/runtime#30083

The suggestion is to make settings more readable and to make it easier to configure settings. A custom deserializer can be implemented for that, that can read JSON settings like this:

{
	"Collection": {
		"Id": "Collection1",
		"Title": "Collection title",
		"Description": "Collection description",
		"Features": {
			"Crs": [
				"http://www.opengis.net/def/crs/OGC/1.3/CRS84",
				"http://www.opengis.net/def/crs/EPSG/0/3857"
			],
			"StorageCrs": "http://www.opengis.net/def/crs/EPSG/0/3857",			
			"Storage": {
				"Type": "PostGIS",				
				"ConnectionString": "Host=127.0.0.1;User Id=user;Password=user;Database=pgdb;Port=5432",
				"Schema": "api",
				"Table": "collection1",
				"GeometryColumn": "geom",
				"GeometrySrid": 3857,
				"GeometryDataType": "geometry",
				"GeometryGeoJsonType": "MultiPolygon",
				"IdentifierColumn": "id",
				"Properties": [
					"prop1",
					"prop2"					
				],
				"AllowCreate": true,
				"AllowReplace": true,
				"AllowUpdate": true,
				"ApiKeyPredicateForGet": "EXISTS(SELECT ... WHERE @ApiKey = apiKey)",
				"ApiKeyPredicateForCreate": "EXISTS(SELECT ... WHERE @ApiKey = apiKey)",
				"ApiKeyPredicateForUpdate": "EXISTS(SELECT ... WHERE @ApiKey = apiKey)"
			}
		},	
		"VectorTiles": {
			"TileMatrixSet": "MyTileMatrixSet",
			"Storage": {
				"Type": "Spatialite",
				"File": "collection1.mbtiles"
			}
		}
	}
}

Migrate to .NET 6

.NET 5 is now out of support. So it's time to upgrade the .net version

OGC API - Tiles - Part 1: Core support

Implement a standard "OGC API - Tiles - Part 1" (in the draft status) to support fast spatial data publication from databases as MVT (Mapbox Vector Tiles). In addition to the sources in the form of relational databases, it is also necessary to implement the possibility of publishing data from the mbtiles file database, generated by tippecanoe or GDAL.

Draft: http://docs.ogc.org/DRAFTS/20-057.html

Add parameters for filtering on feature properties

From OGC API Features Standard:

If features in the feature collection include a feature property that has a simple value (for example, a string or integer)
that is expected to be useful for applications using the service to filter the features of the collection based on this property, 
a parameter with the name of the feature property and with the following characteristics (using an OpenAPI Specification 3.0 fragment) 
SHOULD be supported
The schema property SHOULD be the same as the definition of the feature property in the response schema.

Query parameters should look like: property=value

CORS support

In current release, API does not have any CORS enabled controllers.
This must be improved)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.