Permalink
Browse files

split off polygon_features data file into own repo:

  • Loading branch information...
1 parent e879778 commit 5146b5874ea63afbf050c6bdc9d8b02d86baee51 @tyrasd committed Feb 14, 2016
Showing with 22 additions and 92 deletions.
  1. +1 −1 Makefile
  2. +1 −1 bower.json
  3. +12 −1 index.js
  4. +1 −1 osmtogeojson.js
  5. +7 −6 package.json
  6. +0 −82 polygon_features.json
View
@@ -1,4 +1,4 @@
-osmtogeojson.js: index.js polygon_features.json package.json lodash.custom.js node_modules
+osmtogeojson.js: index.js package.json lodash.custom.js node_modules
browserify -s osmtogeojson index.js | uglifyjs -c -m -o osmtogeojson.js
coverage: .
istanbul cover _mocha -x lodash.custom.js -- -R spec
View
@@ -1,7 +1,7 @@
{
"name": "osmtogeojson",
"main": "osmtogeojson.js",
- "version": "2.2.8",
+ "version": "2.2.9",
"homepage": "http://tyrasd.github.io/osmtogeojson",
"authors": [
"Martin Raifer"
View
@@ -2,7 +2,18 @@ var _ = require("./lodash.custom.js");
var rewind = require("geojson-rewind");
// see https://wiki.openstreetmap.org/wiki/Overpass_turbo/Polygon_Features
-var polygonFeatures = require("./polygon_features.json");
+var polygonFeatures = {};
+require("osm-polygon-features").forEach(function(tags) {
+ if (tags.polygon === "all")
+ polygonFeatures[tags.key] = true;
+ else {
+ var list = (tags.polygon === "whitelist") ? "included_values" : "excluded_values",
+ tagValuesObj = {};
+ tags.values.forEach(function(value) { tagValuesObj[value] = true; });
+ polygonFeatures[tags.key] = {};
+ polygonFeatures[tags.key][list] = tagValuesObj;
+ }
+});
var osmtogeojson = {};
View
Oops, something went wrong.
View
@@ -1,6 +1,6 @@
{
"name": "osmtogeojson",
- "version": "2.2.8",
+ "version": "2.2.9",
"description": "convert OSM to geojson",
"main": "index.js",
"scripts": {
@@ -26,13 +26,14 @@
"url": "https://github.com/tyrasd/osmtogeojson/issues"
},
"dependencies": {
- "geojson-rewind": "0.1.0",
- "geojson-numeric": "0.2.0",
- "xmldom": "~0.1.16",
- "optimist": "~0.3.5",
+ "JSONStream": "0.8.0",
"concat-stream": "~1.0.1",
+ "geojson-numeric": "0.2.0",
+ "geojson-rewind": "0.1.0",
"htmlparser2": "3.5.1",
- "JSONStream": "0.8.0"
+ "optimist": "~0.3.5",
+ "osm-polygon-features": "^0.9.1",
+ "xmldom": "~0.1.16"
},
"devDependencies": {
"expect.js": "~0.2.0",
View
@@ -1,82 +0,0 @@
-{
- "building": true,
- "highway": {
- "included_values": {
- "services": true,
- "rest_area": true,
- "escape": true
- }
- },
- "natural": {
- "excluded_values": {
- "coastline": true,
- "cliff": true,
- "ridge": true,
- "arete": true,
- "tree_row": true
- }
- },
- "landuse": true,
- "waterway": {
- "included_values": {
- "riverbank": true,
- "dock": true,
- "boatyard": true,
- "dam": true
- }
- },
- "amenity": true,
- "leisure": true,
- "barrier": {
- "included_values": {
- "city_wall": true,
- "ditch": true,
- "hedge": true,
- "retaining_wall": true,
- "wall": true,
- "spikes": true
- }
- },
- "railway": {
- "included_values": {
- "station": true,
- "turntable": true,
- "roundhouse": true,
- "platform": true
- }
- },
- "area": true,
- "boundary": true,
- "man_made": {
- "excluded_values": {
- "cutline": true,
- "embankment": true,
- "pipeline": true
- }
- },
- "power": {
- "included_values": {
- "plant": true,
- "substation": true,
- "generator": true,
- "transformer": true
- }
- },
- "place": true,
- "shop": true,
- "aeroway": {
- "excluded_values": {
- "taxiway": true
- }
- },
- "tourism": true,
- "historic": true,
- "public_transport": true,
- "office": true,
- "building:part": true,
- "military": true,
- "ruins": true,
- "area:highway": true,
- "craft": true,
- "golf": true
-}

0 comments on commit 5146b58

Please sign in to comment.