Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

mongoose-geojson-schemas

lykmapipo226MIT0.12.9

mongoose schema to support geojson fields

lykmapipo, mongoose, mongoose-plugin, geojson, point, polygon, linestring, multipoint, multipolygon, multilinestring, geometry, feature

readme

mongoose-geojson-schemas

Build Status Dependencies Status npm version

mongoose schema to support GeoJSON fields.

Note: All geojson types will added as single-embedded document(sub-schema) and 2dsphere indexed

Requirements

Install

$ npm install --save mongoose mongoose-geojson-schemas

Usage

const { Schema } = require('mongoose');
const {
  Point,
  LineString,
  Polygon,
  MultiPoint,
  MultiLineString,
  MultiPolygon,
  Geometry,
  GeometryCollection
} = require('mongoose-geojson-schemas');

...

const Shop = new Schema({
  name: { type: String, required: true }
  location: Point
});

...

const Road = new Schema({
  name: { type: String, required: true }
  footpath: LineString
});

...

const Farm = new Schema({
  owner: { type: String, required: true }
  boundary: Polygon
});

...

const Dump = new Schema({
  name: { type: String, required: true }
  area: MultiPoint
});

...

const Rail = new Schema({
  name: { type: String, required: true }
  ways: MultiLineString
});

...

const Jurisdiction = new Schema({
  name: { type: String, required: true }
  boundaries: MultiPolygon
});

...

const Shape = new Schema({
  name: { type: String, required: true }
  form: Geometry
});

...

const Trash = new Schema({
  name: { type: String, required: true }
  pile: GeomentryCollection
});

...

Testing

  • Clone this repository

  • Install all development dependencies

    $ npm install
  • Then run test
    $ npm test

References

Contribute

It will be nice, if you open an issue first so that we can know what is going on, then, fork this repo and push in your ideas. Do not forget to add a bit of test(s) of what value you adding.

Licence

The MIT License (MIT)

Copyright (c) 2018 lykmapipo & Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

changelog

0.12.9 (2020-08-08)

Chores
  • deps: force latest version & audit fix (cf4f2687)

0.12.8 (2020-07-29)

Chores
  • deps: force latest version & audit fix (6f22e4a1)

0.12.7 (2020-07-14)

Chores
  • deps: force latest version & audit fix (fabbbd86)

0.12.6 (2020-07-02)

Chores
  • deps: force latest version & audit fix (d86328eb)

0.12.5 (2020-06-26)

Chores
  • deps: force latest version & audit fix (cde4e807)

0.12.4 (2020-06-10)

0.12.3 (2020-05-20)

Chores
  • deps: force latest version & audit fix (56a1cac9)

0.12.2 (2020-05-09)

Chores
  • deps: force latest version & audit fix (f2d4fe75)

0.12.1 (2020-05-02)

Chores
  • deps: force latest version & audit fix (19d4102f)

0.12.0 (2020-05-01)

Chores
  • deps:
    • force latest version & audit fix (992e138c)
    • force latest version & audit fix (ce81c9c0)
Bug Fixes

0.11.13 (2020-04-27)

Chores
  • deps: force latest version & audit fix (a7ff2060)

0.11.12 (2020-04-16)

Chores
  • deps: force latest version & audit fix (05b5cb07)

0.11.11 (2020-03-30)

Chores
  • deps: force latest version & audit fix (b51f5526)

0.11.10 (2020-03-06)

Chores
  • deps: force latest version & audit fix (061ec56d)

0.11.9 (2020-02-28)

Chores
  • deps: force latest version & audit fix (ebefea7b)

0.11.8 (2020-02-16)

Chores
  • deps: force latest version & audit fix (e196f56d)

0.11.7 (2020-02-04)

Chores
  • deps: force latest version & audit fix (d5dbaf17)

0.11.6 (2020-01-23)

Chores
  • deps: force latest version & audit fix (ea403f55)

0.11.5 (2020-01-22)

Chores
  • deps: force latest version & audit fix (5dc133fd)

0.11.4 (2020-01-17)

Chores
  • deps: force latest version & audit fix (42bd2fb7)

0.11.3 (2020-01-14)

Chores
  • deps: force latest version & audit fix (2a5e5e0b)

0.11.2 (2020-01-14)

Chores
  • deps: force latest version & audit fix (b33761a8)

0.11.1 (2020-01-12)

Chores
  • deps: force latest version & audit fix (d51b58aa)

0.11.0 (2019-12-16)

New Features
  • fake: use geo tools helpers (a8566350)
  • random: use geotools helpers (2bfbf1c3)
Refactors
  • improve import & exports (7479de3e)
  • validation: use sync validators (0794f4b4)

0.10.19 (2019-12-16)

Chores
  • deps: force latest version & audit fix (79c1f3dc)
Refactors
Tests

0.10.18 (2019-12-12)

0.10.17 (2019-12-11)

Chores
  • deps: force latest version & audit fix (c30715d9)

0.10.16 (2019-11-14)

Tests

0.10.15 (2019-11-14)

Chores
  • deps: force latest version & audit fix (e2c03171)

0.10.14 (2019-10-23)

Chores
  • deps:
    • force latest version & audit fix (a98d72fc)
    • ensure same version of mongoose (f5684524)

0.10.13 (2019-10-10)

Chores
  • deps: force latest version & audit fix (43ae5f37)

0.10.12 (2019-09-28)

Chores
  • deps: force latest version & audit fix (a8320c68)

0.10.11 (2019-09-26)

Chores
  • deps: force latest version & audit fix (bbaf563a)

0.10.10 (2019-09-16)

Chores
  • deps: force latest version & audit fix (202d8212)

0.10.9 (2019-08-14)

Chores
  • deps: force latest version & audit fix (dc0a54ff)

0.10.8 (2019-07-09)

Chores
  • deps: force latest version & audit fix (c5bdf6b8)

0.10.7 (2019-06-19)

Chores
  • deps: force latest version & audit fix (5fce6a9b)

0.10.6 (2019-06-09)

Chores
  • deps: force latest version & audit fix (f579b30d)

0.10.5 (2019-05-20)

Chores
  • deps: force latest version & audit fix (d164200e)

0.10.4 (2019-05-12)

Chores
  • deps: force latest version & audit fix (23a47996)

0.10.3 (2019-05-01)

Chores
  • .npmrc: prevent npm version to commit and tag version (740afe8f)
  • deps: force latest version & audit fix (096a9467)
  • ci: force latest nodejs (b7016dab)

0.10.2 (2019-04-16)

Chores
Documentation Changes
  • add code of conduct & contributing guide (aed696aa)