Changeset c69f93c6 in osmose-backend


Ignore:
Timestamp:
Oct 17, 2012 9:37:05 PM (6 years ago)
Author:
Jocelyn Jaubert <jocelyn.jaubert@…>
Branches:
master
Children:
205a2fe
Parents:
6748e43 (diff), 9eb33f1 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge remote-tracking branch 'frodrigo/master'

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • Analyser_Merge.py

    rbc151e7 r48a9867  
    136136        official.ref = osm_item.ref 
    137137WHERE 
    138     osm_item.ref IS NULL OR 
     138    osm_item.ref IS NULL AND 
    139139    official.ref IS NULL 
    140 ; 
    141 CREATE INDEX missing_osm_index_geom ON missing_osm USING GIST(geom); 
    142140""" 
    143141 
    144142sql21 = """ 
    145 SELECT * FROM missing_osm; 
     143CREATE INDEX missing_osm_index_geom ON missing_osm USING GIST(geom) 
     144""" 
     145 
     146sql22 = """ 
     147SELECT * FROM missing_osm 
     148""" 
     149 
     150sql23 = """ 
     151SELECT 
     152    osm_item.id, 
     153    osm_item.type, 
     154    ST_AsText(osm_item.geom), 
     155    osm_item.tags, 
     156    osm_item.geom::geography 
     157FROM 
     158    osm_item 
     159    LEFT JOIN official ON 
     160        official.ref = osm_item.ref 
     161WHERE 
     162    osm_item.ref IS NOT NULL AND 
     163    official.ref IS NULL 
    146164""" 
    147165 
     
    311329            return # Job done, can't do more in geo mode 
    312330 
    313         # Missing OSM 
    314331        self.run(sql20) 
     332        self.run(sql21) 
    315333        typeMapping = {'n': self.node_full, 'w': self.way_full, 'r': self.relation_full} 
    316334        if self.missing_osm: 
    317             self.run(sql21, lambda res: { 
     335            # Missing OSM 
     336            self.run(sql22, lambda res: { 
     337                "class": self.missing_osm["class"], 
     338                "data": [typeMapping[res[1]], None, self.positionAsText] 
     339            } ) 
     340            # Invalid OSM 
     341            self.run(sql23, lambda res: { 
    318342                "class": self.missing_osm["class"], 
    319343                "data": [typeMapping[res[1]], None, self.positionAsText] 
  • analyser_merge_tmc_point_fr.py

    rca3f390 r9eb33f1  
    2525 
    2626class _Analyser_Merge_TMC_Point_Fr(Analyser_Merge): 
    27     def __init__(self, config, logger, level, desc, osmTags, osmTypes, c, tcd, stcd): 
     27    def __init__(self, config, logger, level, desc, osmTags, osmTypes, c, tcd, stcd, threshold): 
    2828        self.missing_official = {"item":"7110", "class": tcd*100+stcd, "level": level, "tag": ["merge", "highway"], "desc":desc} 
    2929        Analyser_Merge.__init__(self, config, logger) 
     
    3939        self.sourceSRID = "4326" 
    4040        self.sourceWhere = lambda res: res["class"] == c and res["tcd"] == str(tcd) and res["stcd"] == str(stcd) 
    41         self.conflationDistance = 100 
     41        self.conflationDistance = threshold 
    4242 
    4343 
     
    4949            {"highway": None, "bridge": None}, 
    5050            ["ways"], 
    51             "P", 3, 1) 
     51            "P", 3, 1, 
     52            500) 
    5253 
    5354class Analyser_Merge_TMC_Point_Rest_Area_Fr(_Analyser_Merge_TMC_Point_Fr): 
     
    5859            {"highway": "rest_area"}, 
    5960            ["nodes", "ways"], 
    60             "P", 3, 4) 
     61            "P", 3, 4, 
     62            300) 
    6163 
    6264class Analyser_Merge_TMC_Point_Roundabout_Fr(_Analyser_Merge_TMC_Point_Fr): 
     
    6769            {"highway": None, "junction": "roundabout"}, 
    6870            ["ways"], 
    69             "P", 1, 8) 
     71            "P", 1, 8, 
     72            150) 
    7073 
    7174class Analyser_Merge_TMC_Point_Services_Fr(_Analyser_Merge_TMC_Point_Fr): 
     
    7679            {"highway": "services"}, 
    7780            ["nodes", "ways"], 
    78             "P", 3, 3) 
     81            "P", 3, 3, 
     82            300) 
    7983 
    8084class Analyser_Merge_TMC_Point_Toll_Booth_Fr(_Analyser_Merge_TMC_Point_Fr): 
     
    8589            {"barrier": "toll_booth"}, 
    8690            ["nodes", "ways"], 
    87             "P", 3, 16) 
    88  
     91            "P", 3, 16, 
     92            500) 
    8993 
    9094class Analyser_Merge_TMC_Point_Traffic_Signals_Fr(_Analyser_Merge_TMC_Point_Fr): 
     
    9599            {"highway": "traffic_signals"}, 
    96100            ["nodes"], 
    97             "P", 1, 10) 
    98  
     101            "P", 1, 10, 
     102            100) 
    99103 
    100104class Analyser_Merge_TMC_Point_Tunnel_Fr(_Analyser_Merge_TMC_Point_Fr): 
     
    105109            {"highway": None, "tunnel": None}, 
    106110            ["ways"], 
    107             "P", 3, 1) 
     111            "P", 3, 1, 
     112            500) 
  • analyser_osmosis_roundabout_level.py

    r10719bf ra9cc721  
    133133SELECT 
    134134    junction.id AS junction_id, 
    135     ST_AsText(ST_Centroid(ST_Intersection(w1.linestring, w2.linestring))) -- Centroid because can be any geom 
     135    way_locate(junction.linestring) 
    136136FROM 
    137137    ways AS junction 
     
    139139        junction.linestring && w1.linestring AND 
    140140        w1.tags?'highway' AND 
     141        w1.tags->'highway' IN ('trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'residential', 'unclasified', 'road') AND 
    141142        w1.id != junction.id 
    142143    JOIN ways AS w2 ON 
    143144        junction.linestring && w2.linestring AND 
    144145        w2.tags?'highway' AND 
     146        w2.tags->'highway' IN ('trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'residential', 'unclasified', 'road') AND 
    145147        w2.id != junction.id 
    146148WHERE 
     149    junction.tags->'highway' IN ('trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'residential', 'unclasified', 'road') AND 
    147150    array_length(junction.nodes, 1) > 3 AND 
    148151    junction.nodes[1] = junction.nodes[array_length(junction.nodes, 1)] AND 
  • plugins/TagFix_MultipleTag_fr.py

    r3df2d14 r8985ed0  
    5959                    err.append((3032, 1, {"fr": u"\"name=%s\" est la localisation mais pas le nom" % (tags["name"])})) 
    6060        else: 
    61             if self.Marche.match(tags["name"]): 
     61            if "shop" not in tags and self.Marche.match(tags["name"]): 
    6262                err.append((3032, 5, {"fix": {"amenity": "marketplace"}})) 
    6363 
  • analyser_osmosis_building_shapes.py

    r74cf95b r6748e43  
    3838    ST_Area(ST_MakePolygon(ST_Transform(linestring,2154)))/ST_Area(ST_MinimumBoundingCircle(ST_Transform(linestring,2154))) > 0.95 AND 
    3939    ST_MaxDistance(ST_Transform(linestring,2154), ST_Transform(linestring,2154)) > 5 AND 
    40     array_length(akeys(delete(delete(delete(delete(delete(tags, 'created_by'), 'source'), 'name'), 'building', 'note:qadastre'))), 1) IS NULL 
     40    array_length(akeys(delete(delete(delete(delete(delete(tags, 'created_by'), 'source'), 'name'), 'building'), 'note:qadastre')), 1) IS NULL 
    4141""" 
    4242 
     
    5353    is_polygon AND 
    5454    ST_MaxDistance(ST_Transform(linestring,2154), ST_Transform(linestring,2154)) > 300 AND 
    55     array_length(akeys(delete(delete(delete(delete(delete(tags, 'created_by'), 'source'), 'name'), 'building', 'note:qadastre'))), 1) IS NULL 
     55    array_length(akeys(delete(delete(delete(delete(delete(tags, 'created_by'), 'source'), 'name'), 'building'), 'note:qadastre')), 1) IS NULL 
    5656""" 
    5757 
Note: See TracChangeset for help on using the changeset viewer.