geojson-to-gml-3

a package to translate geojson to gml

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
geojson-to-gml-3
1442.0.26 years ago7 years agoMinified + gzip package size for geojson-to-gml-3 in KB

Readme

geojson-to-gml-3
npm version Build Status
A package to translate geojson geometries to GML 3.2.1.
Geography Markup Language (GML) is an OGC Standard.
More information may be found at http://www.opengeospatial.org/standards/gml
The most current schema are available at http://schemas.opengis.net/ .
Policies, Procedures, Terms, and Conditions of OGC(r) are available at http://www.opengeospatial.org/ogc/legal/ .
OGC and OpenGIS are registered trademarks of Open Geospatial Consortium.

Installation

npm install geojson-to-gml-3

Use

// convert any geometry
import turf from '@turf/helpers';
import {geomToGml} from 'geojso-to-gml-3';
geomToGml(turf.point([0,0]).geometry);

// or for ultra-slim builds, import only what you need.
import {point, lineString, makeTranslator} from 'geojson-to-gml-3';
const geomToGml = makeTranslator({point, lineString});
// returns (geom, gmlId, params) => {
//  return {Point:point, LineString:lineString}[geom.type](geom, gmlId, params);
// }
geomToGml(turf.point([0,0]).geometry);
geomToGml(turf.linString([[0,0], [1,1]]));
For more details, see the API docs

Contribute

Contributions are welcome! Please submit issues, reference them in your PR, and make sure to add tests for any contributions you make.