Skip to content

Commit

Permalink
pgsnapshot: Handle case where WayNodes might already be loaded
Browse files Browse the repository at this point in the history
The WayMapper might already be loading node IDs when a Way
is retrieved, so this commit adds a check to see if the Way
already has a list of WayNodes before adding them to the Way
in WayDao.  Without this check, the WayNodes end up duplicated.
  • Loading branch information
jeffreyeriksondg committed Apr 9, 2015
1 parent 749487e commit df5a10b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ public WayDao(DatabaseContext dbCtx, ActionDao actionDao) {


private void loadFeatures(long entityId, Way entity) {
entity.getWayNodes().addAll(wayNodeDao.getAllRaw(entityId));
if ( entity.getWayNodes().size() == 0 )
{
entity.getWayNodes().addAll(wayNodeDao.getAllRaw(entityId));
}
}


Expand Down

0 comments on commit df5a10b

Please sign in to comment.