From 020f870bb76ffd7352953891ca7e2eace778d908 Mon Sep 17 00:00:00 2001 From: kunitoki Date: Tue, 18 Oct 2011 22:53:47 +0200 Subject: [PATCH] - fixed a problem in automatic sqlite wkb format determination code - other cosmetics in sqlite datasource --- plugins/input/sqlite/sqlite_datasource.cpp | 4 ++-- src/wkb.cpp | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/input/sqlite/sqlite_datasource.cpp b/plugins/input/sqlite/sqlite_datasource.cpp index a3adc62d4..88f92aee0 100644 --- a/plugins/input/sqlite/sqlite_datasource.cpp +++ b/plugins/input/sqlite/sqlite_datasource.cpp @@ -402,7 +402,7 @@ void sqlite_datasource::bind() const throw datasource_exception("Sqlite Plugin: cannot detect geometry_field, please supply the name of the geometry_field to use."); } - if (index_table_.size() == 0) + if (index_table_.empty()) { // Generate implicit index_table name - need to do this after // we have discovered meta-data or else we don't know the column name @@ -426,7 +426,7 @@ void sqlite_datasource::bind() const #endif } - if (metadata_ != "" && !extent_initialized_) + if (metadata_ != "" && ! extent_initialized_) { std::ostringstream s; s << "SELECT xmin, ymin, xmax, ymax FROM " << metadata_; diff --git a/src/wkb.cpp b/src/wkb.cpp index c332e20a8..d3c067fa0 100644 --- a/src/wkb.cpp +++ b/src/wkb.cpp @@ -71,8 +71,7 @@ public: if (size > 38 && wkb_[0] == 0x00 && (wkb_[1] == 0x00 || wkb_[1] == 0x01) - && wkb_[38] == 0x7C - && wkb_[size - 1] == 0xFE) + && wkb_[38] == 0x7C) { format_ = wkbSpatiaLite; }