import subprocess
import shutil
-from ..typing import StrPath
from ..db.connection import get_pg_env
from ..errors import UsageError
from ..version import OSM2PGSQL_REQUIRED_VERSION
LOG = logging.getLogger()
-def run_php_server(server_address: str, base_dir: StrPath) -> None:
- """ Run the built-in server from the given directory.
- """
- subprocess.run(['/usr/bin/env', 'php', '-S', server_address],
- cwd=str(base_dir), check=True)
-
def run_osm2pgsql(options: Mapping[str, Any]) -> None:
""" Run osm2pgsql with the given options.
'--number-processes', '1' if options['append'] else str(options['threads']),
'--cache', str(options['osm2pgsql_cache']),
'--style', str(options['osm2pgsql_style'])
- ]
+ ]
if str(options['osm2pgsql_style']).endswith('.lua'):
env['LUA_PATH'] = ';'.join((str(options['osm2pgsql_style_path'] / '?.lua'),
cmd.extend(('--output', 'gazetteer', '--hstore', '--latlon'))
cmd.extend(_mk_tablespace_options('main', options))
-
if options['flatnode_file']:
cmd.extend(('--flat-nodes', options['flatnode_file']))