Changeset 51c2a4c in osmose-backend


Ignore:
Timestamp:
Nov 14, 2012 10:07:40 PM (5 years ago)
Author:
Frédéric Rodrigo <frodrigo@…>
Branches:
master
Children:
1a3a1b4, 69541c2
Parents:
b239baf
Message:

Add support for moved geodesie node

Location:
analysers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • analysers/Analyser_Merge.py

    rb239baf r51c2a4c  
    230230""" 
    231231 
     232sql50 = """ 
     233SELECT 
     234    osm_item.id, 
     235    ST_AsText(osm_item.geom), 
     236    ST_AsText(official.geom) 
     237FROM 
     238    official 
     239    JOIN osm_item ON 
     240        official.ref = osm_item.ref AND 
     241        NOT official.geom && osm_item.geom 
     242""" 
     243 
    232244class Analyser_Merge(Analyser_Osmosis): 
    233245 
     
    251263        else: 
    252264            self.possible_merge = None 
     265        if hasattr(self, 'moved_official'): 
     266            self.classs[self.moved_official["class"]] = self.moved_official 
     267        else: 
     268            self.moved_official = None 
    253269        self.osmRef = "NULL" 
    254270        self.sourceRef = "NULL" 
     
    357373                "text": self.text(defaultdict(lambda:None,res[3]), defaultdict(lambda:None,res[4])), 
    358374                "fix": self.mergeTags(res[5], res[3]), 
     375            } ) 
     376 
     377        # Moved official 
     378        if self.moved_official: 
     379            self.run(sql50, lambda res: { 
     380                "class": self.moved_official["class"], 
     381                "data": [self.node_full, self.positionAsText], 
    359382            } ) 
    360383 
  • analysers/analyser_merge_geodesie.py

    rfeccd33 r51c2a4c  
    3737    def __init__(self, config, logger = None): 
    3838        self.missing_official = {"item":"8070", "class": 1, "level": 3, "tag": ["merge"], "desc":{"fr":"Repère géodésique manquant"} } 
     39        self.moved_official = {"item":"8070", "class": 3, "level": 3, "tag": ["merge"], "desc":{"fr":"Repère géodésique déplacé"} } 
    3940        Analyser_Merge.__init__(self, config, logger) 
    4041        self.officialURL = "http://geodesie.ign.fr" 
Note: See TracChangeset for help on using the changeset viewer.