Browse Source

Will perform search before expanding relations

pull/4/head
LO Kam Tao Leo 3 years ago
parent
commit
5f9302ab14
  1. 21
      examples/simple-action.xml
  2. 17
      pom.xml
  3. 27
      src/main/java/org/leolo/map/osm/extract/ExtractElement.java

21
examples/simple-action.xml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<actions>
<properties>
<lang>
<default>en</default>
<other>de</other>
<other>es</other>
<other>fr</other>
<other>ja</other>
</lang>
<tags>
<display>short_name</display>
<display>website</display>
</tags>
</properties>
<extracts>
<relation id="9936954"/>
<way id="79289788"/>
<node id="6720935522"/>
</extracts>
</actions>

17
pom.xml

@ -52,6 +52,23 @@
<artifactId>junit-jupiter-api</artifactId>
<version>5.9.0</version>
</dependency>
<dependency>
<groupId>de.topobyte</groupId>
<artifactId>osm4j-pbf</artifactId>
<version>0.1.0</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>topobyte</id>
<name>topobyte</name>
<url>https://mvn.topobyte.de</url>
</repository>
<repository>
<id>Slimjars</id>
<name>Slimjars</name>
<url>https://mvn.slimjars.com</url>
</repository>
</repositories>
</project>

27
src/main/java/org/leolo/map/osm/extract/ExtractElement.java

@ -64,7 +64,11 @@ public class ExtractElement {
private Map<Long, Relation> relations = new Hashtable<>();
private Map<Long, Way> ways = new Hashtable<>();
private Map<Long, Node> nodes = new Hashtable<>();
private Set<Integer> strings = new HashSet<>();
private HashSet<Long> pendingRelations = new HashSet<>();
private HashSet<Long> pendingWays = new HashSet<>();
private HashSet<Long> pendingNodes = new HashSet<>();
private CliOpt cliOpt = new CliOpt();
@ -146,20 +150,29 @@ public class ExtractElement {
System.exit(3);
return;
}
expandRelations(dbFile, af, af.getRelation());
processWay(dbFile, af);
processNode(dbFile, af);
doSearch(dbFile, af);
expandRelations(dbFile);
processWay(dbFile);
processNode(dbFile);
}
/**
* Perform search as defined in the action file, and add them to relevant pending items
* @param dbFile The database file going to be searched
* @param af The file which defines the action to be performed
*/
private void doSearch(File dbFile, ActionFile af) {
}
private void processNode(File dbFile, ActionFile af) {
private void processNode(File dbFile) {
}
private void processWay(File dbFile, ActionFile af) {
private void processWay(File dbFile) {
}
private void expandRelations(File dbFile, ActionFile af, Collection<ExtractItem> relations) {
private void expandRelations(File dbFile) {
}

Loading…
Cancel
Save