Changeset e4210d3 in osmose-backend


Ignore:
Timestamp:
Jun 12, 2013 12:11:32 AM (6 years ago)
Author:
Frédéric Rodrigo <frodrigo@…>
Branches:
master
Children:
a910761
Parents:
b3c5ebe
Message:

Rebase railway station analyser on new data

Files:
1 added
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • analysers/analyser_merge_railstation_fr.py

    rdf43dfa re4210d3  
    2828 
    2929    create_table = """ 
    30         uic VARCHAR(254) PRIMARY KEY, 
    31         nom VARCHAR(254), 
    32         adresse VARCHAR(254), 
    33         type VARCHAR(254), 
    34         region VARCHAR(254), 
    35         lat NUMERIC(10,7), 
    36         lon NUMERIC(10,7) 
     30        stop_id VARCHAR(254) PRIMARY KEY, 
     31        stop_name VARCHAR(254), 
     32        stop_desc VARCHAR(254), 
     33        stop_lat VARCHAR(254), 
     34        stop_lon VARCHAR(254), 
     35        zone_id VARCHAR(254), 
     36        stop_url VARCHAR(254), 
     37        location_type VARCHAR(254), 
     38        parent_station VARCHAR(254) 
    3739    """ 
    3840 
    3941    def __init__(self, config, logger = None): 
    40         self.missing_official = {"item":"8050", "class": 1, "level": 3, "tag": ["merge", "railway"], "desc":{"fr":u"Gare RFN non intégrée"} } 
     42        self.missing_official = {"item":"8050", "class": 1, "level": 3, "tag": ["merge", "railway"], "desc":{"fr":u"Gare non intégrée"} } 
    4143        self.missing_osm      = {"item":"7100", "class": 2, "level": 3, "tag": ["merge", "railway"], "desc":{"fr": u"Gare sans uic_ref ou invalide"} } 
    42         self.possible_merge   = {"item":"8051", "class": 3, "level": 3, "tag": ["merge", "railway"], "desc":{"fr":u"Gare RFN, proposition d'intégration"} } 
     44        self.possible_merge   = {"item":"8051", "class": 3, "level": 3, "tag": ["merge", "railway"], "desc":{"fr":u"Gare, proposition d'intégration"} } 
    4345        Analyser_Merge.__init__(self, config, logger) 
    44         self.officialURL = "http://www.data.gouv.fr/donnees/view/Liste-des-gares-de-voyageurs-du-RFN-avec-coordonn%C3%A9es-30383099" 
    45         self.officialName = "Liste des gares de voyageurs du RFN" 
    46         self.csv_file = "merge_data/liste_gares_ferroviaires_DRR2012_23-11-2011.csv" 
    47         self.csv_format = "WITH DELIMITER AS ';' NULL AS '' CSV HEADER" 
    48         self.csv_encoding = "ISO-8859-15" 
    49         decsep = re.compile("([0-9]),([0-9])") 
    50         self.csv_filter = lambda t: decsep.sub("\\1.\\2", t) 
     46        self.officialURL = "http://test.data-sncf.com/index.php/ter.html" 
     47        self.officialName = "Horaires prévus des trains TER" 
     48        self.csv_file = "merge_data/Horaires prévus des trains TER-stops.csv" 
     49        self.csv_format = "WITH DELIMITER AS ',' NULL AS '' CSV HEADER" 
    5150        self.osmTags = { 
    5251            "railway": ["station", "halt"], 
     
    5554        self.osmTypes = ["nodes", "ways"] 
    5655        self.sourceTable = "railstation_fr" 
    57         self.sourceX = "lon" 
    58         self.sourceY = "lat" 
    59         self.sourceSRID = "4326" 
     56        self.sourceX = "stop_lon" 
     57        self.sourceY = "stop_lat" 
    6058        self.defaultTag = { 
    6159            "railway": "station", 
    62             "source": "data.gouv.fr:RFF - 12/2011" 
     60            "source": "SNCF - 06/2013" 
    6361        } 
    6462        self.defaultTagMapping = { 
    65             "uic_ref": "uic", 
    66             "name": "nom", 
     63            "uic_ref": lambda res: res["stop_id"].split(":")[1][3:].split("-")[-1][:-1], 
     64            "name": "stop_name", 
    6765        } 
    6866        self.conflationDistance = 500 
    69         self.text = lambda tags, fields: {"fr": u"Gare de %s %s" % (fields["nom"], fields["adresse"])} 
     67        self.text = lambda tags, fields: {"fr": fields["stop_name"]} 
Note: See TracChangeset for help on using the changeset viewer.