use of com.revolsys.record.io.format.openstreetmap.model.OsmElement in project com.revolsys.open by revolsys.
the class OsmProxyLayerRecord method getRecordProxied.
@Override
protected LayerRecord getRecordProxied() {
final Identifier identifier = getIdentifier();
final OsmElement record = this.document.getRecord(identifier);
final AbstractRecordLayer layer = getLayer();
return new ArrayLayerRecord(layer, record);
}
use of com.revolsys.record.io.format.openstreetmap.model.OsmElement in project com.revolsys.open by revolsys.
the class OsmOverpassLayer method getRecords.
@Override
public List<LayerRecord> getRecords(BoundingBox boundingBox) {
if (hasGeometryField()) {
boundingBox = convertBoundingBox(boundingBox);
if (Property.hasValue(boundingBox)) {
final Map<Identifier, LayerRecord> recordMap = new HashMap<>();
final List<BoundingBox> boundingBoxes = getTileBoundingBoxes(boundingBox);
for (final BoundingBox tileBoundingBox : boundingBoxes) {
final OsmDocument document = getTile(tileBoundingBox);
for (final OsmElement record : document.getRecords()) {
final Geometry geometry = record.getGeometry();
if (geometry != null && !geometry.isEmpty()) {
if (boundingBox.intersects(geometry.getBoundingBox())) {
final Identifier identifier = record.getIdentifier();
// final OsmProxyLayerRecord layerRecord = new
// OsmProxyLayerRecord(
// this, document, identifier);
// recordMap.put(identifier, layerRecord);
}
}
}
}
this.boundingBoxTileMap.keySet().retainAll(boundingBoxes);
return new ArrayList<>(recordMap.values());
}
}
return Collections.emptyList();
}
use of com.revolsys.record.io.format.openstreetmap.model.OsmElement in project com.revolsys.open by revolsys.
the class OpenStreetMapApiLayer method getRecords.
@Override
public List<LayerRecord> getRecords(BoundingBox boundingBox) {
if (hasGeometryField()) {
boundingBox = convertBoundingBox(boundingBox);
if (Property.hasValue(boundingBox)) {
final Map<Identifier, LayerRecord> recordMap = new HashMap<>();
final List<BoundingBox> boundingBoxes = getTileBoundingBoxes(boundingBox);
for (final BoundingBox tileBoundingBox : boundingBoxes) {
final OsmDocument document = getTile(tileBoundingBox);
for (final OsmElement record : document.getRecords()) {
final Geometry geometry = record.getGeometry();
if (geometry != null && !geometry.isEmpty()) {
if (boundingBox.intersects(geometry.getBoundingBox())) {
final Identifier identifier = record.getIdentifier();
final OsmProxyLayerRecord layerRecord = new OsmProxyLayerRecord(this, document, identifier);
recordMap.put(identifier, layerRecord);
}
}
}
}
this.boundingBoxTileMap.keySet().retainAll(boundingBoxes);
return new ArrayList<>(recordMap.values());
}
}
return Collections.emptyList();
}
Aggregations