Skip to content

Commit

Permalink
Merge pull request #1725 from ismailsunni/metatile3
Browse files Browse the repository at this point in the history
Add tileBufferSize on config
  • Loading branch information
sbrunner authored Feb 15, 2021
2 parents e1ed3c9 + d323263 commit 3864d28
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ public class SetTiledWmsProcessor extends AbstractProcessor<SetTiledWmsProcessor
*/
private int maxHeight;

/**
* The tile buffer width in pixels.
*/
private int tileBufferWidth;
/**
* The tile buffer height in pixels.
*/
private int tileBufferHeight;

/**
* Constructor.
*/
Expand Down Expand Up @@ -103,13 +112,9 @@ public final Void execute(final Input values, final ExecutionContext context) th
String.join(", ", wmsLayer.getParams().layers), tileSize.width,
tileSize.height);
}
// Notes(IS): Honestly I have no idea where should I put these buffer size.
// It is needed for TiledWmsLayer (so that the values are accessible)
final int tileBufferWidth = 0;
final int tileBufferHeight = 0;

values.map.replaceLayer(i, new TiledWmsLayer(
wmsLayer, tileSize, tileBufferWidth, tileBufferHeight));
wmsLayer, tileSize, this.tileBufferWidth, this.tileBufferHeight));
}
}
}
Expand Down Expand Up @@ -173,4 +178,18 @@ public static final class Input {
@InputOutputValue
public GenericMapAttributeValues map;
}

/**
* @param tileBufferWidth the tileBufferWidth to set
*/
public void setTileBufferWidth(final int tileBufferWidth) {
this.tileBufferWidth = tileBufferWidth;
}

/**
* @param tileBufferHeight the tileBufferHeight to set
*/
public void setTileBufferHeight(final int tileBufferHeight) {
this.tileBufferHeight = tileBufferHeight;
}
}
19 changes: 19 additions & 0 deletions examples/src/test/resources/examples/printtiledwms/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,22 @@ templates:
maxWidth: 256
maxHeight: 256
- !createMap {}

#===========================================================================
Auto meta tiling: !template
#===========================================================================
reportTemplate: simpleReport.jrxml
attributes:
map: !map
maxDpi: 400
width: 780
height: 330
processors:
- !reportBuilder # compile all reports in current directory
directory: '.'
- !setTiledWms
maxWidth: 256
maxHeight: 256
tileBufferWidth: 60
tileBufferHeight: 60
- !createMap {}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"layout": "Auto meta tiling",
"outputFormat": "pdf",
"attributes": {
"map": {
"projection": "EPSG:4326",
"dpi": 72,
"rotation": 0,
"bbox": [
-130,
20,
-60,
50
],
"longitudeFirst": true,
"layers": [
{
"type": "WMS",
"layers": [
"topp:states"
],
"baseURL": "http://geoserver:8080/wms",
"imageFormat": "image/png",
"version": "1.1.1",
"customParams": {
"TRANSPARENT": "true"
}
}
]
}
}
}

0 comments on commit 3864d28

Please sign in to comment.