Changeset 2107ee4 in osmose-backend


Ignore:
Timestamp:
Jan 9, 2015 9:02:25 PM (5 years ago)
Author:
Jocelyn Jaubert <jocelyn.jaubert@…>
Branches:
master
Children:
48039b2
Parents:
5fc827c (diff), 065080d (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'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • osmose_config.py

    r5fc827c r065080d  
    160160                 download_repo=GEOFABRIK, download_country=None): 
    161161 
    162         template_config.__init__(self, country, polygon_id, analyser_options, download_repo) 
    163162        if not download_country: 
    164163            download_country = country 
     164        country = country.replace("-", "_").replace("/", "_") 
     165        template_config.__init__(self, country, polygon_id, analyser_options, download_repo) 
    165166        self.download = { 
    166167            "url": self.download_repo + part + "/" + download_country + "-latest.osm.pbf", 
     
    219220 
    220221class default_country_fr(default_country): 
    221     def __init__(self, part, country, polygon_id=None, proj=None, analyser_options=None, 
     222    def __init__(self, part, country, polygon_id=None, proj=None, analyser_options={}, 
    222223                 download_repo=GEOFABRIK, download_country=None): 
    223224 
    224         if not analyser_options: 
    225             analyser_options = {} 
    226         analyser_options.update({"country": "FR", "language": "fr", "proj": proj, "addr:city-admin_level": "8,9"}) 
     225        analyser_options = dict({"country": "FR", "language": "fr", "proj": proj, "addr:city-admin_level": "8,9"}, **analyser_options) 
    227226        default_country.__init__(self, part, country, polygon_id, analyser_options, 
    228227                                        download_repo, download_country) 
    229228 
    230229class france_region(default_country_fr): 
    231     def __init__(self, part, region, polygon_id=None, proj=2154, analyser_options=None, 
     230    def __init__(self, region, polygon_id=None, proj=2154, analyser_options={}, 
    232231                 download_repo=GEOFABRIK, download_country=None): 
    233232 
    234         country = "france_" + region.replace("-", "_") 
    235         default_country_fr.__init__(self, part, country, polygon_id, proj, analyser_options, 
     233        default_country_fr.__init__(self, "europe", "france/" + region, polygon_id, proj, analyser_options, 
    236234                                    download_repo, download_country) 
    237         self.download["url"]  = self.download_repo + part + "/" + region + "-latest.osm.pbf" 
    238         self.download["poly"] = self.download_repo.replace("/extracts/", "/polygons/") + part + "/" + region + ".poly" 
    239         self.download["diff"] = self.download_repo + part + "/" + region + "-updates/" 
    240235        self.analyser["osmosis_geodesie"] = "xxx" 
    241236        self.analyser["osmosis_natural_swimming-pool"] = "xxx" 
    242237        self.analyser["osmosis_fantoir"] = "xxx" 
    243238 
    244 france_region("europe/france", "alsace", 8636) 
    245 france_region("europe/france", "aquitaine", 8637) 
    246 france_region("europe/france", "auvergne", 8638) 
    247 france_region("europe/france", "basse-normandie", 8646) 
    248 france_region("europe/france", "bourgogne", 27768) 
    249 france_region("europe/france", "bretagne", 102740) 
    250 france_region("europe/france", "centre", 8640) 
    251 france_region("europe/france", "champagne-ardenne", 8641) 
    252 france_region("europe/france", "corse", 76910) 
    253 france_region("europe/france", "franche-comte", 8642) 
    254 france_region("europe/france", "haute-normandie", 8656) 
    255 france_region("europe/france", "ile-de-france", 8649) 
    256 france_region("europe/france", "languedoc-roussillon", 8643) 
    257 france_region("europe/france", "limousin", 8644) 
    258 france_region("europe/france", "lorraine", 8645) 
    259 france_region("europe/france", "midi-pyrenees", 8647) 
    260 france_region("europe/france", "nord-pas-de-calais", 8648) 
    261 france_region("europe/france", "pays-de-la-loire", 8650) 
    262 france_region("europe/france", "picardie", 8651) 
    263 france_region("europe/france", "poitou-charentes", 8652) 
    264 france_region("europe/france", "provence-alpes-cote-d-azur", 8654) 
    265 france_region("europe/france", "rhone-alpes", 8655) 
    266 france_region("europe/france", "guadeloupe", 1401835, 32620) 
    267 france_region("europe/france", "guyane", 1260551, 2972) 
    268 france_region("europe/france", "martinique", 1891495, 32620) 
    269 france_region("europe/france", "mayotte", 1259885, 32738) 
    270 france_region("europe/france", "reunion", 1785276, 2975) 
     239france_region("alsace", 8636) 
     240france_region("aquitaine", 8637) 
     241france_region("auvergne", 8638) 
     242france_region("basse-normandie", 8646) 
     243france_region("bourgogne", 27768) 
     244france_region("bretagne", 102740) 
     245france_region("centre", 8640) 
     246france_region("champagne-ardenne", 8641) 
     247france_region("corse", 76910) 
     248france_region("franche-comte", 8642) 
     249france_region("haute-normandie", 8656) 
     250france_region("ile-de-france", 8649) 
     251france_region("languedoc-roussillon", 8643) 
     252france_region("limousin", 8644) 
     253france_region("lorraine", 8645) 
     254france_region("midi-pyrenees", 8647) 
     255france_region("nord-pas-de-calais", 8648) 
     256france_region("pays-de-la-loire", 8650) 
     257france_region("picardie", 8651) 
     258france_region("poitou-charentes", 8652) 
     259france_region("provence-alpes-cote-d-azur", 8654) 
     260france_region("rhone-alpes", 8655) 
     261france_region("guadeloupe", 1401835, 32620) 
     262france_region("guyane", 1260551, 2972) 
     263france_region("martinique", 1891495, 32620) 
     264france_region("mayotte", 1259885, 32738) 
     265france_region("reunion", 1785276, 2975) 
    271266 
    272267default_country_fr("central-america", "france_saintbarthelemy", 537967, 
     
    343338default_country("europe", "azores",  1629146, {"country": "PT", "language": "pt", "proj": 32627}, download_repo=GEOFABRIK) 
    344339#default_country("europe", "belgium", 52411, {"country": "BE", "language": "fr", "proj": 32631}) 
    345 default_country("europe", "belgium_brussels_capital_region", 54094, {"country": "BE", "proj": 32631}, 
    346                 download_repo=OSMFR, download_country="belgium/brussels_capital_region") 
    347 default_country("europe", "belgium_flanders", 53134, {"country": "BE", "language": "nl", "proj": 32631}, 
    348                 download_repo=OSMFR, download_country="belgium/flanders") 
    349 default_country("europe", "belgium_wallonia_french_community", 2620920, {"country": "BE", "language": "fr", "proj": 32631}, 
    350                 download_repo=OSMFR, download_country="belgium/wallonia_french_community") 
    351 default_country("europe", "belgium_wallonia_german_community", 2425209, {"country": "BE", "language": "de", "proj": 32631}, 
    352                 download_repo=OSMFR, download_country="belgium/wallonia_german_community") 
    353 default_country("europe", "bosnia_herzegovina", 2528142, {"country": "BA", "proj": 32633}, download_repo=GEOFABRIK, download_country="bosnia-herzegovina") 
     340default_country("europe", "belgium/brussels_capital_region", 54094, {"country": "BE", "proj": 32631}, download_repo=OSMFR) 
     341default_country("europe", "belgium/flanders", 53134, {"country": "BE", "language": "nl", "proj": 32631}, download_repo=OSMFR) 
     342default_country("europe", "belgium/wallonia_french_community", 2620920, {"country": "BE", "language": "fr", "proj": 32631}, download_repo=OSMFR) 
     343default_country("europe", "belgium/wallonia_german_community", 2425209, {"country": "BE", "language": "de", "proj": 32631}, download_repo=OSMFR) 
     344default_country("europe", "bosnia-herzegovina", 2528142, {"country": "BA", "proj": 32633}, download_repo=GEOFABRIK) 
    354345default_country("europe", "bulgaria", 186382, {"country": "BG", "language": "bg", "proj": 32635}, download_repo=GEOFABRIK) 
    355346default_country("europe", "croatia", 214885, {"country": "HR", "language": "hr", "proj": 32633}, download_repo=GEOFABRIK) 
    356347default_country("europe", "estonia", 79510, {"country": "EE", "language": "et", "proj": 32634}, download_repo=GEOFABRIK) 
    357348default_country("europe", "cyprus", 307787, {"country": "CY", "driving_side": "left", "proj": 32636}) 
    358 default_country("europe", "faroe_islands", 52939, {"country": "FO", "language": "fo", "proj": 2169}, 
    359                 download_country="faroe-islands") 
     349default_country("europe", "faroe-islands", 52939, {"country": "FO", "language": "fo", "proj": 2169}) 
    360350default_country("europe", "greece",  192307, {"country": "GR", "language": "el","proj": 32635}, download_repo=GEOFABRIK) 
    361351default_country("europe", "hungary", 21335, {"country": "HU", "language": "hu", "proj": 32633}, download_repo=GEOFABRIK) 
    362 default_country("europe", "isle_of_man", 62269, {"country": "IM", "language": "en", "driving_side": "left", "proj": 32630}) 
     352default_country("europe", "isle-of-man", 62269, {"country": "IM", "language": "en", "driving_side": "left", "proj": 32630}) 
    363353default_country("europe", "kosovo", 2088990, {"country": "XK", "proj": 32634}) 
    364354default_country("europe", "liechtenstein", 1155955, {"country": "LI", "language": "de", "proj": 32632}) 
     
    416406                download_country="us/hawaii") 
    417407 
    418 quebec = default_country("north-america", "canada_quebec", 61549, {"country": "QC","language": "fr", "proj": 2138}, 
    419                           download_repo=OSMFR, download_country="canada/quebec") 
     408quebec = default_country("north-america", "canada/quebec", 61549, {"country": "QC","language": "fr", "proj": 2138}, download_repo=OSMFR) 
    420409quebec.download["diff"] = "http://download.openstreetmap.fr/replication/north-america/canada/quebec/minute/" 
    421410quebec.db_base = "osmose_canada_quebec" 
     
    444433default_country("africa", "ghana", 192781,    {"country": "GH", "language": "en", "proj": 32630}, download_repo=OSMFR) 
    445434default_country("africa", "guinea", 192778,   {"country": "GN", "language": "fr", "proj": 32628}, download_repo=OSMFR) 
    446 default_country("africa", "guinea_bissau", 192776, {"country": "GW", "language": "pt", "proj": 32628}, download_country="guinea-bissau") 
     435default_country("africa", "guinea-bissau", 192776, {"country": "GW", "language": "pt", "proj": 32628}) 
    447436default_country("africa", "ivory_coast", 192779, {"country": "CI", "language": "fr", "proj": 32630}, download_repo=OSMFR) 
    448437default_country_simple("africa", "kenya", 192798,    {"country": "KE", "driving_side": "left", "proj": 32737}, download_repo=OSMFR) 
     
    464453default_country_simple("africa", "senegal", 192775,  {"country": "SN", "proj": 32628}, download_repo=OSMFR) 
    465454default_country_simple("africa", "seychelles", 536765, {"country": "SC", "driving_side": "left", "proj": 32739}, download_repo=OSMFR) 
    466 default_country("africa", "sierra_leone", 192777, {"country": "SL", "language": "en", "proj": 32629}) 
     455default_country("africa", "sierra-leone", 192777, {"country": "SL", "language": "en", "proj": 32629}) 
    467456default_country("africa", "somalia", 192799,  {"country": "SO", "language": "so", "proj": 32638}) 
    468457default_country_simple("africa", "south_africa", 87565, {"country": "ZA", "driving_side": "left", "proj": 32735}, download_repo=OSMFR) 
     
    503492default_country_simple("asia", "philippines", 2850940, {"country": "PH", "language": "en", "proj": 32651}, download_repo=GEOFABRIK) 
    504493default_country_simple("asia", "singapore", 536780 , {"country": "SG", "driving_side": "left", "proj": 32648}, download_repo=OSMFR) 
    505 default_country_simple("asia", "sri_lanka", 536807, {"country": "LK", "driving_side": "left", "proj": 32644}, 
    506                        download_country="sri-lanka") 
     494default_country_simple("asia", "sri-lanka", 536807, {"country": "LK", "driving_side": "left", "proj": 32644}) 
    507495default_country_simple("asia", "syria", 184840, {"country": "SY", "language": "ar", "proj": 32637}) 
    508496default_country_simple("asia", "tajikistan", 214626, {"country": "TJ", "language": "tg", "proj": 32642}) 
     
    533521######################################################################### 
    534522 
    535 default_country("australia-oceania", "new_zealand", 556706, 
    536                 {"country": "NZ", "language": "en", "proj": 32759, "driving_side": "left"}, 
    537                 download_country="new-zealand") 
     523default_country("australia-oceania", "new-zealand", 556706, {"country": "NZ", "language": "en", "proj": 32759, "driving_side": "left"}) 
    538524 
    539525######################################################################### 
     
    555541######################################################################### 
    556542 
    557 class default_country_it(default_country): 
    558     def __init__(self, part, country, polygon_id=None, proj=None, analyser_options={}, 
     543class it_region(default_country): 
     544    def __init__(self, region, polygon_id=None, proj=23032, analyser_options={}, 
    559545                 download_repo=FMACH, download_country=None): 
    560546 
    561         _analyser_options = {"country": "IT", "language": "it", "proj": proj} 
    562         _analyser_options.update(analyser_options) 
    563         default_country.__init__(self, part, country, polygon_id, _analyser_options, 
    564                                         download_repo, download_country) 
    565  
    566  
    567 class italy_region(default_country_it): 
    568     def __init__(self, part, region, polygon_id=None, proj=23032, analyser_options={}, 
    569                  download_repo=FMACH, download_country=None): 
    570  
    571         country = "italy_" + region.replace("-", "_") 
    572         default_country_it.__init__(self, part, country, polygon_id, proj, analyser_options, 
     547        part = "gfoss_geodata/osm/output_osm_regioni/" 
     548        analyser_options = dict({"country": "IT", "language": "it", "proj": proj}, **analyser_options) 
     549        default_country.__init__(self, part, "italy/" + region, polygon_id, analyser_options, 
    573550                                    download_repo, download_country) 
    574551 
     
    577554 
    578555# FMACH 
    579 italy_region("gfoss_geodata/osm/output_osm_regioni/", "abruzzo", 53937) 
    580 italy_region("gfoss_geodata/osm/output_osm_regioni/", "basilicata", 40137) 
    581 italy_region("gfoss_geodata/osm/output_osm_regioni/", "calabria", 1783980) 
    582 italy_region("gfoss_geodata/osm/output_osm_regioni/", "campania", 40218) 
    583 italy_region("gfoss_geodata/osm/output_osm_regioni/", "emilia-romagna", 42611) 
    584 italy_region("gfoss_geodata/osm/output_osm_regioni/", "friuli-venezia-giulia", 179296) 
    585 italy_region("gfoss_geodata/osm/output_osm_regioni/", "lazio", 40784) 
    586 italy_region("gfoss_geodata/osm/output_osm_regioni/", "liguria", 301482) 
    587 italy_region("gfoss_geodata/osm/output_osm_regioni/", "lombardia", 44879) 
    588 italy_region("gfoss_geodata/osm/output_osm_regioni/", "marche", 53060) 
    589 italy_region("gfoss_geodata/osm/output_osm_regioni/", "molise", 41256) 
    590 italy_region("gfoss_geodata/osm/output_osm_regioni/", "piemonte", 44874) 
    591 italy_region("gfoss_geodata/osm/output_osm_regioni/", "puglia", 40095) 
    592 italy_region("gfoss_geodata/osm/output_osm_regioni/", "sardegna", 279816) 
    593 italy_region("gfoss_geodata/osm/output_osm_regioni/", "sicilia", 39152) 
    594 italy_region("gfoss_geodata/osm/output_osm_regioni/", "toscana", 41977) 
    595 italy_region("gfoss_geodata/osm/output_osm_regioni/", "trentino-alto-adige", 45757, analyser_options={"language": ["it","de"]}) 
    596 italy_region("gfoss_geodata/osm/output_osm_regioni/", "umbria", 42004) 
    597 italy_region("gfoss_geodata/osm/output_osm_regioni/", "valle-aosta", 2905554) 
    598 italy_region("gfoss_geodata/osm/output_osm_regioni/", "veneto", 43648) 
     556it_region("abruzzo", 53937) 
     557it_region("basilicata", 40137) 
     558it_region("calabria", 1783980) 
     559it_region("campania", 40218) 
     560it_region("emilia-romagna", 42611) 
     561it_region("friuli-venezia-giulia", 179296) 
     562it_region("lazio", 40784) 
     563it_region("liguria", 301482) 
     564it_region("lombardia", 44879) 
     565it_region("marche", 53060) 
     566it_region("molise", 41256) 
     567it_region("piemonte", 44874) 
     568it_region("puglia", 40095) 
     569it_region("sardegna", 279816) 
     570it_region("sicilia", 39152) 
     571it_region("toscana", 41977) 
     572it_region("trentino-alto-adige", 45757, analyser_options={"language": ["it","de"]}) 
     573it_region("umbria", 42004) 
     574it_region("valle-aosta", 2905554) 
     575it_region("veneto", 43648) 
    599576 
    600577######################################################################### 
     
    605582 
    606583        download_country = province.replace("-", "_") 
    607         country = "netherlands_" + province.replace("-", "_") 
    608         _analyser_options = {"country": "NL", "language": "nl", "proj": proj} 
    609         _analyser_options.update(analyser_options) 
    610         default_country.__init__(self, part, country, polygon_id, _analyser_options, 
     584        country = "netherlands_" + province 
     585        analyser_options = dict({"country": "NL", "language": "nl", "proj": proj}, **analyser_options) 
     586        default_country.__init__(self, part, country, polygon_id, analyser_options, 
    611587                                    download_repo, download_country) 
    612588        del(self.analyser["osmosis_mini_farm"]) # Landuse are really too detailed in Netherlands to use this analyser 
     
    633609 
    634610class cz_kraj(default_country): 
    635     def __init__(self, kraj, polygon_id=None, proj=32633, analyser_options=None, 
     611    def __init__(self, kraj, polygon_id=None, proj=32633, analyser_options={}, 
    636612                 download_repo=OSMFR, download_country=None): 
    637613 
    638         part = "europe" 
    639         download_country = "czech_republic/" + kraj.replace("-", "_") 
    640         country = "czech_republic_" + kraj.replace("-", "_") 
    641         if not analyser_options: 
    642             analyser_options = {} 
    643         analyser_options.update({"country": "CZ", "language": "cs", "proj": proj}) 
    644         default_country.__init__(self, part, country, polygon_id, analyser_options, 
     614        analyser_options = dict({"country": "CZ", "language": "cs", "proj": proj}, **analyser_options) 
     615        default_country.__init__(self, "europe", "czech_republic/" + kraj, polygon_id, analyser_options, 
    645616                                    download_repo, download_country) 
    646617 
     
    663634 
    664635class pl_province(default_country): 
    665     def __init__(self, province, polygon_id=None, proj=32634, analyser_options=None, 
     636    def __init__(self, province, polygon_id=None, proj=32634, analyser_options={}, 
    666637                 download_repo=OSMFR, download_country=None): 
    667638 
    668         part = "europe" 
    669         download_country = "poland/" + province.replace("-", "_") 
    670         country = "poland_" + province.replace("-", "_") 
    671         if not analyser_options: 
    672             analyser_options = {} 
    673         analyser_options.update({"country": "PL", "language": "pl", "proj": proj}) 
    674         default_country.__init__(self, part, country, polygon_id, analyser_options, 
     639        analyser_options = dict({"country": "PL", "language": "pl", "proj": proj}, **analyser_options) 
     640        default_country.__init__(self, "europe", "poland/" + province, polygon_id, analyser_options, 
    675641                                    download_repo, download_country) 
    676642 
    677643pl_province("dolnoslaskie", 224457) 
    678 pl_province("kujawsko-pomorskie", 223407) 
     644pl_province("kujawsko_pomorskie", 223407) 
    679645pl_province("lubelskie", 130919) 
    680646pl_province("lubuskie", 130969) 
     
    688654pl_province("slaskie", 224462) 
    689655pl_province("swietokrzyskie", 130914) 
    690 pl_province("warminsko-mazurskie", 223408) 
     656pl_province("warminsko_mazurskie", 223408) 
    691657pl_province("wielkopolskie", 130971) 
    692658pl_province("zachodniopomorskie", 104401) 
     
    695661 
    696662class de_state(default_country): 
    697     def __init__(self, province, polygon_id=None, proj=32632, analyser_options=None, 
     663    def __init__(self, province, polygon_id=None, proj=32632, analyser_options={}, 
    698664                 download_repo=GEOFABRIK, download_country=None): 
    699665 
    700         part = "europe" 
    701         download_country = "germany/" + province 
    702         country = "germany_" + province.replace("-", "_") 
    703         if not analyser_options: 
    704             analyser_options = {} 
    705         analyser_options.update({"country": "DE", "language": "de", "proj": proj}) 
    706         default_country.__init__(self, part, country, polygon_id, analyser_options, 
     666        analyser_options = dict({"country": "DE", "language": "de", "proj": proj}, **analyser_options) 
     667        default_country.__init__(self, "europe", "germany/" + province, polygon_id, analyser_options, 
    707668                                    download_repo, download_country) 
    708669 
Note: See TracChangeset for help on using the changeset viewer.