Ejemplo n.º 1
0
 /**
  * ${@inheritDoc}.
  *
  * @see
  *     org.openstreetmap.osm.data.IDataSet#containsRelation(org.openstreetmap.osmosis.core.domain.v0_5.Relation)
  */
 public boolean containsRelation(final Relation aR) {
   if (myCachingDataSet.containsRelation(aR)) return true;
   Relation n = myDataSource.getRelationByID(aR.getId());
   if (n == null) return false;
   myCachingDataSet.addRelation(n);
   return true;
 }
Ejemplo n.º 2
0
 /**
  * ${@inheritDoc}.
  *
  * @see org.openstreetmap.osm.data.IDataSet#getRelationByID(long)
  */
 public Relation getRelationByID(final long aRelationID) {
   Relation n = myCachingDataSet.getRelationByID(aRelationID);
   if (n == null) {
     n = myDataSource.getRelationByID(aRelationID);
     if (n != null) myCachingDataSet.addRelation(n);
   }
   return n;
 }
Ejemplo n.º 3
0
 /**
  * ${@inheritDoc}.
  *
  * @see
  *     org.openstreetmap.osm.data.IDataSet#getRelations(org.openstreetmap.osm.data.coordinates.Bounds)
  */
 public Iterator<Relation> getRelations(final Bounds aBoundingBox) {
   Iterator<Relation> n = myCachingDataSet.getRelations(aBoundingBox);
   if (n == null || !n.hasNext()) {
     n = myDataSource.getRelations(aBoundingBox);
     if (n != null && n.hasNext()) {
       LinkedList<Relation> nodes = new LinkedList<Relation>();
       while (n.hasNext()) {
         Relation node = n.next();
         nodes.add(node);
         myCachingDataSet.addRelation(node);
         return nodes.iterator();
       }
     }
   }
   return n;
 }
Ejemplo n.º 4
0
 /**
  * ${@inheritDoc}.
  *
  * @see
  *     org.openstreetmap.osm.data.IDataSet#addRelation(org.openstreetmap.osmosis.core.domain.v0_5.Relation)
  */
 public void addRelation(final Relation aR) {
   myCachingDataSet.addRelation(aR);
   myDataSource.addRelation(aR);
 }