{"_id":"geojson-utils","_rev":"26-d71b360efb37bc3f66b19e7401b3f0eb","name":"geojson-utils","description":"GeoJSON Utilities for JavaScript","dist-tags":{"latest":"1.1.0"},"versions":{"0.0.1":{"name":"geojson-utils","version":"0.0.1","description":"GeoJSON Utilities for JavaScript","main":"geojson-utils.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/maxogden/geojson-js-utils.git"},"keywords":["geojson","geocouch"],"author":{"name":"Max Ogden"},"license":"MIT","_id":"geojson-utils@0.0.1","dist":{"shasum":"58feab54f742cb2f214cd87feaaf2f17843f2262","tarball":"https://registry.npmjs.org/geojson-utils/-/geojson-utils-0.0.1.tgz","integrity":"sha512-xl78uvwOt3IW7H3DS7I8GSDi7acISsMV3/d6pY76rcrt8xapfrGC11oajn2yOEy1nrHYyAUbsg1XbiMYzV+mSw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGv+oJYp4un1rF9UoXHnIJqHGGH7b5cKdGvlZYJ2uetfAiEA+hlIbE7YWPoWHP8tBUVQaz+9VldKK6G380/qdejhUZk="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"maxogden","email":"max@maxogden.com"},"maintainers":[{"name":"maxogden","email":"max@maxogden.com"}]},"0.0.2":{"name":"geojson-utils","version":"0.0.2","description":"GeoJSON Utilities for JavaScript","main":"geojson-utils.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/maxogden/geojson-js-utils.git"},"keywords":["geojson","geocouch"],"author":{"name":"Max Ogden"},"license":"MIT","_id":"geojson-utils@0.0.2","dist":{"shasum":"50c7500baba90dcfb84723ca9164f09a43338b7e","tarball":"https://registry.npmjs.org/geojson-utils/-/geojson-utils-0.0.2.tgz","integrity":"sha512-pnnKdToPfC7G3j4YUQkmU1cu9segp+VOAZet69E5gVn1mQe5oc4GSIP13vaQlz5poLFRZHr7dn4km1572Fludw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCtVZJMQkIyLmOQfDss/QjfbJJ9fOiRJ5OpY2tCKT8/pAIgPQIuD4dvNpGOz2Egzo70sQoD4l4eJS8ECKNo5iTPBf4="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"maxogden","email":"max@maxogden.com"},"maintainers":[{"name":"maxogden","email":"max@maxogden.com"}]},"0.1.0":{"name":"geojson-utils","version":"0.1.0","description":"GeoJSON Utilities for JavaScript","main":"geojson-utils.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/maxogden/geojson-js-utils.git"},"keywords":["geojson","geocouch"],"author":{"name":"Max Ogden"},"license":"MIT","_id":"geojson-utils@0.1.0","dist":{"shasum":"909798910e95224baf89020bfe24d5b02be34f29","tarball":"https://registry.npmjs.org/geojson-utils/-/geojson-utils-0.1.0.tgz","integrity":"sha512-YnS3+NmPYH9plEPJbT2dmmFUm/GKHjCKnV6lOFV8apPz6Xy6xuWFaZ/fpdse/b95PnMiSl4GEbCWV7oVVg1SIg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5BHnkGp6ZHa7/vqPnE9U+4l1c3UNTwUdP07E+txZu4AIgbcxUkjwt9Q01O8c94ez0DSiTRBhXGLC8MuXUvvTndbQ="}]},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"maxogden","email":"max@maxogden.com"},"maintainers":[{"name":"maxogden","email":"max@maxogden.com"}]},"0.2.0":{"name":"geojson-utils","version":"0.2.0","description":"GeoJSON Utilities for JavaScript","main":"geojson-utils.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/maxogden/geojson-js-utils.git"},"keywords":["geojson","geocouch"],"author":{"name":"Max Ogden"},"license":"MIT","_id":"geojson-utils@0.2.0","dist":{"shasum":"60ec2df225210c8c75af9dc9f2616c27244c27c1","tarball":"https://registry.npmjs.org/geojson-utils/-/geojson-utils-0.2.0.tgz","integrity":"sha512-lEzZ87p/8RBKz0uZLnSOLiGSE5LTI3zjZzvVucgd22MZQtVbk2mZZVvBkO1gBw8OSgYUSD9WvrH3tSIlQwvo+w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgpNuKiygDL1wQCUzT7CFh8odx8MWJU4CVHpfKNImCuQIgCQlFDqqHBiha2O2VXH5mukJnR8uHTt3a2nWyIb3iMeQ="}]},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"maxogden","email":"max@maxogden.com"},"maintainers":[{"name":"maxogden","email":"max@maxogden.com"}]},"1.0.0":{"name":"geojson-utils","version":"1.0.0","description":"GeoJSON Utilities for JavaScript","main":"geojson-utils.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/maxogden/geojson-js-utils.git"},"keywords":["geojson","geocouch"],"author":{"name":"Max Ogden"},"license":"MIT","bugs":{"url":"https://github.com/maxogden/geojson-js-utils/issues"},"_id":"geojson-utils@1.0.0","dist":{"shasum":"9494d521df9a1bff940d03fb2f9103c52ffb1ec8","tarball":"https://registry.npmjs.org/geojson-utils/-/geojson-utils-1.0.0.tgz","integrity":"sha512-9T+IDpFqxEOj/yYX5L+X5N1eS4TqjeUxv9V1H3+suduQaNv3d86O01qPBKeg2s3AVYQFJcGKxG51Eq30+NQugQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA3pKwwFnDvUaT2+N1ywDNEuAvlZfLqDGZmp0H8MN+8JAiACBLFUly79GE0+hoy36Mlz8y3qSXycRM2gmn1S46QbjA=="}]},"_from":".","_npmVersion":"1.2.30","_npmUser":{"name":"maxogden","email":"max@maxogden.com"},"maintainers":[{"name":"maxogden","email":"max@maxogden.com"}]},"1.0.1":{"name":"geojson-utils","version":"1.0.1","description":"GeoJSON Utilities for JavaScript","main":"geojson-utils.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/maxogden/geojson-js-utils.git"},"keywords":["geojson","geocouch"],"author":{"name":"Max Ogden"},"license":"MIT","bugs":{"url":"https://github.com/maxogden/geojson-js-utils/issues"},"_id":"geojson-utils@1.0.1","dist":{"shasum":"e1ad52ee69f212f48980fb069dddb6d4c839a4b1","tarball":"https://registry.npmjs.org/geojson-utils/-/geojson-utils-1.0.1.tgz","integrity":"sha512-4A7p6JvJAWSe7RzU+K31uxESZVRhVomjDTswPcop1N65YBglQsY9arqpTT/sXE+Ps5cCH3RirKl2iruTN5MzyA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCueMTfwze78E7aizU6DXF/bid08JMDjqZLtqSIje8D5QIgW/URPz3F++T3cPWtNPvX/I6bgtdCzDt8oG+ZGCr4rX0="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"maxogden","email":"mogden@gmail.com"},"maintainers":[{"name":"maxogden","email":"max@maxogden.com"}]},"1.0.2":{"name":"geojson-utils","version":"1.0.2","description":"GeoJSON Utilities for JavaScript","main":"geojson-utils.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/maxogden/geojson-js-utils.git"},"keywords":["geojson","geocouch"],"author":{"name":"Max Ogden"},"license":"MIT","bugs":{"url":"https://github.com/maxogden/geojson-js-utils/issues"},"_id":"geojson-utils@1.0.2","dist":{"shasum":"b43ff72578c9142b3e9aea24b1758a34b9e68001","tarball":"https://registry.npmjs.org/geojson-utils/-/geojson-utils-1.0.2.tgz","integrity":"sha512-vWDozwKD0RePSWSFYYOUR++234LFbXq6ih/ix6AXfZAHu4KAS1HEnhqe43ZhXaDiwd9lcIUJUR5TXPHxS8DFew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3IdaXkRbbq6mfrB2pMeE9SmQQmwlV3qzhWFgxbITWIwIhAKfjXI3RNyDH4dNB49zDLgXVfA9jPhCVtKbx52LLAFM7"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"maxogden","email":"mogden@gmail.com"},"maintainers":[{"name":"maxogden","email":"max@maxogden.com"}]},"1.1.0":{"name":"geojson-utils","version":"1.1.0","description":"GeoJSON Utilities for JavaScript","main":"geojson-utils.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/maxogden/geojson-js-utils.git"},"keywords":["geojson","geocouch"],"author":{"name":"Max Ogden"},"license":"MIT","bugs":{"url":"https://github.com/maxogden/geojson-js-utils/issues"},"homepage":"https://github.com/maxogden/geojson-js-utils","_id":"geojson-utils@1.1.0","dist":{"shasum":"e8ffb4c81c0a75b3e306f5187265d6f23040f50b","tarball":"https://registry.npmjs.org/geojson-utils/-/geojson-utils-1.1.0.tgz","integrity":"sha512-9irmjugYFrMvGjMw+qW5BQpghJO4ClFMDdPzVe2oDgtH2DhoKMaXqjIYPS5VpfrcnV0kOSrXcj8D9Izmr0AM9Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdpaELZawh82VWindqA4HSgn39eVk/yBKD6eW3xxxJkgIhAKCAvbV+zk/KTwcyK/MlS7LS1+LvdAWMcLfHlJ08IqiH"}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"maxogden","email":"max@maxogden.com"},"maintainers":[{"name":"maxogden","email":"max@maxogden.com"}]}},"readme":"GeoJSON Utilities for JavaScript\n================================\n\nHere you will find some functions to help you manipulate and work with GeoJSON\nobjects.\n\nSome algorithms adapted from [bjwbell/canvas-geolib](https://github.com/bjwbell/canvas-geolib)\n\n## How to use!\n\nLoad up in a browser OR `npm install geojson-utils`\n\n```javascript\nvar gju = require('geojson-utils');\n```\n\nYou now have an object named `gju` that contains all of the helper functions.\n\nRemember, GeoJSON coordinates are ordered [x,y] or [longitude,latitude] to comply with the Open\nGeospatial Consortium's recommendation!\n\n## Line intersections\n\n```javascript\ngju.linesIntersect({ \"type\": \"LineString\", \"coordinates\": [[0, 2], [5, 2]] },\n                 { \"type\": \"LineString\", \"coordinates\": [[3, 0], [3, 4], [4,4], [4,0]] })\n// [{\"type\":\"Point\",\"coordinates\":[2,3]},{\"type\":\"Point\",\"coordinates\":[2,4]}]\n\ngju.linesIntersect({ \"type\": \"LineString\", \"coordinates\": [[0, 2], [5, 2]] },\n                 { \"type\": \"LineString\", \"coordinates\": [[0, 0], [5, 0]] })\n// false\n```\n\n## Point in polygon\n\n```javascript\ngju.pointInPolygon({\"type\":\"Point\",\"coordinates\":[3,3]},\n                 {\"type\":\"Polygon\", \"coordinates\":[[[0,0],[6,0],[6,6],[0,6]]]})\n// [{\"type\":\"Point\",\"coordinates\":[3,3]}]\ngju.pointInPolygon({\"type\":\"Point\",\"coordinates\":[-1,-1]},\n                 {\"type\":\"Polygon\", \"coordinates\":[[[0,0],[6,0],[6,6],[0,6]]]})\n// false\n```\n\n## Radius filtering\n\nIf you retrieve a bunch of results from a bounding box query (common with R-tree\ngeo DBs), but you want to filter the rectangular result set by circular radius:\n\n```javascript\n// get the center of the original bounding box\nvar center = gju.rectangleCentroid({\n  \"type\": \"Polygon\",\n  \"coordinates\": [[[-122.677, 45.523], [-122.675, 45.524]]]\n}),\n// radius (in meters)\nradius = 100;\n\nfor (var i in geometryObjectsWithinBBox) {\n  if (gju.geometryWithinRadius(geometryObjectsWithinBBox[i], center, radius)) {\n    // ... do stuff with objects inside the circle\n  }\n}\n```\n\n## Distance between two points\n\nUses the Haversine distance formula to calculate the distance between two points\non the Earth's curved surface (as the crow flies, no hills!). Returns the\ndistance in meters.\n\n```javascript\ngju.pointDistance({type: 'Point', coordinates:[-122.67738461494446, 45.52319466622903]},\n                  {type: 'Point', coordinates:[-122.67652630805969, 45.52319466622903]})\n// 66.86677669313518\n```\n\n## and much much more!\n\n* \"example usage with [GeoCouch](https://github.com/maxogden/vmxch/blob/master/lists/radius.js)\"\n\n#### License\n\nThe MIT License\n\nCopyright (c) 2010 Max Ogden\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","maintainers":[{"name":"maxogden","email":"max@maxogden.com"}],"time":{"modified":"2022-06-18T07:38:12.743Z","created":"2012-11-29T20:28:11.245Z","0.0.1":"2012-11-29T20:28:12.140Z","0.0.2":"2012-12-02T00:38:16.228Z","0.1.0":"2013-04-02T05:32:31.286Z","0.2.0":"2013-05-15T00:11:07.549Z","1.0.0":"2013-06-23T17:50:22.828Z","1.0.1":"2013-09-30T23:37:17.648Z","1.0.2":"2013-10-07T22:20:55.730Z","1.1.0":"2014-03-18T23:14:23.300Z"},"author":{"name":"Max Ogden"},"repository":{"type":"git","url":"git://github.com/maxogden/geojson-js-utils.git"},"homepage":"https://github.com/maxogden/geojson-js-utils","keywords":["geojson","geocouch"],"bugs":{"url":"https://github.com/maxogden/geojson-js-utils/issues"},"license":"MIT","readmeFilename":"README.md","users":{"labithiotis":true,"mgenev":true,"acollins-ts":true,"zeke":true,"rkopylkov":true,"maxfranzapps":true,"diroru":true}}