Skip to content

jericks/GeoPackageServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Github Action

GeoPackage Server

Serve your GeoPackage database on the web.

Build

./gradlew build

Run tests

./gradlew test

Run end to end tests

./gradlew -Dwebdriver.chrome.driver=/Your/Path/To/chromedriver e2e

Run

java -jar geopackageserver-0.3.0.jar --file=data.gpkg --readOnly=true

or if you are building the project:

java -jar build/libs/geopackageserver-0.3.0.jar --file=data.gpkg --readOnly=true

and browse to http://localhost:8080:

Home Page

alt tag

Tile Page

alt tag

Layer Page

alt tag

Tile Examples

Get a List of Tile Layers

curl http://localhost:8080/tiles

Inspect Tile Layer Metadata

curl http://localhost:8080/tiles/world/pyramid
http://localhost:8080/tiles/world/tile/counts

Create QGIS/GDAL Layer File for Tile Layer

curl -o layer.xml http://localhost:8080/tiles/world/gdal && qgis layer.xml

alt tag

Download Tiles

curl -o tile_0_0_0.png http://localhost:8080/tiles/world/tile/0/0/0
curl -o tile_1_0_0.png http://localhost:8080/tiles/world/tile/1/0/0

Download Raster

curl -o us.png http://localhost:8080/tiles/world/raster/400/400/-156.533203,3.688855,-50.712891,56.800878

Create a new Tile Layer

curl -H "Content-Type: application/json" -X POST -d 'Mercator' http://localhost:8080/tiles/world_light

Delete a Tile Layer

curl -X DELETE http://localhost:8080/tiles/world_light

Add/Update a Tile

curl -F "file=@tile.png" http://localhost:8080/tiles/world/tile/5/0/0
curl -o tile_5_0_0.png http://localhost:8080/tiles/world/tile/5/0/0

Delete a Tile

curl -X DELETE http://localhost:8080/tiles/world/tile/5/0/0

Layer Examples

Get a List of Layers

curl http://localhost:8080/layers

Inspect Layer Metadata

curl http://localhost:8080/layers/countries/schema
curl http://localhost:8080/layers/countries/count
curl http://localhost:8080/layers/countries/bounds

View Features

curl http://localhost:8080/layers/countries/features.json
curl -o countries.csv http://localhost:8080/layers/countries/features.csv

View Feature Vector Tiles

curl http://localhost:8080/layers/countries/tile/json/3/2/1
curl http://localhost:8080/layers/countries//tile/pbf/2/1/1

Create a new Layer

curl -H "Content-Type: application/json" -X POST -d '{"name":"random","projection": "EPSG:4326","geometry": "geom","fields":[{"name":"geom","type":"Point","projection":"EPSG:4326"},{"name":"pid","type":"int"}]}' http://localhost:8080/layers/random

Delete a Layer

curl -X DELETE http://localhost:8080/layers/random

Update a Layer

curl -X PUT -d field=pid -d value=1 -d cql=ALL http://localhost:8080/layers/random

Add a Feature

curl -H "Content-Type: application/json" -X POST -d '{"type":"Feature","geometry":{"type":"Point","coordinates":[1,2]},"properties":{"pid":1}}' http://localhost:8080/layers/random/feature
curl -H "Content-Type: application/json" -X POST -d '{"type":"Feature","geometry":{"type":"Point","coordinates":[2,3]},"properties":{"pid":2}}' http://localhost:8080/layers/random/feature
curl -H "Content-Type: application/json" -X POST -d '{"type":"Feature","geometry":{"type":"Point","coordinates":[3,4]},"properties":{"pid":3}}' http://localhost:8080/layers/random/feature
curl -H "Content-Type: application/json" -X POST -d '{"type":"Feature","geometry":{"type":"Point","coordinates":[5,6]},"properties":{"pid":4}}' http://localhost:8080/layers/random/feature
curl -H "Content-Type: application/json" -X POST -d '{"type":"Feature","geometry":{"type":"Point","coordinates":[7,8]},"properties":{"pid":5}}' http://localhost:8080/layers/random/feature

Delete a Feature

curl -X DELETE http://localhost:8080/layers/random/feature/random.1

Delete Features

curl -X DELETE http://localhost:8080/layers/random/feature?cql=pid%3E2

Create QGIS/GDAL Layer File for Vector Layer

curl -o layer.xml http://localhost:8080/layers/countries/gdal && qgis layer.xml

alt tag

List all styles

curl http://localhost:8080/style

List all styles for a layer

curl http://localhost:8080/style/countries

Get a style

curl http://localhost:8080/style/countries/countries

Add a style

curl -F "file=@countries.sld" http://localhost:8080/style/countries/countries

Remove a style

curl -X DELETE http://localhost:8080/style/countries/countries

About

Serve your GeoPackage database on the web.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors