@lbdudc/gp-gis-dsl
v0.5.0
Published
A library that parses a DSL instance and generates the spec for the web-based GIS SPL.
Downloads
652
Readme
GIS DSL
It parses a DSL instance and generates the spec for the web-based GIS SPL.
Installation
npm install @lbdudc/gp-gis-dslUsage
import gisdslParser from "@lbdudc/gp-gis-dsl";
const spec = gisdslParser(inputString);The DSL instance must finish with a GENERATE GIS sentence in order to work. See examples within the tests files.
Raster and tile layers
A raster (GeoTIFF) published by GeoServer has no entity behind it, so its
GeoServer layer name is given explicitly. The optional style must have been
created before with CREATE WMS STYLE; without one GeoServer's default raster
style is used:
CREATE RASTER LAYER elevationLayer AS "Elevation" (
layerName "r_elevation",
style elevationLayerStyle
);It becomes a wms layer in the spec with raster: true.
A tile layer takes optional Leaflet options as quoted "key" "value" pairs
(attribution, minZoom, maxZoom, minNativeZoom, maxNativeZoom,
subdomains, tms; any other key is an error):
CREATE TILE LAYER topoLayer AS "OpenTopoMap" (
url "https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png",
"attribution" "Map data: © OpenStreetMap contributors",
"maxNativeZoom" "17"
);Note that RASTER is now a keyword, so it can't be used as an identifier.
Pre-requisites
- Have installed in your machine:
Author
Alejandro Cortiñas Email: [email protected]
License
This project is licensed under the MIT License - see the LICENSE.md file for details
