Skip to content

Commit 12d7244

Browse files
committed
Fixing issue with nodes not importing properly
1 parent ae4d619 commit 12d7244

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

otls/sop_osm_import.hda/INDEX__SECTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ Inputs: 0 to 0
1010
Subnet: true
1111
Python: false
1212
Empty: false
13-
Modified: Sun Nov 26 10:27:41 2017
13+
Modified: Mon Nov 27 16:41:18 2017
1414

Binary file not shown.

otls/sop_osm_import.hda/gamedev_8_8Sop_1sop__osm__import/Contents.dir/Contents.mime

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ Content-Type: text/plain
3232

3333
sopflags sopflags =
3434
comment ""
35-
position 0.0764706 0.00382352
35+
position -4.95882 0.545
3636
connectornextid 0
37-
flags = lock off model off template off footprint off xray off bypass off display on render on highlight off unload off savedata off compress on colordefault on exposed on
37+
flags = lock off model off template on footprint off xray off bypass off display on render on highlight off unload off savedata off compress on colordefault on exposed on
3838
outputsNamed3
3939
{
4040
}
@@ -46,8 +46,8 @@ inputs
4646
}
4747
stat
4848
{
49-
create 1511709931
50-
modify 1511710054
49+
create 1511818132
50+
modify 1511818150
5151
author MAINGEAR@DESKTOP-P98C1VA
5252
access 0777
5353
}
@@ -96,7 +96,7 @@ inputs
9696
stat
9797
{
9898
create 1500592402
99-
modify 1511710049
99+
modify 1511818861
100100
author Luiz@Luiz-PC
101101
access 0777
102102
}
@@ -162,8 +162,7 @@ class OSMNode(object):
162162
self.lon = xml_node.attrib[\"lon\"]
163163
for child in xml_node:
164164
if child.tag == \"tag\":
165-
#clean_tag = re.sub('[^a-zA-Z0-9\\n]', '', child.attrib[\"k\"])
166-
clean_tag = child.attrib[\"k\"].encode(\"utf-8\")
165+
clean_tag = re.sub('[^a-zA-Z0-9\\n]', '_', child.attrib[\"k\"])
167166
self.tags[clean_tag] = child.attrib[\"v\"]
168167

169168
return self
@@ -302,12 +301,15 @@ class OSMParser(object):
302301
poly.setAttribValue(\"hou_id\", node.id)
303302
poly.setAttribValue(\"hou_node\", 1)
304303
for tag in node.tags:
305-
try:
304+
#try:
306305
#clean_value = re.sub('[^a-zA-Z0-9.,\\n]', '', node.tags[tag])
307-
clean_value = node.tags[tag].encode(\"utf-8\")
306+
clean_value = node.tags[tag].encode(\"utf-8\")
307+
if tag == \"name\":
308+
poly.setAttribValue(\"hou_name\", clean_value)
309+
else:
308310
poly.setAttribValue(tag, clean_value)
309-
except:
310-
print \"Could not set tag: %s with value: %s\"%(tag,clean_value)
311+
#except:
312+
# print \"Could not set tag: %s with value: %s\"%(tag,clean_value)
311313
for point in points:
312314
poly.addVertex(point)
313315

0 commit comments

Comments
 (0)