Skip to content

Commit

Permalink
Add 'polygons' support into merge analysers
Browse files Browse the repository at this point in the history
  • Loading branch information
frodrigo committed Jul 14, 2024
1 parent ada7c8a commit 5692392
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions analysers/Analyser_Merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ class Select:
def __init__(self, types = [], tags = {}):
"""
On witch OSM we try to join data set.
@param types: object types, array of "relations", "ways" and "nodes"
@param types: object types, array of "relations", "ways", "nodes" and "polygons"
@param tags: dict of tags or array of dicts, array mean "OR"
"""
self.types = types
Expand Down Expand Up @@ -1273,12 +1273,12 @@ def analyser_version(self):
return SourceVersion.version(self.parser.source.time(), self.__class__)

def typeGeom(self):
typeSelect = {'N': 'geom', 'W': 'linestring', 'R': 'relation_locate(id)'}
typeGeom = {'N': 'geom', 'W': 'linestring', 'R': 'relation_locate(id)'}
typeSelect = {'N': 'geom', 'W': 'linestring', 'R': 'relation_locate(id)', 'P': 'poly'}
typeGeom = {'N': 'geom', 'W': 'linestring', 'R': 'relation_locate(id)', 'P': 'poly'}
if self.conflate.osmRef == "NULL" or self.possible_merge:
typeShape = {'N': 'geom', 'W': 'linestring', 'R': 'relation_shape(id)'}
typeShape = {'N': 'geom', 'W': 'linestring', 'R': 'relation_shape(id)', 'P': 'poly'}
else:
typeShape = {'N': 'NULL', 'W': 'NULL', 'R': 'NULL'}
typeShape = {'N': 'NULL', 'W': 'NULL', 'R': 'NULL', 'P': 'NULL'}
return [typeSelect, typeGeom, typeShape]

def analyser_osmosis_common(self):
Expand All @@ -1293,9 +1293,9 @@ def analyser_osmosis_common(self):
if self.parser.imported_srid():
typeSelect, typeGeom, typeShape = self.typeGeom()
else:
typeSelect = {'N': 'NULL', 'W': 'NULL', 'R': 'NULL'}
typeGeom = {'N': 'NULL', 'W': 'NULL', 'R': 'NULL'}
typeShape = {'N': 'NULL', 'W': 'NULL', 'R': 'NULL'}
typeSelect = {'N': 'NULL', 'W': 'NULL', 'R': 'NULL', 'P': 'NULL'}
typeGeom = {'N': 'NULL', 'W': 'NULL', 'R': 'NULL', 'P': 'NULL'}
typeShape = {'N': 'NULL', 'W': 'NULL', 'R': 'NULL', 'P': 'NULL'}

self.logger.log(u"Retrieve OSM item")
where = Select.where_tags(self.conflate.select.tags)
Expand Down Expand Up @@ -1431,12 +1431,12 @@ def init(self, url, name, parser, load = Load_XY(), conflate = Conflate()):
self.update_official = None

def typeGeom(self):
typeSelect = {'N': 'geom', 'W': 'linestring', 'R': 'relation_locate(id)'}
typeGeom = {'N': 'geom', 'W': 'way_locate(linestring)', 'R': 'relation_locate(id)'}
typeSelect = {'N': 'geom', 'W': 'linestring', 'R': 'relation_locate(id)', 'P': 'poly'}
typeGeom = {'N': 'geom', 'W': 'way_locate(linestring)', 'R': 'relation_locate(id)', 'P': 'poly'}
if self.conflate.osmRef == "NULL" or self.possible_merge:
typeShape = {'N': 'geom', 'W': 'ST_Envelope(linestring)', 'R': 'relation_shape(id)'}
typeShape = {'N': 'geom', 'W': 'ST_Envelope(linestring)', 'R': 'relation_shape(id)', 'P': 'poly'}
else:
typeShape = {'N': 'NULL', 'W': 'NULL', 'R': 'NULL'}
typeShape = {'N': 'NULL', 'W': 'NULL', 'R': 'NULL', 'P': 'NULL'}
return [typeSelect, typeGeom, typeShape]

def analyser_osmosis_common(self):
Expand Down

0 comments on commit 5692392

Please sign in to comment.