- fixed a problem in automatic sqlite wkb format determination code

- other cosmetics in sqlite datasource
This commit is contained in:
kunitoki 2011-10-18 22:53:47 +02:00
parent 2372a60ff7
commit 020f870bb7
2 changed files with 3 additions and 4 deletions

View File

@ -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_;

View File

@ -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;
}