aboutsummaryrefslogtreecommitdiff
path: root/resources/op2geojson.js
diff options
context:
space:
mode:
Diffstat (limited to 'resources/op2geojson.js')
-rw-r--r--resources/op2geojson.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/resources/op2geojson.js b/resources/op2geojson.js
index 3221842..bef1153 100644
--- a/resources/op2geojson.js
+++ b/resources/op2geojson.js
@@ -39,6 +39,7 @@ op2geojson = function() {
var node = nodes[way.nodes[0]];
var point = {
"type" : "Feature",
+ "id" : way.id,
"geometry" : {
"type" : "Point",
"coordinates" : [node.lon,node.lat]
@@ -114,6 +115,7 @@ op2geojson = function() {
instance.polygon = function(relation, ways, nodes) {
polyCoordinates = [];
var firstCheck = true;
+ var subject;
$.each(relation.members, function(i, member) {
if (member.role == "outer") {
@@ -141,6 +143,8 @@ op2geojson = function() {
polyCoordinates.pop();
}
polyCoordinates = polyCoordinates.concat( wayCoordinates );
+ } else if (member.role == "subject") {
+ subject = member.ref;
}
});
@@ -155,6 +159,7 @@ op2geojson = function() {
// Add the tags
_.extend(poly.properties, relation.tags);
+ poly.properties["subject"] = subject;
return poly;
}