Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose min_size in configurable schema #421

Merged
merged 4 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename min_pixel_size to min_size
  • Loading branch information
wipfli committed Jan 3, 2023
commit ae25b1e37410adbf771005f9b493f105be1528a1
2 changes: 1 addition & 1 deletion planetiler-custommap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ docker run -v "$(pwd)/data":/data ghcr.io/onthegomap/planetiler:latest verify /d
- `geometry` - Geometry type of the expected output feature.
- `min_zoom` - Min zoom level that the output feature appears in.
- `max_zoom` - Max zoom level that the output feature appears in.
- `min_pixel_size` - Minimum length of line features or square root of the minimum area of polygon features to emit below the maximum zoom-level of the map.
- `min_size` - Minimum length of line features or square root of the minimum area of polygon features to emit below the maximum zoom-level of the map.
- `tags` - Attributes expected on the output vector tile feature, or `null` if the attribute should not be set. Use
`allow_extra_tags: true` to fail if any other tags appear besides the ones specified here.
- `allow_extra_tags` - If `true`, then fail when extra attributes besides tags appear on the output feature.
Expand Down
2 changes: 1 addition & 1 deletion planetiler-custommap/planetilerspec.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"description": "Max zoom level that the output feature appears in",
"type": "integer"
},
"min_pixel_size": {
"min_size": {
"description": "Minimum length of line features or square root of the minimum area of polygon features to emit below the maximum zoom-level of the map",
"type": "double"
},
msbarry marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public ConfiguredFeature(String layer, TagValueProducer tagValueProducer, Featur
}
processors.add(makeFeatureProcessor(feature.minZoom(), Integer.class, Feature::setMinZoom));
processors.add(makeFeatureProcessor(feature.maxZoom(), Integer.class, Feature::setMaxZoom));
processors.add(makeFeatureProcessor(feature.minPixelSize(), Double.class, Feature::setMinPixelSize));
processors.add(makeFeatureProcessor(feature.minSize(), Double.class, Feature::setMinPixelSize));

featureProcessors = processors.stream().filter(Objects::nonNull).toList();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public record FeatureItem(
@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY) List<String> source,
@JsonProperty("min_zoom") Object minZoom,
@JsonProperty("max_zoom") Object maxZoom,
@JsonProperty("min_pixel_size") Object minPixelSize,
@JsonProperty("min_size") Object minSize,
@JsonProperty(required = true) FeatureGeometry geometry,
@JsonProperty("include_when") Object includeWhen,
@JsonProperty("exclude_when") Object excludeWhen,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public record OutputFeature(
GeometryType geometry,
@JsonProperty("min_zoom") Integer minZoom,
@JsonProperty("max_zoom") Integer maxZoom,
@JsonProperty("min_pixel_size") Double minPixelSize,
@JsonProperty("min_size") Double minSize,
@JsonProperty("at_zoom") Integer atZoom,
@JsonProperty("allow_extra_tags") Boolean allowExtraTags,
@JsonProperty("tags") Map<String, Object> tags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ layers:
- source: osm
geometry: line
# TODO get min admin level from relations
min_pixel_size: 0.0
min_size: 0.0
min_zoom:
default_value: 7
overrides:
Expand Down Expand Up @@ -380,7 +380,7 @@ layers:
features:
- source: osm
geometry: line
min_pixel_size: 0.0
min_size: 0.0
min_zoom:
default_value: 13
overrides:
Expand Down