ngageoint / hootenanny

Hootenanny conflates multiple maps into a single seamless map.
GNU General Public License v3.0
352 stars 74 forks source link

Prefer using hootapidb://... to postgresql://... when addressing the services DB URL #568

Closed jasonsurratt closed 8 years ago

jasonsurratt commented 8 years ago

Please modify the HootApiDb::isSupported method and similar to expect the URL to start with hootapidb:// rather than postgresql://. postgresql:// should still be supported, but deprecated. Please print a warning if postgresql:// is used.

Similarly, the OsmApiDb should use osmapidb:// and produce a similar warning if postgresql:// is used.

Please update all tests and obvious scripts accordingly.

@mjeffe98 Could you work with @mingjiesu to get the documentation updated as well?

@brianhatchl FYI

mikejeffe commented 8 years ago

@jasonsurratt will comb through the User Guide and Algorithms guide to see where those references exist. I may have some follow up questions about the substitutions in the guides when I find the references.

jasonsurratt commented 8 years ago

Thanks. Please work in a 568 branch. You may need to create it, but please coordinate w/ @mingjiesu.

mikejeffe commented 8 years ago

@jasonsurratt looks like we have also deprecated services.db.writer.email for hootapi.db.writer.email per https://github.com/ngageoint/hootenanny/commit/416401940c2a7f2364515a77c1697f5e2fdd596b#commitcomment-16884240. Should those references also be changed in the examples in the user guide?

jasonsurratt commented 8 years ago

Yes please.

mingjiesu commented 8 years ago

@mjeffe98 Did commit to branch 568. Thanks.

mikejeffe commented 8 years ago

Having some difficulty with the osmapidb calls in the user guide referenced on page 138

original one that has been deprecated:

hoot convert -D services.db.writer.email=OsmApiInsert@hoot.local -D services.db.writer.create.user=true -D reader.add.source.datetime=false -D services.db.writer.output.id.mappings=/tmp/idmaps.xml $HOOT_HOME/test-files/ToyTestA.osm postgresql://hoot:hoottest@localhost:5432/osmapi_test

Attempting new syntax with osmapidb://:

hoot convert -D services.db.writer.email=OsmApiInsert@hoot.local -D services.db.writer.create.user=true -D reader.add.source.datetime=false -D services.db.writer.output.id.mappings=/tmp/idmaps.xml $HOOT_HOME/test-files/ToyTestA.osm osmapidb://hoot:hoottest@localhost:5432/osmapi_test

22:16:17.533 WARN  ...pp/hoot/core/util/Settings.cpp( 521) Unknown settings option: (services.db.writer.email)
22:16:17.533 WARN  ...pp/hoot/core/util/Settings.cpp( 521) Unknown settings option: (services.db.writer.create.user)
22:16:17.533 WARN  ...pp/hoot/core/util/Settings.cpp( 521) Unknown settings option: (services.db.writer.output.id.mappings)
Error running convert:
A valid writer could not be found for the URL: osmapidb://hoot:hoottest@localhost:5432/osmapi_test

I don't know what the three services.db.... parameters are supposed to be.

mingjiesu commented 8 years ago

We don't support writer for osmapi_test database, only reader. The way to insert data to osmapi_test is to run sql command "psql -h localhost -p 5432 -U hoot -d osmapi_test -f test-files/test.sql".

mingjiesu commented 8 years ago

I also saw the write command for osmapi_test in the user document, should we remove it from document?

The changes for /fouo/hoot-tests have been committed to branch 568.

mikejeffe commented 8 years ago

@mingjiesu do you have the osmapi_test data to load it into hoot for testing?

mingjiesu commented 8 years ago

I use test-files/ToyTestA.sql for test.

The command on my vm is: psql -h localhost -p 5432 -U hoot -d osmapi_test -f test-files/ToyTestA.sql

mingjiesu commented 8 years ago

hoot convert osmapidb://hoot:hoottest@localhost:5432/osmapi_test test-output/ToyTestA-out.osm

hoot convert -D convert.bounding.box=-106.5100000,38.3000000,-106.4000000,38.5000000 osmapidb://hoot:hoottest@localhost:5432/osmapi_test test-output/bboxOutput.osm

mikejeffe commented 8 years ago

@mingjiesu I pushed the changes to the User guide per https://github.com/ngageoint/hootenanny/commit/2ee703156d72f8e9b008b6dca48b1127f47f5ec1

They are still in the 568 branch since I didn't know if you wanted the code reviewed. Per section 16.1, writing to an OSM API db, I added a note stating that the capability was still in progress.

mingjiesu commented 8 years ago

@jasonsurratt @bwitham It's ready to review. https://github.com/ngageoint/hootenanny/pull/589