pnorman / ogr2osm

pnorman's version of UVM's Rewrite of ogr2osm
Other
78 stars 46 forks source link

Support PostgreSQL connections for source data #29

Closed reidab closed 9 years ago

reidab commented 9 years ago

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

pnorman commented 9 years ago

Any testsuite changes needed for this?

reidab commented 9 years ago

It should probably get test updates, yes. I'd originally looked in the testifies directory thought it to be all example files, but I now see that the .t file is used by cram. I'll try to familiarize myself with it and see if I can't add some coverage for the new argument parsing.

I'm not sure how to handle testing of the actual database interactions without bootstrapping a postgresql server as part of the test process. If you'd like to see this tested and have ideas about how to handle it, please let me know.

pnorman commented 9 years ago

I'm okay without testing DB interactions for now, but I think the usage text change will require minor changes to all the tests

reidab commented 9 years ago

Okay, those last two commits should cover all the usage changes, as well as the new errors added for invalid DB-related arguments.

grant-humphries commented 9 years ago

Are there any plans to merge this pull request into master? Was looking forward to being able to utilize this functionality

grant-humphries commented 9 years ago

Works like a charm, thanks to both of you!