GeoJSONAPI is an ASP .NET Core Web API designed for handling and serving GeoJSON data. It provides endpoints to manage geographic features, collections, and geometries, fully compliant with the GeoJSON specification.
- Parse and serialize GeoJSON objects (Feature, FeatureCollection, Geometry)
- CRUD operations for GeoJSON features
- Extensible model structure for geographic data
- Built using modern .NET 8 practices
GeoJSONAPI uses JWT (JSON Web Token) to secure specific endpoints. The workflow is as follows:
-
Register: Create a new user
POST /api/Auth/register
-
Login: Obtain an access token
POST /api/Auth/login
Response
{ "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." } -
Access protected endpoints: Include the token in the Authorization header
Authorization: Bearer <token>Example using curl:
curl -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ https://localhost:5182/api/GeoJSON
You can interact with the API using tools such as Postman or curl. Example endpoints include:
POST /api/Auth/register- Register a new userPOST /api/Auth/login- User loginPOST /api/GeoJSON/upload- Upload a GeoJSON fileGET /api/GeoJSON- Retrieve GeoJSON data
Contributions are welcome! Please open issues or submit pull requests for improvements.
This project is licensed under the MIT License.