Porównaj commity

...

7 Commity

Autor SHA1 Wiadomość Data
Michael Barry 8c002d3e16
Merge 48c4f60ad8 into 12558b99a8 2024-04-26 12:34:32 +02:00
dependabot[bot] 12558b99a8
Bump com.ibm.icu:icu4j from 74.2 to 75.1 (#872)
Bumps [com.ibm.icu:icu4j](https://github.com/unicode-org/icu) from 74.2 to 75.1.
- [Release notes](https://github.com/unicode-org/icu/releases)
- [Commits](https://github.com/unicode-org/icu/commits)

---
updated-dependencies:
- dependency-name: com.ibm.icu:icu4j
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-26 05:37:04 -04:00
dependabot[bot] b41e1f2f3b
Bump org.xerial:sqlite-jdbc from 3.45.2.0 to 3.45.3.0 (#871)
Bumps [org.xerial:sqlite-jdbc](https://github.com/xerial/sqlite-jdbc) from 3.45.2.0 to 3.45.3.0.
- [Release notes](https://github.com/xerial/sqlite-jdbc/releases)
- [Changelog](https://github.com/xerial/sqlite-jdbc/blob/master/CHANGELOG)
- [Commits](https://github.com/xerial/sqlite-jdbc/compare/3.45.2.0...3.45.3.0)

---
updated-dependencies:
- dependency-name: org.xerial:sqlite-jdbc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-22 05:29:31 -04:00
dependabot[bot] bbd197b525
Bump org.apache.maven.plugins:maven-jar-plugin from 3.3.0 to 3.4.0 (#869)
Bumps [org.apache.maven.plugins:maven-jar-plugin](https://github.com/apache/maven-jar-plugin) from 3.3.0 to 3.4.0.
- [Release notes](https://github.com/apache/maven-jar-plugin/releases)
- [Commits](https://github.com/apache/maven-jar-plugin/compare/maven-jar-plugin-3.3.0...maven-jar-plugin-3.4.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-jar-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-21 06:09:51 -04:00
Mike Barry 48c4f60ad8 undo 2024-03-04 05:13:29 -05:00
Mike Barry a33f3b8327 smaller ids 2024-03-03 21:15:20 -05:00
Mike Barry b38b8b37a1 encode node/way/relation in vector tile feature id 2024-03-03 20:40:17 -05:00
4 zmienionych plików z 45 dodań i 18 usunięć

Wyświetl plik

@ -67,7 +67,7 @@
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.45.2.0</version>
<version>3.45.3.0</version>
</dependency>
<dependency>
<groupId>org.msgpack</groupId>
@ -142,7 +142,7 @@
<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j</artifactId>
<version>74.2</version>
<version>75.1</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
@ -174,7 +174,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<version>3.4.0</version>
<executions>
<execution>
<goals>

Wyświetl plik

@ -6,6 +6,8 @@ import com.onthegomap.planetiler.geo.GeoUtils;
import com.onthegomap.planetiler.geo.GeometryException;
import com.onthegomap.planetiler.geo.GeometryType;
import com.onthegomap.planetiler.reader.SourceFeature;
import com.onthegomap.planetiler.reader.osm.OsmElement;
import com.onthegomap.planetiler.reader.osm.OsmSourceFeature;
import com.onthegomap.planetiler.render.FeatureRenderer;
import com.onthegomap.planetiler.stats.Stats;
import com.onthegomap.planetiler.util.CacheByZoom;
@ -59,7 +61,7 @@ public class FeatureCollector implements Iterable<FeatureCollector.Feature> {
* @return a feature that can be configured further.
*/
public Feature geometry(String layer, Geometry geometry) {
Feature feature = new Feature(layer, geometry, source.id());
Feature feature = new Feature(layer, geometry, source);
output.add(feature);
return feature;
}
@ -81,7 +83,7 @@ public class FeatureCollector implements Iterable<FeatureCollector.Feature> {
return geometry(layer, source.worldGeometry());
} catch (GeometryException e) {
e.log(stats, "feature_point", "Error getting point geometry for " + source.id());
return new Feature(layer, EMPTY_GEOM, source.id());
return new Feature(layer, EMPTY_GEOM, source);
}
}
@ -101,7 +103,7 @@ public class FeatureCollector implements Iterable<FeatureCollector.Feature> {
return geometry(layer, source.line());
} catch (GeometryException e) {
e.log(stats, "feature_line", "Error constructing line for " + source.id());
return new Feature(layer, EMPTY_GEOM, source.id());
return new Feature(layer, EMPTY_GEOM, source);
}
}
@ -121,7 +123,7 @@ public class FeatureCollector implements Iterable<FeatureCollector.Feature> {
return geometry(layer, source.polygon());
} catch (GeometryException e) {
e.log(stats, "feature_polygon", "Error constructing polygon for " + source.id());
return new Feature(layer, EMPTY_GEOM, source.id());
return new Feature(layer, EMPTY_GEOM, source);
}
}
@ -136,7 +138,7 @@ public class FeatureCollector implements Iterable<FeatureCollector.Feature> {
return geometry(layer, source.centroid());
} catch (GeometryException e) {
e.log(stats, "feature_centroid", "Error getting centroid for " + source.id());
return new Feature(layer, EMPTY_GEOM, source.id());
return new Feature(layer, EMPTY_GEOM, source);
}
}
@ -153,7 +155,7 @@ public class FeatureCollector implements Iterable<FeatureCollector.Feature> {
return geometry(layer, source.centroidIfConvex());
} catch (GeometryException e) {
e.log(stats, "feature_centroid_if_convex", "Error constructing centroid if convex for " + source.id());
return new Feature(layer, EMPTY_GEOM, source.id());
return new Feature(layer, EMPTY_GEOM, source);
}
}
@ -169,7 +171,7 @@ public class FeatureCollector implements Iterable<FeatureCollector.Feature> {
return geometry(layer, source.pointOnSurface());
} catch (GeometryException e) {
e.log(stats, "feature_point_on_surface", "Error constructing point on surface for " + source.id());
return new Feature(layer, EMPTY_GEOM, source.id());
return new Feature(layer, EMPTY_GEOM, source);
}
}
@ -191,7 +193,7 @@ public class FeatureCollector implements Iterable<FeatureCollector.Feature> {
return geometry(layer, source.innermostPoint(tolerance));
} catch (GeometryException e) {
e.log(stats, "feature_innermost_point", "Error constructing innermost point for " + source.id());
return new Feature(layer, EMPTY_GEOM, source.id());
return new Feature(layer, EMPTY_GEOM, source);
}
}
@ -275,11 +277,21 @@ public class FeatureCollector implements Iterable<FeatureCollector.Feature> {
private String numPointsAttr = null;
private Feature(String layer, Geometry geom, long id) {
private Feature(String layer, Geometry geom, SourceFeature source) {
this.layer = layer;
this.geom = geom;
this.geometryType = GeometryType.typeOf(geom);
this.id = id;
if (source instanceof OsmSourceFeature osmSourceFeature) {
long osmId = osmSourceFeature.originalElement().id();
this.id = switch (osmSourceFeature.originalElement()) {
case OsmElement.Node node -> node.id() * 3;
case OsmElement.Way way -> way.id() * 3 + 1;
case OsmElement.Relation relation -> relation.id() * 3 + 2;
default -> osmId;
};
} else {
this.id = source.id();
}
if (geometryType == GeometryType.POINT) {
minPixelSizeAtMaxZoom = 0;
defaultMinPixelSize = 0;

Wyświetl plik

@ -875,7 +875,7 @@ class PlanetilerTests {
feature(newPoint(128, 128), Map.of(
"attr", "value",
"name", "name value"
))
)).withId(3)
)
), results.tiles);
}
@ -964,7 +964,7 @@ class PlanetilerTests {
feature(newLineString(128, 128, 192, 192), Map.of(
"attr", "value",
"name", "name value"
))
)).withId(3 * 3 + 1)
)
), results.tiles);
}
@ -1089,7 +1089,7 @@ class PlanetilerTests {
"attr", "value",
"name", "name value",
"relname", "rel name"
))
)).withId(17 * 3 + 2)
)
), results.tiles);
}

Wyświetl plik

@ -279,7 +279,9 @@ public class TestUtils {
case UNKNOWN -> throw new IllegalArgumentException("cannot decompress \"UNKNOWN\"");
};
var decoded = VectorTile.decode(bytes).stream()
.map(feature -> feature(decodeSilently(feature.geometry()), feature.layer(), feature.attrs())).toList();
.map(
feature -> feature(decodeSilently(feature.geometry()), feature.layer(), feature.attrs()).withId(feature.id()))
.toList();
tiles.put(tile.coord(), decoded);
}
return tiles;
@ -467,12 +469,21 @@ public class TestUtils {
public record ComparableFeature(
GeometryComparision geometry,
String layer,
Map<String, Object> attrs
Map<String, Object> attrs,
Long id
) {
ComparableFeature(
GeometryComparision geometry,
String layer,
Map<String, Object> attrs
) {
this(geometry, layer, attrs, null);
}
@Override
public boolean equals(Object o) {
return o == this || (o instanceof ComparableFeature other &&
(id == null || other.id == null || id.equals(other.id)) &&
geometry.equals(other.geometry) &&
attrs.equals(other.attrs) &&
(layer == null || other.layer == null || Objects.equals(layer, other.layer)));
@ -484,6 +495,10 @@ public class TestUtils {
result = 31 * result + attrs.hashCode();
return result;
}
ComparableFeature withId(long id) {
return new ComparableFeature(geometry, layer, attrs, id);
}
}
public static ComparableFeature feature(Geometry geom, String layer, Map<String, Object> attrs) {