Commit aa9778f1 authored by Athanasios's avatar Athanasios
Browse files

initial commit

parents
const { check } = require("express-validator");
const {toLower} = require("../src/customSanitizers");
const assets = require("../src/assets");
const bb = require("../src/boundingbox");
const commonChecks = () => {
return [
check("service")
.exists().withMessage("MissingParameterValue")
.customSanitizer(toLower)
.equals("3dps").withMessage("InvalidParameterValue"),
check("acceptversions")
.exists().withMessage("MissingParameterValue")
.equals("1.0").withMessage("InvalidParameterValue")
];
}
const specificChecks = (parameter) => {
switch (parameter.toLowerCase()) {
case "getscene": {
return [
check("boundingbox")
.exists().withMessage("MissingParameterValue")
.matches(/^((\-?\d+(\.\d+)?),){3}(\-?\d+(\.\d+)?)$/).withMessage("InvalidParameterValue")
.custom(value => bb.isValid(value)).withMessage("InvalidParameterValue"),
check("layers")
.exists().withMessage("MissingParameterValue")
.custom(value => assets.allLayersExist(value)).withMessage("UnknownLayer")
];
}
case "getcapabilities": {
return [];
}
}
}
module.exports = { commonChecks, specificChecks };
\ No newline at end of file
doctype xml
ps:Capabilities(xmlns:ps="http://www.opengis.net/3dps/1.0" xmlns:ows="http://www.opengis.net/ows/2.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/3dps/1.0 ../../../schema/3dpResp.xsd" version="1.0.0")
ows:ServiceIdentification
ows:Title HFT Stuttagrt 3DPS Implementation
ows:ServiceTypeVersion 1.0
ows:ServiceType(codeSpace="OGC") 3DPS
ows:OperationsMetadata
ows:Operation(name="GetScene")
Contents
each layer in layers
Layer
Title(xml:lang="en-us")= layer.name
Identifier(codeSpace="http://www.opengis.net/3dps/1.0")= layer.id
ows:BoundingBox
ows:LowerCorner= `${layer.boundingbox[0]} ${layer.boundingbox[1]}`
ows:UpperCorner= `${layer.boundingbox[2]} ${layer.boundingbox[3]}`
AvailbaleCRS= layer.CRS
doctype xml
ExceptionReport(xmlns="http://www.opengis.net/ows/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ows/2.0 owsExceptionReport.xsd" version="1.0.0" xml:lang="en")
Exception(exceptionCode=`${exceptionCode}` locator=`${locator}`)
\ No newline at end of file
doctype html
html(lang="en")
head
style(type="text/css").
body {
font-family: monospace;
}
.centered {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
title HFT Stuttgart 3DPS
body
div(class="centered")
pre= art
p This is an impementation of the 3D Portrayal Service.
p For more details visit #[a( href="https://gitlab.com/tomeof/node-3dps-extended", target="_blank" ) https://gitlab.com/tomeof/node-3dps-extended]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment