diff --git a/geojson.js b/geojson.js index 2ba46df..dbf2379 100644 --- a/geojson.js +++ b/geojson.js @@ -1,5 +1,5 @@ (function(GeoJSON) { - GeoJSON.version = '0.1.5'; + GeoJSON.version = '0.2.0'; // Allow user to specify default parameters GeoJSON.defaults = {}; @@ -188,4 +188,4 @@ return properties; } -}(typeof module == 'object' ? module.exports : window.GeoJSON = {})); \ No newline at end of file +}(typeof module == 'object' ? module.exports : window.GeoJSON = {})); diff --git a/geojson.min.js b/geojson.min.js index e0d914d..9c434c2 100644 --- a/geojson.min.js +++ b/geojson.min.js @@ -1,3 +1,3 @@ -// geojson.js - v0.1.5 +// geojson.js - v0.2.0 // (c) 2014 Casey Thomas, MIT License -!function(a){function b(a,b){var c=a||{};for(var d in b)b.hasOwnProperty(d)&&!c[d]&&(c[d]=b[d]);return c}function c(a,b){if(b.crs&&(a.crs={type:"name",properties:{name:b.crs}}),b.bbox&&(a.bbox=b.bbox),b.extraGlobal){a.properties={};for(var c in b.extraGlobal)a.properties[c]=b.extraGlobal[c]}}function d(a){a.geom={};for(var b in a)a.hasOwnProperty(b)&&-1!==j.indexOf(b)&&(a.geom[b]=a[b],delete a[b]);e(a.geom)}function e(a){for(var b in a)a.hasOwnProperty(b)&&("string"==typeof a[b]?k.push(a[b]):"object"==typeof a[b]&&(k.push(a[b][0]),k.push(a[b][1])));if(0===k.length)throw new Error("No geometry attributes specified")}function f(a,b,c){var d={type:"Feature"};return d.geometry=g(a,b),d.properties=c.call(a),d}function g(a,b){var c,d={};for(var e in b.geom)c="object"==typeof b.geom[e]?b.geom[e][0]:b.geom[e],b.geom.hasOwnProperty(e)&&a[c]&&(d.type=e,d.coordinates="string"==typeof b.geom[e]?a[b.geom[e]]:[a[b.geom[e][1]],a[b.geom[e][0]]]);return d}function h(a){var b;return a.exclude||a.include?a.include?b=function(b){a.include.forEach(function(a){b[a]=this[a]},this)}:a.exclude&&(b=function(b){for(var c in this)this.hasOwnProperty(c)&&-1===k.indexOf(c)&&-1===a.exclude.indexOf(c)&&(b[c]=this[c])}):b=function(a){for(var b in this)this.hasOwnProperty(b)&&-1===k.indexOf(b)&&(a[b]=this[b])},function(){var c={};return b.call(this,c),a.extra&&i(c,a.extra),c}}function i(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}a.version="0.1.5",a.defaults={},a.parse=function(a,e,g){if(0===a.length)throw new Error("No data found");var i,j={type:"FeatureCollection",features:[]},l=b(e,this.defaults);return k.length=0,d(l),i=h(l),a.forEach(function(a){j.features.push(f(a,l,i))}),c(j,l),g&&"function"==typeof g?void g(j):j};var j=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],k=[]}("object"==typeof module?module.exports:window.GeoJSON={}); \ No newline at end of file +!function(a){function b(a,b){var c=a||{};for(var d in b)b.hasOwnProperty(d)&&!c[d]&&(c[d]=b[d]);return c}function c(a,b){if(b.crs&&(a.crs={type:"name",properties:{name:b.crs}}),b.bbox&&(a.bbox=b.bbox),b.extraGlobal){a.properties={};for(var c in b.extraGlobal)a.properties[c]=b.extraGlobal[c]}}function d(a){a.geom={};for(var b in a)a.hasOwnProperty(b)&&-1!==j.indexOf(b)&&(a.geom[b]=a[b],delete a[b]);e(a.geom)}function e(a){for(var b in a)a.hasOwnProperty(b)&&("string"==typeof a[b]?k.push(a[b]):"object"==typeof a[b]&&(k.push(a[b][0]),k.push(a[b][1])));if(0===k.length)throw new Error("No geometry attributes specified")}function f(a,b,c){var d={type:"Feature"};return d.geometry=g(a,b),d.properties=c.call(a),d}function g(a,b){var c,d={};for(var e in b.geom)c="object"==typeof b.geom[e]?b.geom[e][0]:b.geom[e],b.geom.hasOwnProperty(e)&&a[c]&&(d.type=e,d.coordinates="string"==typeof b.geom[e]?a[b.geom[e]]:[a[b.geom[e][1]],a[b.geom[e][0]]]);return d}function h(a){var b;return a.exclude||a.include?a.include?b=function(b){a.include.forEach(function(a){b[a]=this[a]},this)}:a.exclude&&(b=function(b){for(var c in this)this.hasOwnProperty(c)&&-1===k.indexOf(c)&&-1===a.exclude.indexOf(c)&&(b[c]=this[c])}):b=function(a){for(var b in this)this.hasOwnProperty(b)&&-1===k.indexOf(b)&&(a[b]=this[b])},function(){var c={};return b.call(this,c),a.extra&&i(c,a.extra),c}}function i(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}a.version="0.2.0",a.defaults={},a.parse=function(a,e,g){var i,j={type:"FeatureCollection",features:[]},l=b(e,this.defaults);return k.length=0,d(l),i=h(l),a.forEach(function(a){j.features.push(f(a,l,i))}),c(j,l),g&&"function"==typeof g?void g(j):j};var j=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],k=[]}("object"==typeof module?module.exports:window.GeoJSON={}); \ No newline at end of file diff --git a/package.json b/package.json index 24e4208..6a7453c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "geojson", "description": "Convert an array of geographic objects to GeoJSON", "author": "Casey Thomas ", - "version": "0.1.5", + "version": "0.2.0", "main": "./geojson", "repository": { "type": "git", @@ -20,7 +20,7 @@ "grunt-lib-phantomjs": "~0.3.1" }, "engines": { - "node": "0.8.x" + "node": "0.10.x" }, "scripts": { "test": "mocha"