Changeset 77146f0 in osmose-backend


Ignore:
Timestamp:
Jun 6, 2014 12:13:07 PM (5 years ago)
Author:
Frédéric Rodrigo <fred.rodrigo@…>
Branches:
master
Children:
d53a9cf
Parents:
c291e64
git-author:
Frédéric Rodrigo <fred.rodrigo@…> (29/05/2014 11:42:40)
git-committer:
Frédéric Rodrigo <fred.rodrigo@…> (06/06/2014 12:13:07)
Message:

Factorise convertion from comma separator in decimal on merge analysers

Location:
analysers
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • analysers/Analyser_Merge.py

    rc291e64 r77146f0  
    285285        self.defaultTagMapping = {} 
    286286        self.text = lambda tags, fields: {} 
     287 
     288    def float_comma(self, val): 
     289        return float(val.replace(',', '.')) 
    287290 
    288291    def lastUpdate(self): 
  • analysers/analyser_merge_bicycle_parking_FR_bordeaux.py

    r01de44b r77146f0  
    2222 
    2323from Analyser_Merge import Analyser_Merge 
    24 import re 
    2524 
    2625 
     
    3332        self.csv_file = "bicycle_parking_FR_bordeaux.csv.bz2" 
    3433        self.csv_separator = ";" 
    35         decsep = re.compile("([0-9]),([0-9])") 
    36         self.csv_filter = lambda t: decsep.sub("\\1.\\2", t) 
    3734        self.csv_select = { 
    3835            "REALISATION": u"Réalisé", 
     
    4542        self.sourceTable = "bordeaux_bicycle_parking" 
    4643        self.sourceX = "X_LONG" 
     44        self.sourceXfunction = self.float_comma 
    4745        self.sourceY = "Y_LAT" 
     46        self.sourceYfunction = self.float_comma 
    4847        self.sourceSRID = "4326" 
    4948        self.defaultTag = { 
  • analysers/analyser_merge_bicycle_parking_FR_capp.py

    r01de44b r77146f0  
    2222 
    2323from Analyser_Merge import Analyser_Merge 
    24 import re 
    2524 
    2625 
     
    3231        self.officialName = u"Supports vélos sur la CAPP" 
    3332        self.csv_file = "bicycle_parking_FR_capp.csv.bz2" 
    34         decsep = re.compile("([0-9]),([0-9])") 
    35         self.csv_filter = lambda t: decsep.sub("\\1.\\2", t) 
    3633        self.osmTags = { 
    3734            "amenity": "bicycle_parking", 
     
    4037        self.sourceTable = "capp_bicycle_parking" 
    4138        self.sourceX = "X" 
     39        self.sourceXfunction = self.float_comma 
    4240        self.sourceY = "Y" 
     41        self.sourceYfunction = self.float_comma 
    4342        self.sourceSRID = "4326" 
    4443        self.defaultTag = { 
  • analysers/analyser_merge_bicycle_rental_FR_capp.py

    r01de44b r77146f0  
    2222 
    2323from Analyser_Merge import Analyser_Merge 
    24 import re 
    2524 
    2625 
     
    3231        self.officialName = u"Stations Idécycle du réseau Idelis sur la CAPP" 
    3332        self.csv_file = "bicycle_rental_FR_capp.csv.bz2" 
    34         decsep = re.compile("([0-9]),([0-9])") 
    35         self.csv_filter = lambda t: decsep.sub("\\1.\\2", t) 
    3633        self.osmTags = { 
    3734            "amenity": "bicycle_rental", 
     
    4037        self.sourceTable = "capp_bicycle_rental" 
    4138        self.sourceX = "X" 
     39        self.sourceXfunction = self.float_comma 
    4240        self.sourceY = "Y" 
     41        self.sourceYfunction = self.float_comma 
    4342        self.sourceSRID = "4326" 
    4443        self.defaultTag = { 
  • analysers/analyser_merge_college_FR.py

    rc291e64 r77146f0  
    2121########################################################################### 
    2222 
    23 import re 
    2423from Analyser_Merge import Analyser_Merge 
    2524 
     
    3231        self.officialName = u"Etablissements d'enseignement supérieur" 
    3332        self.csv_file = "college_FR.csv.bz2" 
    34         decsep = re.compile("([0-9]),([0-9])") 
    35         self.csv_filter = lambda t: decsep.sub("\\1.\\2", t) 
    3633        self.osmTags = { 
    3734            "amenity": ["college", "university"], 
     
    4037        self.sourceTable = "college_fr" 
    4138        self.sourceX = "GPS_Y" 
     39        self.sourceXfunction = self.float_comma 
    4240        self.sourceY = "GPS_X" 
     41        self.sourceYfunction = self.float_comma 
    4342        self.sourceSRID = "4326" 
    4443        self.defaultTag = { 
  • analysers/analyser_merge_parking_FR_capp.py

    r01de44b r77146f0  
    2222 
    2323from Analyser_Merge import Analyser_Merge 
    24 import re 
    2524 
    2625 
     
    3332        self.csv_file = "parking_FR_capp.csv.bz2" 
    3433        self.csv_encoding = "ISO-8859-15" 
    35         decsep = re.compile("([0-9]),([0-9])") 
    36         self.csv_filter = lambda t: decsep.sub("\\1.\\2", t) 
    3734        self.osmTags = { 
    3835            "amenity": "parking", 
     
    4138        self.sourceTable = "capp_parking" 
    4239        self.sourceX = "X" 
     40        self.sourceXfunction = self.float_comma 
    4341        self.sourceY = "Y" 
     42        self.sourceYfunction = self.float_comma 
    4443        self.sourceSRID = "4326" 
    4544        self.defaultTag = { 
     
    6564        self.csv_file = "parking_FR_capp_disabled.csv.bz2" 
    6665        self.csv_encoding = "ISO-8859-15" 
    67         decsep = re.compile("(\"-?[0-9]+),([0-9]+\")") 
    68         self.csv_filter = lambda t: decsep.sub("\\1.\\2", t) 
    6966        self.csv_select = { 
    7067            "Types": "Stationnement Handi" 
     
    7774        self.sourceTable = "capp_parking_disabled" 
    7875        self.sourceX = "X" 
     76        self.sourceXfunction = self.float_comma 
    7977        self.sourceY = "Y" 
     78        self.sourceYfunction = self.float_comma 
    8079        self.sourceSRID = "4326" 
    8180        self.defaultTag = { 
  • analysers/analyser_merge_public_equipment_FR_bordeaux_toilets.py

    r01de44b r77146f0  
    2222 
    2323from Analyser_Merge import Analyser_Merge 
    24 import re 
    2524 
    2625 
     
    3332        self.csv_file = "public_equipment_FR_bordeaux_toilets.csv.bz2" 
    3433        self.csv_separator = ";" 
    35         decsep = re.compile("([0-9]),([0-9])") 
    36         self.csv_filter = lambda t: decsep.sub("\\1.\\2", t) 
    3734        self.osmTags = { 
    3835            "amenity": "toilets", 
     
    4138        self.sourceTable = "bordeaux_toilets" 
    4239        self.sourceX = "X_LONG" 
     40        self.sourceXfunction = self.float_comma 
    4341        self.sourceY = "Y_LAT" 
     42        self.sourceYfunction = self.float_comma 
    4443        self.sourceSRID = "4326" 
    4544        self.defaultTag = { 
  • analysers/analyser_merge_railway_level_crossing_FR.py

    rc291e64 r77146f0  
    2121########################################################################### 
    2222 
    23 import re 
    2423from Analyser_Merge import Analyser_Merge 
    2524 
     
    3433        self.csv_separator = ";" 
    3534        self.csv_encoding = "ISO-8859-15" 
    36         decsep = re.compile("([0-9]),([0-9])") 
    37         self.csv_filter = lambda t: decsep.sub("\\1.\\2", t) 
    3835        self.osmTags = { 
    3936            "railway": ["level_crossing", "crossing"], 
     
    4340        self.sourceWhere = lambda res: res["TYPE"] != 'PN de classe 00' 
    4441        self.sourceX = "LONGITUDE (WGS84)" 
     42        self.sourceXfunction = self.float_comma 
    4543        self.sourceY = "LATITUDE (WGS84)" 
     44        self.sourceYfunction = self.float_comma 
    4645        self.sourceSRID = "4326" 
    4746        self.defaultTag = { 
  • analysers/analyser_merge_recycling_FR_capp_clothes.py

    r01de44b r77146f0  
    2222 
    2323from Analyser_Merge import Analyser_Merge 
    24 import re 
    2524 
    2625 
     
    3332        self.csv_file = "recycling_FR_capp_clothes.csv.bz2" 
    3433        self.csv_encoding = "ISO-8859-15" 
    35         decsep = re.compile("([0-9]),([0-9])") 
    36         self.csv_filter = lambda t: decsep.sub("\\1.\\2", t) 
    3734        self.csv_select = { 
    3835            "USAGE_": "En service" 
     
    4441        self.sourceTable = "capp_recycling_clothes" 
    4542        self.sourceX = "X" 
     43        self.sourceXfunction = self.float_comma 
    4644        self.sourceY = "Y" 
     45        self.sourceYfunction = self.float_comma 
    4746        self.sourceSRID = "4326" 
    4847        self.defaultTag = { 
  • analysers/analyser_merge_recycling_FR_capp_glass.py

    r01de44b r77146f0  
    2222 
    2323from Analyser_Merge import Analyser_Merge 
    24 import re 
    2524 
    2625 
     
    3332        self.csv_file = "recycling_FR_capp_glass.csv.bz2" 
    3433        self.csv_encoding = "ISO-8859-15" 
    35         decsep = re.compile("([0-9]),([0-9])") 
    36         self.csv_filter = lambda t: decsep.sub("\\1.\\2", t) 
    3734        self.csv_select = { 
    3835            "USAGE_": "En service" 
     
    4441        self.sourceTable = "capp_recycling_glass" 
    4542        self.sourceX = "X" 
     43        self.sourceXfunction = self.float_comma 
    4644        self.sourceY = "Y" 
     45        self.sourceYfunction = self.float_comma 
    4746        self.sourceSRID = "4326" 
    4847        self.defaultTag = { 
  • analysers/analyser_merge_street_number.py

    r01de44b r77146f0  
    2121########################################################################### 
    2222 
    23 import re 
    2423from Analyser_Merge import Analyser_Merge 
    2524 
     
    4544        self.csv_file = "address_france_toulouse.csv.bz2" 
    4645        self.csv_separator = ";" 
    47         decsep = re.compile("([0-9]),([0-9])") 
    48         self.csv_filter = lambda t: decsep.sub("\\1.\\2", t) 
    4946        self.sourceTable = "street_number_toulouse" 
    5047        self.sourceX = "X_WGS84" 
     48        self.sourceXfunction = self.float_comma 
    5149        self.sourceY = "Y_WGS84" 
     50        self.sourceYfunction = self.float_comma 
    5251        self.sourceSRID = "4326" 
    5352        self.defaultTag = { 
     
    171170        self.csv_separator = ";" 
    172171        self.csv_encoding = "ISO-8859-15" 
    173         decsep = re.compile("([0-9]),([0-9])") 
    174         self.csv_filter = lambda t: decsep.sub("\\1.\\2", t) 
    175172        self.sourceTable = "street_number_rennes" 
    176173        self.sourceX = "X_WGS84" 
     174        self.sourceXfunction = self.float_comma 
    177175        self.sourceY = "Y_WGS84" 
     176        self.sourceYfunction = self.float_comma 
    178177        self.sourceSRID = "4326" 
    179178        self.defaultTag = { 
Note: See TracChangeset for help on using the changeset viewer.