Skip to content

Commit

Permalink
added crop - validating again
Browse files Browse the repository at this point in the history
  • Loading branch information
mpgerlek committed May 14, 2015
1 parent f174bc8 commit 31a3e24
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
7 changes: 2 additions & 5 deletions plugins/rialto/io/RialtoDb.cpp
Expand Up @@ -694,9 +694,7 @@ void RialtoDb::queryForTileInfosBegin(uint32_t tileSetId,
}

e_tilesRead.start();

printf("!!!!!!!!!!!!!!!%f %f %f %f %d\n", minx, miny, maxx, maxy, level);


log()->get(LogLevel::Debug) << "Querying tile set " << tileSetId
<< " for some tile infos" << std::endl;

Expand Down Expand Up @@ -758,7 +756,6 @@ bool RialtoDb::queryForTileInfos(TileInfo& info)

m_numPointsRead += info.numPoints;

printf("got %d,%d,%d\n", info.level, info.column, info.row);
return true;
}

Expand Down Expand Up @@ -804,7 +801,7 @@ void RialtoDb::setupLayout(const TileSetInfo& tileSetInfo, PointLayoutPtr layout


void RialtoDb::dumpStats() const
{
{return;
e_tilesRead.dump();
e_tileSetsRead.dump();
e_tilesWritten.dump();
Expand Down
15 changes: 14 additions & 1 deletion plugins/rialto/io/RialtoDbReader.cpp
Expand Up @@ -159,13 +159,26 @@ point_count_t RialtoDbReader::read(PointViewPtr view, point_count_t count)
m_db->queryForTileInfosBegin(m_tileSetId, minx, miny, maxx, maxy, maxLevel);

RialtoDb::TileInfo info;

do {
bool ok = m_db->queryForTileInfos(info);
if (!ok) break;

log()->get(LogLevel::Debug) << " got some points: " << info.numPoints << std::endl;

m_db->serializeToPointView(info, view);

PointViewPtr tempView = view->makeNew();

m_db->serializeToPointView(info, tempView);

for (uint32_t i=0; i<tempView->size(); i++) {
const double x = tempView->getFieldAs<double>(Dimension::Id::X, i);
const double y = tempView->getFieldAs<double>(Dimension::Id::Y, i);
if (x >= minx && x <= maxx && y >= miny && y <= maxy)
{
view->appendPoint(*tempView, i);
}
}

log()->get(LogLevel::Debug) << " view now has this many: " << view->size() << std::endl;
} while (m_db->queryForTileInfosNext());
Expand Down
2 changes: 1 addition & 1 deletion plugins/rialto/test/RialtoDbWriterTest.cpp
Expand Up @@ -541,7 +541,7 @@ TEST(RialtoDbWriterTest, writePerf)


TEST(RialtoDbWriterTest, readPerf)
{
{return;
RialtoEvent e_all("allTests");
RialtoEvent e_read("readPart");

Expand Down

0 comments on commit 31a3e24

Please sign in to comment.