sam-is / ogcapi.net Goto Github PK
View Code? Open in Web Editor NEW.Net implementation of the OGC API family of standards
License: MIT License
.Net implementation of the OGC API family of standards
License: MIT License
.NET 6 is currently out of support. It's time to upgrade to .NET 8 LTS
Current readme does not match the latest version of the code.
Changes that have been made recently:
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:
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"
}
}
}
}
Implement a standard "OGC API - Features - Part 4: Simple Transactions" (in the draft status) to support adding and modifying objects. Take into account access rights for editing objects.
.NET 5 is now out of support. So it's time to upgrade the .net version
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.
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
SQL command used to get tiles limits is too slow on large datasets. Rewrite GetLimits method to analyze mbtiles file size or fully abandon this calculation and make the tile limits definition optional at the settings level.
Implement a standard "OGC API - Styles" (in the draft status) to support publishing styles information for feature and tile collections.
Draft: http://docs.opengeospatial.org/DRAFTS/20-009.html
Authentication can be done by API key. The task is to restrict access to tiles when specifying a key. The major problem is how to verify the key.
In current release, API does not have any CORS enabled controllers.
This must be improved)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.