geojson-to-gml-3

3.0.0 • Public • Published

geojson-to-gml-3

NPM Version

A package to translate geojson geometries to GML 3.2.1.

Installation

pnpm
pnpm add geojson-to-gml-3
npm
npm install geojson-to-gml-3
yarn
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.

Package Sidebar

Install

npm i geojson-to-gml-3

Weekly Downloads

75

Version

3.0.0

License

SEE LICENSE IN ./LICENSE.md

Unpacked Size

47.4 kB

Total Files

10

Last publish

Collaborators

  • skalt