Giter Site home page Giter Site logo

deniscarriere / ogc-parser Goto Github PK

View Code? Open in Web Editor NEW
15.0 3.0 4.0 452 KB

Parser to convert OGC WMTS/WMS XML schemas to human friendly JSON.

Home Page: https://npm.runkit.com/ogc-parser

License: MIT License

JavaScript 98.56% TypeScript 1.44%
ogc-services ogc wmts wms javascript nodejs xpath

ogc-parser's Introduction

OGC Parser

Build Status npm version Coverage Status MIT licensed ES5

Standard - JavaScript Style Guide

Parser to convert OGC WMTS/WMS XML schemas to human friendly JSON.

Install

npm

$ npm install --save ogc-parser

web browser (ES5)

<script src="https://wzrd.in/standalone/ogc-parser@latest"></script>

Quickstart

const fs = require('fs')
const xml = fs.readFileSync('ogc-wmts.xml', 'utf8')
const capabilities = ogcParser.wmts(xml)
capabilities.service.type
//=OGC WMTS
capabilities.service.version
//=1.0.0
capabilities.url.getCapabilities
//=http://localhost:80/WMTS/1.0.0/WMTSCapabilities.xml

ogc-wmts.xml

<declaration version="1.0" encoding="utf-8"/>
<Capabilities xmlns="http://www.opengis.net/wmts/1.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gml="http://www.opengis.net/gml" xsi:schemaLocation="http://www.opengis.net/wmts/1.0 http://schemas.opengis.net/wmts/1.0/wmtsGetCapabilities_response.xsd" version="1.0.0">
  <ServiceMetadataURL xlink:href="http://localhost:80/WMTS/1.0.0/WMTSCapabilities.xml"/>
  <ows:ServiceIdentification>
    <ows:ServiceTypeVersion>1.0.0</ows:ServiceTypeVersion>
    <ows:ServiceType>OGC WMTS</ows:ServiceType>
...

capabilities

{
	"service": {
		"type": "OGC WMTS",
		"version": "1.0.0",
		"title": "Mapbox"
	},
	"layer": {
		"title": "Satellite Streets",
		"abstract": "© OSM, © DigitalGlobe",
		"identifier": "ciy23jhla008n2soz34kg2p4u",
		"format": "image/jpeg",
		"bbox": [
			-180,
			-85.051129,
			179.976804,
			85.051129
		],
		"minzoom": 0,
		"maxzoom": 20,
		"tileMatrixSets": [
			"GoogleMapsCompatible"
		]
	},
	"url": {
		"resourceURL": "https://api.mapbox.com/styles/v1/addxy/ciy23jhla008n2soz34kg2p4u/tiles/{TileMatrix}/{TileCol}/{TileRow}?access_token=pk.eyJ1IjoiYWRkeHkiLCJhIjoiY2lsdmt5NjZwMDFsdXZka3NzaGVrZDZtdCJ9.ZUE-LebQgHaBduVwL68IoQ",
		"getCapabilities": "https://api.mapbox.com/styles/v1/addxy/ciy23jhla008n2soz34kg2p4u/wmts?access_token=pk.eyJ1IjoiYWRkeHkiLCJhIjoiY2lsdmt5NjZwMDFsdXZka3NzaGVrZDZtdCJ9.ZUE-LebQgHaBduVwL68IoQ",
		"getTile": "https://api.mapbox.com/styles/v1/addxy/ciy23jhla008n2soz34kg2p4u/wmts?access_token=pk.eyJ1IjoiYWRkeHkiLCJhIjoiY2lsdmt5NjZwMDFsdXZka3NzaGVrZDZtdCJ9.ZUE-LebQgHaBduVwL68IoQ",
		"host": "api.mapbox.com"
	}
}

ogc-parser's People

Contributors

albertomusetti avatar deniscarriere avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ogc-parser's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.