3.0.0 • Published 2 months ago
geojson-to-gml-3 v3.0.0
geojson-to-gml-3
A package to translate geojson geometries to GML 3.2.1.
Installation
pnpm add geojson-to-gml-3
npm install geojson-to-gml-3
yarn add geojson-to-gml-3
Use
import type { Geometry } from 'geojson';
import gml from 'geojson-to-gml-3';
import { it, expect } from 'vitest';
it('can convert any geometry to GML', () => {
const nullIsland: Geometry = {
type: 'Point',
coordinates: [0, 0],
};
// prettier-ignore
expect(gml(nullIsland)()).toBe(''
+ `<gml:Point>`
+ `<gml:pos>`
+ `0 0`
+ `</gml:pos>`
+ `</gml:Point>`
);
});
import type { LineString } from 'geojson';
import { lineString } from 'geojson-to-gml-3';
import { it, expect } from 'vitest';
it('supports tree-shaking for slimmer builds', () => {
const line: LineString = {
type: 'LineString',
coordinates: [
[0, 0],
[1, 1],
],
};
expect(lineString(line)()).toBe(''
+ `<gml:LineString>`
+ `<gml:posList>`
+ `0 0 1 1`
+ `</gml:posList>`
+ `</gml:LineString>`
);
});
License
geojson-to-gml-3
is free for noncommercial use or commercial use for a period of 30 days. For more details, see the license.
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.