use of com.baremaps.osm.geometry.ProjectionTransformer in project baremaps by baremaps.
the class DiffService method call.
@Override
public List<Tile> call() throws Exception {
logger.info("Importing changes");
Header header = headerRepository.selectLatest();
String replicationUrl = header.getReplicationUrl();
Long sequenceNumber = header.getReplicationSequenceNumber() + 1;
URI changeUri = resolve(replicationUrl, sequenceNumber, "osc.gz");
Blob blob = blobStore.get(changeUri);
ProgressLogger progressLogger = new ProgressLogger(blob.getContentLength(), 5000);
ProjectionTransformer projectionTransformer = new ProjectionTransformer(srid, 4326);
try (InputStream changesInputStream = new GZIPInputStream(new InputStreamProgress(blob.getInputStream(), progressLogger))) {
return new OsmChangeParser().changes(changesInputStream).flatMap(this::geometriesForChange).map(projectionTransformer::transform).flatMap(this::tilesForGeometry).distinct().collect(Collectors.toList());
}
}
Aggregations