All Projects → echoes-xyz → Mongoose Geojson Schema

echoes-xyz / Mongoose Geojson Schema

Licence: mit
Schema definitions for GeoJSON types for use with Mongoose JS

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Mongoose Geojson Schema

Geotools
Official GeoTools repository
Stars: ✭ 1,109 (+1580.3%)
Mutual labels:  mongodb, geojson
Kepler
The open source full-stack geosocial network platform
Stars: ✭ 125 (+89.39%)
Mutual labels:  mongodb, geojson
Lawn
⛔ ARCHIVED ⛔ turf.js R client
Stars: ✭ 57 (-13.64%)
Mutual labels:  geojson
Indonesia Postal And Area
Indonesia Postal Code & Area (BPS)
Stars: ✭ 64 (-3.03%)
Mutual labels:  geojson
Todo List Using Flask And Mongodb
Simple implementation of ToDo List using Flask and MongoDB along with Dockerfile and Kubernetes yaml files #Flask #Example #Docker #Kubernetes #k8s
Stars: ✭ 61 (-7.58%)
Mutual labels:  mongodb
Geo Maps
🗺 High Quality GeoJSON maps programmatically generated.
Stars: ✭ 1,098 (+1563.64%)
Mutual labels:  geojson
Spring Boot Extend
在springboot基础上的扩展项目,快速集成Zookeeper、Dubbo、Apollo、Mybatis多数据源
Stars: ✭ 63 (-4.55%)
Mutual labels:  mongodb
Building A Serverless Rest Api With Nodejs
A quick and easy guide of how to hook up a single Serverless service with basic MongoDB connection and CRUD interaction.
Stars: ✭ 57 (-13.64%)
Mutual labels:  mongodb
Habitica
A habit tracker app which treats your goals like a Role Playing Game.
Stars: ✭ 8,702 (+13084.85%)
Mutual labels:  mongodb
Hentergeo
基于Symfony2和MongoDB的地理位置查询演示
Stars: ✭ 64 (-3.03%)
Mutual labels:  mongodb
Mern Stack Authentication
Secure MERN Stack CRUD Web Application using Passport.js Authentication
Stars: ✭ 60 (-9.09%)
Mutual labels:  mongodb
Rest Hapi
🚀 A RESTful API generator for Node.js
Stars: ✭ 1,102 (+1569.7%)
Mutual labels:  mongodb
Flask Restful Authentication
An example for RESTful authentication using nginx, uWSGI, Flask, MongoDB and JSON Web Token(JWT).
Stars: ✭ 63 (-4.55%)
Mutual labels:  mongodb
Docker Backup Database
Docker image to periodically backup your database (MySQL, Postgres, or MongoDB) to S3 or local disk.
Stars: ✭ 57 (-13.64%)
Mutual labels:  mongodb
Sample Spring Cloud Webflux
sample microservices demonstrating usage of spring reactive support with spring webflux and integration spring cloud, eureka, ribbon, spring cloud gateway, spring data jpa and mongodb
Stars: ✭ 65 (-1.52%)
Mutual labels:  mongodb
Eva
🐳🐬Eva : 优雅,简约的完整博客项目 [前后端] (Eva: A concise, simple Blog Project. [FD/BD]) 🐋
Stars: ✭ 57 (-13.64%)
Mutual labels:  mongodb
Aspnet Core Clean Arch
It is a clean architecture project template which is based on hexagonal-architecture principles built with .Net core.
Stars: ✭ 60 (-9.09%)
Mutual labels:  mongodb
Gpx Simplify Optimizer
Free Tracks Optimizer Online Service
Stars: ✭ 61 (-7.58%)
Mutual labels:  geojson
Mall Learning
mall学习教程,架构、业务、技术要点全方位解析。mall项目(40k+star)是一套电商系统,使用现阶段主流技术实现。涵盖了SpringBoot 2.3.0、MyBatis 3.4.6、Elasticsearch 7.6.2、RabbitMQ 3.7.15、Redis 5.0、MongoDB 4.2.5、Mysql5.7等技术,采用Docker容器化部署。
Stars: ✭ 10,236 (+15409.09%)
Mutual labels:  mongodb
Featureserver
An open source Geoservices Implementation
Stars: ✭ 66 (+0%)
Mutual labels:  geojson

mongoose-geojson-schema

About

Schema definitions for GeoJSON types for use with Mongoose JS, a mongodb object model.

The GeoJSON Schema specifies geospatial data types for use in JSON-based projects. This package aims to make those data types available to those wanting to employ them in a mongoose schema, with validation following the strict guidelines available on the GeoJSON website. The following data types are available:

  • Point
  • MultiPoint
  • LineString
  • MultiLineString
  • Polygon
  • MultiPolygon

and the following super types:

  • Geometry
  • GeometryCollection
  • Feature
  • FeatureCollection

Coordinate Reference Systems

Following the GeoJSON spec, we assume a default coordinate reference system (CRS) of the WGS84 datum. That is, coordinates are validated to represent longitude and latitude units of decimal degrees.

If you wish to disable this validation, set the crs property to a null or alternate value following the GeoJSON spec for Coordinate Reference Sytems

Installation

First install node.js, mongodb and mongoose

$ npm install mongoose-geojson-schema --save

Usage v2.x

var GeoJSON = require('mongoose-geojson-schema');
var mongoose = require('mongoose');

var schema = new mongoose.Schema({
	any: mongoose.Schema.Types.GeoJSON,
	point: mongoose.Schema.Types.Point,
  multipoint: mongoose.Schema.Types.MultiPoint,
  linestring: mongoose.Schema.Types.LineString,
  multilinestring: mongoose.Schema.Types.MultiLineString,
  polygon: mongoose.Schema.Types.Polygon,
  multipolygon: mongoose.Schema.Types.MultiPolygon,
  geometry: mongoose.Schema.Types.Geometry,
  geometrycollection: mongoose.Schema.Types.GeometryCollection,
  feature: mongoose.Schema.Types.Feature,
  featurecollection: mongoose.Schema.Types.FeatureCollection
});

var db = mongoose.createConnection('localhost', 'test');
var Location = db.model('GeoJSON', schema);

var test = new Location({
	any: {
		type: "Point",
		coordinates: [-113.806458, 44.847784]
	},
	point: {
	  type: "Point",
	  coordinates: [12.123456, 13.134578]
	},
	...
	polygon: {
		type: "Polygon",
		coordinates: [
			[
				[12.123456, 13.1345678],
				[179.999999, -1.345],
				[12.0002, -45.4663],
				[12.123456, 13.1345678]
			],
			...
	}
});

Usage v1.x

var GeoJSON = require('mongoose-geojson-schema');
var mongoose = require('mongoose');

var schema = new mongoose.Schema({
	point: mongoose.Schema.Types.Point,
	multipoint: mongoose.Schema.Types.MultiPoint,
	linestring: mongoose.Schema.Types.LineString,
	multilinestring: mongoose.Schema.Types.MultiLineString,
	polygon: mongoose.Schema.Types.Polygon,
	multipolygon: mongoose.Schema.Types.MultiPolygon,
	geometry: mongoose.Schema.Types.Geometry,
	geometrycollection: mongoose.Schema.Types.GeometryCollection,
	feature: mongoose.Schema.Types.Feature,
	featurecollection: mongoose.Schema.Types.FeatureCollection
});

var db = mongoose.createConnection('localhost', 'test');
var model = db.model('GeoJSON', schema);

var test = new GeoJSON({
	point: {
	  type: "Point",
	  coordinates: [12.123456, 13.134578]
	},
	...
	polygon: {
		type: "Polygon",
		coordinates: [
			[
				[12.123456, 13.1345678],
				[179.999999, -1.345],
				[12.0002, -45.4663],
				[12.123456, 13.1345678]
			],
			...
	}
});

Usage v0.x

var GeoJSON = require('mongoose-geojson-schema');
var mongoose = require('mongoose');

var schema = new mongoose.Schema({
	geoFeature:GeoJSON.Feature
});

Testing

npm test

Contributors

Ben Dalton, Mark Stosberg, Joshua Kopecek

License

Copyright (c) 2014-2016, RideAmigos. (MIT License)

See LICENSE for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].