This allows for an OGR-compatible PostgreSQL connection string, such as "PG:dbname=pdx_bldgs user=emma host=localhost" to be given in place of a source file path. It also adds a --sql option to query the data prior to export. This is particularly useful for exporting a single table from a complex database, via something like “SELECT * FROM buildings” Closes #20
Do not call os.path.realpath() on input filename to preserve slashes in e.g. /vsicurl/ input strings. Divide OGR virtual file systems to three classes: Access methods: Filenames are passed unmodified to OGR. File methods: Existence of file is checked before passing the name to OGR. Unsupported methods: These do not make sense for input, emit an error.
This is to make them accessible to translation functions.
…ng ID from files.
I.e. file names starting with /vsicurl/ and/or /vsizip/, /vsigzip/ and /vsitar/.
While there is only one example of replacejwithi being called, it is clear that the arguments are meant to be type Geometry, not (Geometry, role) tuple. So when replacing j with i, preserve the existing role.
This fixes #17 but may require some modification of translations which rely on the spaces being there. For example, a translation which did a check like if attrs['foo'] == ' bar ': will now need to do it as if attrs['foo'] == 'bar': Checks of this type were unreliable anyways as they relied on the spaces which only happened with some file formats. One backwards compatible way to do the check that works is if attrs['foo'].strip() == 'bar': This has the additional cost of calling strip() twice
This change allows for the use of loading a submodule translation, e.g. ogr2osm.py -t foo.bar where translations/foo/bar.py exists. A fromlist is required to have __import__ return the module given by -t instead of the toplevel module (e.g. foo). Additional init code to be called by all submodules of foo can be placed in translations/foo/__init__.py