Changeset bbb961d in osmose-backend


Ignore:
Timestamp:
Sep 11, 2014 12:55:21 AM (5 years ago)
Author:
Nelson A. de Oliveira <naoliv@…>
Branches:
master
Children:
a910761
Parents:
42b39a1
Message:

Remove old references to osm2pgsql

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • README

    r73fd14d rbbb961d  
    88  - downloaded file is converted to .osm, with bunzip2 or osmconvert 
    99  - if necessary, an osmosis dump is generated in a local database 
    10   - if necessary, an osm2pgsql dump is generated in a local database 
    1110  - analyses are run directly on .osm file, or on the database 
    1211  - analyses are stored on a local webserver, and a link is sent to the 
     
    2423  python-psycopg2 > 2.4 
    2524  python-shapely >= 1.2 
    26   postgresql-9.1           # for osmosis and osm2pgsql database dumps 
     25  postgresql-9.1           # for osmosis database dumps 
    2726  postgresql-9.1-postgis 
    2827  postgresql-contrib-9.1 
    2928  openjdk-6-jre-headless   # for osmosis 
    3029 
    31 osm2pgsql is compiled in osm2pgsql/ for Debian amd64 lenny and squeeze. 
    3230osmosis is installed in osmosis/osmosis-0.41/. 
    3331osmconvert is installed in osmconvert/. 
     
    4644  - dir_work is where extracts are stored, and results generated. 
    4745  - url_frontend_update is the url used to send results generated by analyses 
    48   - bin_osm2pgsql should be changed if on 32-bit machine or not on Debian 
    4946 
    5047 
  • modules/config.py

    rc64755f rbbb961d  
    3535url_frontend_update = "http://osmose.openstreetmap.fr/cgi-bin/update.py" 
    3636 
    37 # binary used by osm2pgsql analyses 
    38 bin_osm2pgsql = dir_osmose + "/osm2pgsql/osm2pgsql-squeeze" 
    39  
    4037 
    4138### no need to modify following variables ### 
  • osmose_config.py

    r8a47053 rbbb961d  
    6464    dir_tmp        = config.dir_tmp 
    6565    dir_scripts    = config.dir_osmose 
    66     dir_osm2pgsql  = dir_scripts + "/osm2pgsql" 
    67     bin_osm2pgsql  = config.bin_osm2pgsql 
    6866    osmosis_bin    = dir_scripts + "/osmosis/osmosis-0.41/bin/osmosis" 
    6967    osmosis_pre_scripts = [ 
  • osmose_run.py

    r9862e1a rbbb961d  
    132132def init_database(conf, logger): 
    133133 
    134     # import posgis 
    135     if "osm2pgsql" in conf.download: 
    136         logger.log(logger.log_av_r+"import postgis : "+conf.download["osm2pgsql"]+logger.log_ap) 
    137         cmd = [conf.bin_osm2pgsql] 
    138         cmd.append('--slim') 
    139         cmd.append('--style=%s'%os.path.join(conf.dir_osm2pgsql,'default.style')) 
    140         cmd.append('--merc') 
    141         cmd.append('--database=%s'%conf.db_base) 
    142         cmd.append('--username=%s'%conf.db_user) 
    143         cmd.append('--prefix='+conf.download["osm2pgsql"]) 
    144         cmd.append(conf.download["dst"]) 
    145         logger.execute_err(cmd) 
    146  
    147134    # import osmosis 
    148135    if "osmosis" in conf.download: 
     
    223210def clean_database(conf, logger, no_clean): 
    224211 
    225     if set(("osm2pgsql", "osmosis")).isdisjoint(conf.download.keys()): 
    226        return 
    227  
    228     gisconn = psycopg2.connect(conf.db_string) 
    229     giscurs = gisconn.cursor() 
    230  
    231     if "osm2pgsql" in conf.download: 
    232         if no_clean: 
    233             pass 
    234         else: 
    235             for t_suffix in ("_line", "_nodes", "_point", "_polygon", "_rels", "_roads", "_ways"): 
    236                 t = conf.download["osm2pgsql"] + t_suffix 
    237                 logger.sub().log("DROP TABLE %s" % t) 
    238                 giscurs.execute("DROP TABLE %s;"%t) 
    239212 
    240213    if "osmosis" in conf.download: 
     214        gisconn = psycopg2.connect(conf.db_string) 
     215        giscurs = gisconn.cursor() 
     216 
    241217        if no_clean: 
    242218            # grant read-only access to everybody 
     
    257233            giscurs.execute(sql) 
    258234 
    259     gisconn.commit() 
    260     giscurs.close() 
    261     gisconn.close() 
     235        gisconn.commit() 
     236        giscurs.close() 
     237        gisconn.close() 
    262238 
    263239########################################################################### 
  • setup_bdd.sh

    rbd537d0 rbbb961d  
    44sudo -u postgres psql -d osmose -f /usr/share/postgresql-8.3-postgis/spatial_ref_sys.sql 
    55 
    6 #wget -o /dev/null -O - http://svn.openstreetmap.org/applications/utils/export/osm2pgsql/900913.sql | sudo -u postgres psql -d osmose 
    7  
    86cat <<EOF | sudo -u postgres psql -d osmose 
    97INSERT INTO spatial_ref_sys (srid, auth_name, auth_srid, srtext, proj4text)VALUES (900913,'EPSG',900913,'PROJCS["WGS84 / Simple Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS_1984", 6378137.0, 298.257223563]],PRIMEM["Greenwich", 0.0],UNIT["degree", 0.017453292519943295],AXIS["Longitude", EAST],AXIS["Latitude", NORTH]],PROJECTION["Mercator_1SP_Google"],PARAMETER["latitude_of_origin", 0.0],PARAMETER["central_meridian", 0.0],PARAMETER["scale_factor", 1.0],PARAMETER["false_easting", 0.0],PARAMETER["false_northing", 0.0],UNIT["m", 1.0],AXIS["x", EAST],AXIS["y", NORTH],AUTHORITY["EPSG","900913"]]','+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs'); 
Note: See TracChangeset for help on using the changeset viewer.