1.0.13 • Published 5 years ago

geojson-parser-js v1.0.13

Weekly downloads
47
License
MIT
Repository
github
Last release
5 years ago

geojson-parser-js

A Node.js module to generate a geojson or validate it. This module also let you easily parse geometries from geojson.

Installation

npm install geojson-parser-js --save
yarn add geojson-parser-js
bower install geojson-parser-js --save

Demo

You can use the demo at https://www.geojson.in/

Usage

TypeScript

import {Geojson} from 'geojson-parser-js';
var isValid = Geojson.isValid({ "type": "FeatureCollection",  "features": [] });
Output should be 'true'
import {Geojson} from 'geojson-parser-js';
import { FeatureCollection, GeometryType, FeatureProperty, Coordinate, Geometry, Point, LineString, Polygon, PolygonWithHole, MultiPoint, MultiLineString, MultiPolygon } from 'geojson-parser-js/models/geojson';
let features:FeatureCollection = Geojson.parse('{ "type": "FeatureCollection",  "features": [] }');
Output should be an instance of FeatureCollection class
import {Geojson} from 'geojson-parser-js';
import { FeatureCollection } from 'geojson-parser-js/models/geojson';
let geoJsonStr:string = Geojson.create(features);
Input should be an instance of FeatureCollection
Output should be an Geojson string

Javascript

var geojson = require('geojson-parser-js');
var isValid = geojson.isValid('{ "type": "FeatureCollection",  "features": [] }');
Output should be 'true'
var geojson = require('geojson-parser-js');
var features = geojson.parse('{ "type": "FeatureCollection",  "features": [] }');
Output should be an instance of FeatureCollection class
var geojson = require('geojson-parser-js');
var geojsonStr = geojson.create(features);
Input should be an instance of FeatureCollection
Output should be an Geojson string

AMD

define(function(require,exports,module){
  var parser = require('geojson-parser-js');
});

Test

npm run test

Support

You can directly send any bug/issue or suggestion to my personal email id: shubhgupta4u@gmail.com.
1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago