- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.openstreetmap.osmosis.xml.v0_6.XmlChangeReader
类的一些代码示例,展示了XmlChangeReader
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlChangeReader
类的具体详情如下:
包路径:org.openstreetmap.osmosis.xml.v0_6.XmlChangeReader
类名称:XmlChangeReader
[英]A change source reading from an xml file. The entire contents of the file are read.
[中]从xml文件读取的更改源。将读取文件的全部内容。
代码示例来源:origin: org.openstreetmap.osmosis/osmosis-replication
@Override
public XmlChangeReader getData(long sequence) {
File changeFile = sequenceFormatter.getFormattedName(sequence, ".osc.gz");
return new XmlChangeReader(changeFile, false, CompressionMethod.GZip);
}
代码示例来源:origin: openstreetmap/osmosis
private void writeChangeset(XmlChangeReader xmlReader) {
final ChangeSink localChangeSink = changeSink;
xmlReader.setChangeSink(new ChangeSink() {
private ChangeSink suppressedWriter = localChangeSink;
@Override
public void initialize(Map<String, Object> metaData) {
// Suppress the call.
}
@Override
public void process(ChangeContainer change) {
suppressedWriter.process(change);
}
@Override
public void complete() {
// Suppress the call.
}
@Override
public void close() {
// Suppress the call.
}
});
xmlReader.run();
}
代码示例来源:origin: openstreetmap/osmosis
/**
* Tests non-acceptance of nodes in a non-delete change with lat/lon attribute not set.
*
* @throws Exception if something goes wrong.
*/
@Test(expected = OsmosisRuntimeException.class)
public void testNonDeleteLatLonNotSet() throws Exception {
File inputFile = dataUtils.createDataFile("v0_6/xml-create-no-coordinates.osc");
XmlChangeReader reader = new XmlChangeReader(inputFile, false, CompressionMethod.None);
reader.setChangeSink(new NullChangeWriter());
reader.run();
}
代码示例来源:origin: org.openstreetmap.osmosis/osmosis-replication
changeReader = new XmlChangeReader(
tmpFile,
true,
changeReader.setChangeSink(changeMerger.getChangeSink(1));
代码示例来源:origin: openstreetmap/osmosis
/**
* Tests acceptance of nodes in a delete change with lat/lon attribute not set.
*
* @throws Exception if something goes wrong.
*/
@Test
public void testDeleteLatLonNotSet() throws Exception {
XmlChangeReader xmlReader;
XmlChangeWriter xmlWriter;
File inputFile;
File outputFile;
inputFile = dataUtils.createDataFile("v0_6/xml-delete-no-coordinates.osc");
outputFile = dataUtils.newFile();
// Create and connect the xml tasks.
xmlReader = new XmlChangeReader(inputFile, true, CompressionMethod.None);
xmlWriter = new XmlChangeWriter(outputFile, CompressionMethod.None);
xmlReader.setChangeSink(xmlWriter);
// Process the xml.
xmlReader.run();
// Validate that the output file matches the input file.
dataUtils.compareFiles(inputFile, outputFile);
}
代码示例来源:origin: openstreetmap/osmosis
changeReader = new XmlChangeReader(
tmpFile,
true,
changeReader.setChangeSink(changeMerger.getChangeSink(1));
代码示例来源:origin: openstreetmap/osmosis
/**
* A basic test reading and writing an osm file testing both reader and
* writer tasks.
*
* @throws IOException
* if any file operations fail.
*/
@Test
public void testSimple() throws IOException {
XmlChangeReader xmlReader;
XmlChangeWriter xmlWriter;
File inputFile;
File outputFile;
inputFile = dataUtils.createDataFile("v0_6/xml-task-tests-v0_6.osc");
outputFile = dataUtils.newFile();
// Create and connect the xml tasks.
xmlReader = new XmlChangeReader(inputFile, true, CompressionMethod.None);
xmlWriter = new XmlChangeWriter(outputFile, CompressionMethod.None);
xmlReader.setChangeSink(xmlWriter);
// Process the xml.
xmlReader.run();
// Validate that the output file matches the input file.
dataUtils.compareFiles(inputFile, outputFile);
}
代码示例来源:origin: org.locationtech.geogig/geogig-osm
timeoutUnit);
XmlChangeReader reader = new XmlChangeReader(file, true, resolveCompressionMethod(file));
reader.setChangeSink(sink);
代码示例来源:origin: openstreetmap/osmosis
@Override
public XmlChangeReader getData(long sequence) {
File changeFile = sequenceFormatter.getFormattedName(sequence, ".osc.gz");
return new XmlChangeReader(changeFile, false, CompressionMethod.GZip);
}
代码示例来源:origin: openstreetmap/osmosis
/**
* {@inheritDoc}
*/
@Override
protected void processChangeset(XmlChangeReader xmlReader, ReplicationState replicationState) {
final ChangeSink localChangeSink = changeSorter;
xmlReader.setChangeSink(new ChangeSink() {
private ChangeSink suppressedChangeSink = localChangeSink;
@Override
public void initialize(Map<String, Object> metaData) {
// Suppress the call.
}
@Override
public void process(ChangeContainer change) {
suppressedChangeSink.process(change);
}
@Override
public void complete() {
// Suppress the call.
}
@Override
public void close() {
// Suppress the call.
} });
xmlReader.run();
}
代码示例来源:origin: openstreetmap/osmosis
private void processReplicationFile(File replicationFile, ReplicationState replicationState) {
try {
XmlChangeReader xmlReader;
// Send the contents of the replication file to the sink but suppress the complete
// and release methods.
xmlReader = new XmlChangeReader(replicationFile, true, CompressionMethod.GZip);
// Delegate to the sub-class to process the xml.
processChangeset(xmlReader, replicationState);
} finally {
if (!replicationFile.delete()) {
LOG.warning("Unable to delete file " + replicationFile.getName());
}
}
}
代码示例来源:origin: org.openstreetmap.osmosis/osmosis-replication
private void writeChangeset(XmlChangeReader xmlReader) {
final ChangeSink localChangeSink = changeSink;
xmlReader.setChangeSink(new ChangeSink() {
private ChangeSink suppressedWriter = localChangeSink;
@Override
public void initialize(Map<String, Object> metaData) {
// Suppress the call.
}
@Override
public void process(ChangeContainer change) {
suppressedWriter.process(change);
}
@Override
public void complete() {
// Suppress the call.
}
@Override
public void close() {
// Suppress the call.
}
});
xmlReader.run();
}
代码示例来源:origin: org.openstreetmap.osmosis/osmosis-replication
private void processReplicationFile(File replicationFile, ReplicationState replicationState) {
try {
XmlChangeReader xmlReader;
// Send the contents of the replication file to the sink but suppress the complete
// and release methods.
xmlReader = new XmlChangeReader(replicationFile, true, CompressionMethod.GZip);
// Delegate to the sub-class to process the xml.
processChangeset(xmlReader, replicationState);
} finally {
if (!replicationFile.delete()) {
LOG.warning("Unable to delete file " + replicationFile.getName());
}
}
}
代码示例来源:origin: org.openstreetmap.osmosis/osmosis-replication
/**
* {@inheritDoc}
*/
@Override
protected void processChangeset(XmlChangeReader xmlReader, ReplicationState replicationState) {
final ChangeSink localChangeSink = changeSorter;
xmlReader.setChangeSink(new ChangeSink() {
private ChangeSink suppressedChangeSink = localChangeSink;
@Override
public void initialize(Map<String, Object> metaData) {
// Suppress the call.
}
@Override
public void process(ChangeContainer change) {
suppressedChangeSink.process(change);
}
@Override
public void complete() {
// Suppress the call.
}
@Override
public void close() {
// Suppress the call.
} });
xmlReader.run();
}
代码示例来源:origin: openstreetmap/osmosis
private void sendReplicationData(File chunkFile) {
// Release all class level resources and prepare for passing the
// replication data downstream.
replicationState = null;
replicationStateReceived = false;
sinkInitInvoked = false;
// Send the replication data downstream but don't call any lifecycle
// methods on the change sink because we're managing those separately.
if (chunkFile != null) {
RunnableChangeSource changeReader = new XmlChangeReader(chunkFile, true, CompressionMethod.GZip);
changeReader.setChangeSink(noLifecycleChangeSink);
changeReader.run();
}
changeSink.complete();
}
代码示例来源:origin: openstreetmap/osmosis
/**
* {@inheritDoc}
*/
@Override
protected TaskManager createTaskManagerImpl(TaskConfiguration taskConfig) {
String fileName;
File file;
boolean enableDateParsing;
CompressionMethod compressionMethod;
XmlChangeReader task;
// Get the task arguments.
fileName = getStringArgument(
taskConfig,
ARG_FILE_NAME,
getDefaultStringArgument(taskConfig, DEFAULT_FILE_NAME)
);
enableDateParsing = getBooleanArgument(taskConfig, ARG_ENABLE_DATE_PARSING, DEFAULT_ENABLE_DATE_PARSING);
compressionMethod = getCompressionMethodArgument(taskConfig, fileName);
// Create a file object from the file name provided.
file = new File(fileName);
// Build the task object.
task = new XmlChangeReader(file, enableDateParsing, compressionMethod);
return new RunnableChangeSourceManager(taskConfig.getId(), task, taskConfig.getPipeArgs());
}
}
代码示例来源:origin: org.openstreetmap.osmosis/osmosis-xml
/**
* {@inheritDoc}
*/
@Override
protected TaskManager createTaskManagerImpl(TaskConfiguration taskConfig) {
String fileName;
File file;
boolean enableDateParsing;
CompressionMethod compressionMethod;
XmlChangeReader task;
// Get the task arguments.
fileName = getStringArgument(
taskConfig,
ARG_FILE_NAME,
getDefaultStringArgument(taskConfig, DEFAULT_FILE_NAME)
);
enableDateParsing = getBooleanArgument(taskConfig, ARG_ENABLE_DATE_PARSING, DEFAULT_ENABLE_DATE_PARSING);
compressionMethod = getCompressionMethodArgument(taskConfig, fileName);
// Create a file object from the file name provided.
file = new File(fileName);
// Build the task object.
task = new XmlChangeReader(file, enableDateParsing, compressionMethod);
return new RunnableChangeSourceManager(taskConfig.getId(), task, taskConfig.getPipeArgs());
}
}
我需要解压缩一个非常大的文件 (100GB+) 并让它由两个并行线程处理。问题是我想使用 STDIN/STDOUT 同时向两个线程提供未压缩的内容 bzip2 north-america-latest
我最近下载了 Osmosis 将 .osm.pbf 文件转换为 .map 文件。我正在为此应用程序使用 Windows 7。我已经下载了最新的 zip file从他们的系统中,并将 mapfilewr
我正在尝试设置 Nominatim 数据库以进行地址地理编码。数据库将由 komoot 的 Photon 使用,但我想这不是那么重要的信息。 问题是我的 osm xml/pbf 文件不仅包含地址,还包
一段时间以来,我一直在尝试将 north-america-latest.osm.pbf(来自 Geofabrik)导入 Postgres 数据库。在彻底查看 wiki 详细用法页面后,我通过包含的 s
本文整理了Java中org.openstreetmap.osmosis.xml.v0_6.XmlChangeReader类的一些代码示例,展示了XmlChangeReader类的具体用法。这些代码示例
本文整理了Java中org.openstreetmap.osmosis.xml.v0_6.XmlChangeWriter类的一些代码示例,展示了XmlChangeWriter类的具体用法。这些代码示例
我想使用 OSM 数据文件(pbf 文件)做一个导航应用程序。 我想在我的 java 应用程序中使用 pbf 格式。 我正在寻找一种访问和读取 pbf 文件的方法,我发现可以通过 osmosis 库访
我正在制作一个 iOS 应用程序,我正在尝试使用 Osmosis从网站获取一些数据并将其显示在我的应用程序中。为此,我正在关注 usage。正如 github 上的自述文件中所述。 我的问题是在尝试获
我正在使用 node.js 工具 Osmosis 将一堆数据提取为 json 对象数组 Osmosis 函数的本质似乎是数组只存在于函数的范围内,所以我需要在函数停止运行并处理 json 文件之前将文
本文整理了Java中org.openstreetmap.osmosis.xml.v0_6.XmlChangeReader.()方法的一些代码示例,展示了XmlChangeReader.()的具体用法。
本文整理了Java中org.openstreetmap.osmosis.xml.v0_6.XmlChangeReader.run()方法的一些代码示例,展示了XmlChangeReader.run()
本文整理了Java中org.openstreetmap.osmosis.xml.v0_6.XmlChangeReader.setChangeSink()方法的一些代码示例,展示了XmlChangeRe
本文整理了Java中org.openstreetmap.osmosis.xml.v0_6.XmlChangeWriter.()方法的一些代码示例,展示了XmlChangeWriter.()的具体用法。
本文整理了Java中org.openstreetmap.osmosis.xml.v0_6.XmlChangeWriter.initialize()方法的一些代码示例,展示了XmlChangeWrite
本文整理了Java中org.openstreetmap.osmosis.xml.v0_6.XmlChangeWriter.close()方法的一些代码示例,展示了XmlChangeWriter.clo
本文整理了Java中org.openstreetmap.osmosis.xml.v0_6.XmlChangeWriter.complete()方法的一些代码示例,展示了XmlChangeWriter.
本文整理了Java中org.openstreetmap.osmosis.xml.v0_6.XmlChangeWriter.process()方法的一些代码示例,展示了XmlChangeWriter.p
我正在尝试使用 openstreetmap osmosis 读取机场的 pbf 文件并提取登机口和跑道等特征。 我使用的代码类似于:http://www.javaoptimum.com/how-to-
我有一个 postgresql 数据库,我使用 Osmosis 不断更新它。 Osmosis 可以写入两个不同的数据库模式,名为 Simple 和 Snapshot。与 Geoserver 使用的数据
我想将从 geofabrik.de 下载的 .osm 文件转换为 .map 以在 MapsForge 中使用。我已经安装了 osmosis 及其 MapsForge 插件。当我想将 osm 文件转换为
我是一名优秀的程序员,十分优秀!