Skip to content

Commit

Permalink
Update Osmosis to 0.46 with protobuf 3, fix mapsforge#1002
Browse files Browse the repository at this point in the history
  • Loading branch information
devemux86 committed Oct 6, 2017
1 parent 973a929 commit bd5ce18
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 42 deletions.
1 change: 1 addition & 0 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- POI: add named entities option [#949](https://github.com/mapsforge/mapsforge/issues/949)
- POI: fix multiple POI categories [#940](https://github.com/mapsforge/mapsforge/issues/940)
- Feature parameters [#994](https://github.com/mapsforge/mapsforge/issues/994)
- Writers: Osmosis 0.46 with protobuf 3 [#1002](https://github.com/mapsforge/mapsforge/issues/1002)
- Many other minor improvements and bug fixes
- [Solved issues](https://github.com/mapsforge/mapsforge/issues?q=is%3Aclosed+milestone%3A0.9.0)

Expand Down
2 changes: 1 addition & 1 deletion docs/Integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ compile 'org.mapsforge:spatialite-android:[CURRENT-VERSION]:natives-x86'
#### Desktop
```groovy
compile 'org.mapsforge:mapsforge-poi-awt:[CURRENT-VERSION]'
compile 'org.xerial:sqlite-jdbc:3.18.0'
compile 'org.xerial:sqlite-jdbc:3.20.0'
```

## Snapshots
Expand Down
4 changes: 2 additions & 2 deletions mapsforge-map-writer/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dependencies {
compile project(":mapsforge-core")
compile 'com.google.guava:guava:22.0'
compile 'com.google.guava:guava:23.0'
compile 'com.vividsolutions:jts-core:1.14.0'
compile 'net.sf.trove4j:trove4j:3.0.3'
compileOnly 'org.openstreetmap.osmosis:osmosis-core:0.45'
compileOnly 'org.openstreetmap.osmosis:osmosis-core:0.46'
}

sourceSets.test.compileClasspath += configurations.compileOnly
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright 2010, 2011, 2012, 2013 mapsforge.org
* Copyright 2015 lincomatic
* Copyright 2017 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
Expand Down Expand Up @@ -112,6 +113,14 @@ public void addWay(Way way) {
this.maxWayID = Math.max(way.getId(), this.maxWayID);
}

@Override
public void close() {
this.indexedNodeStore.close();
this.indexedWayStore.close();
this.wayStore.close();
this.relationStore.close();
}

// TODO add accounting of average number of tiles per way
@Override
public void complete() {
Expand Down Expand Up @@ -233,14 +242,6 @@ public TDWay getWay(long id) {
}
}

@Override
public void release() {
this.indexedNodeStore.release();
this.indexedWayStore.release();
this.wayStore.release();
this.relationStore.release();
}

@Override
protected HDTileData getTileImpl(int zoom, int tileX, int tileY) {
int tileCoordinateXIndex = tileX - this.tileGridLayouts[zoom].getUpperLeft().getX();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright 2010, 2011, 2012, 2013 mapsforge.org
* Copyright 2015 lincomatic
* Copyright 2017 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
Expand Down Expand Up @@ -113,6 +114,11 @@ public void addWay(Way way) {
}
}

@Override
public void close() {
// nothing to do here
}

@Override
public void complete() {
// Polygonize multipolygon
Expand Down Expand Up @@ -186,11 +192,6 @@ public ZoomIntervalConfiguration getZoomIntervalConfiguration() {
return this.zoomIntervalConfiguration;
}

@Override
public void release() {
// nothing to do here
}

@Override
protected RAMTileData getTileImpl(int zoom, int tileX, int tileY) {
int tileCoordinateXIndex = tileX - this.tileGridLayouts[zoom].getUpperLeft().getX();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright 2010, 2011, 2012, 2013 mapsforge.org
* Copyright 2017 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
Expand Down Expand Up @@ -48,6 +49,11 @@ public interface TileBasedDataProcessor {
*/
void addWay(Way way);

/**
* Release all acquired resources, e.g. delete any temporary files.
*/
void close();

/**
* Complete the data store, e.g. build indexes or similar.
*/
Expand Down Expand Up @@ -108,9 +114,4 @@ public interface TileBasedDataProcessor {
* @return the underlying zoom interval configuration
*/
ZoomIntervalConfiguration getZoomIntervalConfiguration();

/**
* Release all acquired resources, e.g. delete any temporary files.
*/
void release();
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright 2010, 2011, 2012, 2013 mapsforge.org
* Copyright 2015 devemux86
* Copyright 2015-2017 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
Expand Down Expand Up @@ -82,6 +82,13 @@ public class MapFileWriterTask implements Sink {
}
}

@Override
public final void close() {
if (this.tileBasedGeoObjectStore != null) {
this.tileBasedGeoObjectStore.close();
}
}

@Override
public final void complete() {
NumberFormat nfMegabyte = NumberFormat.getInstance();
Expand Down Expand Up @@ -183,11 +190,4 @@ public final void process(EntityContainer entityContainer) {
break;
}
}

@Override
public final void release() {
if (this.tileBasedGeoObjectStore != null) {
this.tileBasedGeoObjectStore.release();
}
}
}
2 changes: 1 addition & 1 deletion mapsforge-poi-awt/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dependencies {
compile project(":mapsforge-poi")
compile 'org.xerial:sqlite-jdbc:3.18.0'
compile 'org.xerial:sqlite-jdbc:3.20.0'
}
6 changes: 3 additions & 3 deletions mapsforge-poi-writer/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dependencies {
compile project(":mapsforge-poi")
compile 'com.google.guava:guava:22.0'
compile 'com.google.guava:guava:23.0'
compile 'com.vividsolutions:jts-core:1.14.0'
compile 'org.xerial:sqlite-jdbc:3.18.0'
compileOnly 'org.openstreetmap.osmosis:osmosis-core:0.45'
compile 'org.xerial:sqlite-jdbc:3.20.0'
compileOnly 'org.openstreetmap.osmosis:osmosis-core:0.46'
}

jar {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright 2010, 2011 mapsforge.org
* Copyright 2010, 2011 Karsten Groll
* Copyright 2015 devemux86
* Copyright 2015-2017 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
Expand Down Expand Up @@ -66,6 +66,14 @@ public PoiWriterTask(PoiWriterConfiguration configuration, ProgressManager progr
this.poiWriter = PoiWriter.newInstance(configuration, progressManager);
}

/**
* {@inheritDoc}
*/
@Override
public void close() {
// do nothing here
}

/**
* {@inheritDoc}
*/
Expand All @@ -90,12 +98,4 @@ public void initialize(Map<String, Object> metadata) {
public void process(EntityContainer entityContainer) {
this.poiWriter.process(entityContainer);
}

/**
* {@inheritDoc}
*/
@Override
public void release() {
// do nothing here
}
}

0 comments on commit bd5ce18

Please sign in to comment.