Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Node module to convert GeoJSON geometry objects or string representations into WKT format.
JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
tests
.gitignore
.travis.yml
Geojson2Wkt.js
Readme.md
license.txt
package.json

Readme.md

Geojson2Wkt

Node module to convert GeoJSON geometry objects or string representations into WKT format.

Build Status Coverage Status

Install

npm install geojson2wkt

Usage

Import the module:

var Geojson2wkt = require('Geojson2Wkt'); 

Parse a GeoJSON object

Geojson2wkt.convert({"type": "Point", "coordinates": [102.0, 0.5]}); // -- 'POINT(102 0.5)'

Or parse a string representation of a GeoJson object. The method automatically parses the string into an object.

Geojson2wkt.convert('{"type": "Point", "coordinates": [102.0, 0.5]}'); // -- 'POINT(102 0.5)'

Testing

Tests require nodeunit.

Running tests

nodeunit tests/test.js

Roadmap

  • documentation
  • Extend convert method to support
    • GeometryCollection
    • Polygons with holes
Something went wrong with that request. Please try again.