Thanks, Jody. I understand that, but surely it shouldn't be taking 18
times longer to produce the same tile just because I've told it to not
to show any data at that scale? When I had no SLD at all it was less
than half a second to create a tile.
On 26/07/17 16:41, Jody Garnett wrote:
Dylan the vector tile code does not do any magic for reducing your
data size - your SLD should have a series of scale based rules
selecting what content you wish to display at each zoom level. This
will make for a long style - but often the work was already done for
performance reasons so we took this approach.
--
Jody Garnett
On 26 July 2017 at 02:17, Dylan Parry <dylan.pa...@bluefoxtech.co.uk
<mailto:dylan.pa...@bluefoxtech.co.uk>> wrote:
Hi Dave/Jody,
Thanks for the replies. I'll combine my replies to both of you as
you asked similar questions :)
Firstly, I'm using ShapeFiles for my data. I may move to use
something else later, but during my development stage it's simpler
for me to be able to drop in replacement data etc if they are
simple files.
The original data is in EPSG:27700 (British National Grid), and
I'm serving it as EPSG:3857. This doesn't appear to be the issue
though---I repeated the experiments that I'll detail below using
both projections and got similar results in both. In all cases I
chose a fairly large tile size to get the most extreme results.
Anyhow, here are the experiments I've tried:
--- start ---
With Point Data
===============
SLD
===
<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd"
<http://www.opengis.net/sldhttp://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd>
xmlns="http://www.opengis.net/sld" <http://www.opengis.net/sld>
xmlns:ogc="http://www.opengis.net/ogc" <http://www.opengis.net/ogc>
xmlns:xlink="http://www.w3.org/1999/xlink"
<http://www.w3.org/1999/xlink>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<http://www.w3.org/2001/XMLSchema-instance>>
<NamedLayer>
<Name></Name>
<UserStyle>
<Title>red square point style</Title>
<FeatureTypeStyle>
<Rule>
<Title>red point</Title>
<MaxScaleDenominator>10000</MaxScaleDenominator>
<PointSymbolizer>
<Graphic>
<Mark>
<WellKnownName>square</WellKnownName>
<Fill>
<CssParameter name="fill">#ff0000</CssParameter>
</Fill>
</Mark>
<Size>6</Size>
</Graphic>
</PointSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
Results
=======
WMS as PNG (Approx 1:8500)
==========================
http://localhost:8080/geoserver/openmap-local/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&STYLES&LAYERS=openmap-local%3Aroundabout&SRS=EPSG%3A3857&WIDTH=1227&HEIGHT=960&BBOX=-251589.75115165487%2c6775967.934575723%2c-248658.86884834513%2c6778261.045424278
<http://localhost:8080/geoserver/openmap-local/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&STYLES&LAYERS=openmap-local%3Aroundabout&SRS=EPSG%3A3857&WIDTH=1227&HEIGHT=960&BBOX=-251589.75115165487%2c6775967.934575723%2c-248658.86884834513%2c6778261.045424278>
~126ms on first run (~81ms without SLD)
WMS as VectorTile (Approx 1:8500)
=================================
http://localhost:8080/geoserver/openmap-local/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=application%2Fx-protobuf%3Btype%3Dmapbox-vector&TRANSPARENT=true&STYLES&LAYERS=openmap-local%3Aroundabout&SRS=EPSG%3A3857&WIDTH=1227&HEIGHT=960&BBOX=-251589.75115165487%2c6775967.934575723%2c-248658.86884834513%2c6778261.045424278
<http://localhost:8080/geoserver/openmap-local/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=application%2Fx-protobuf%3Btype%3Dmapbox-vector&TRANSPARENT=true&STYLES&LAYERS=openmap-local%3Aroundabout&SRS=EPSG%3A3857&WIDTH=1227&HEIGHT=960&BBOX=-251589.75115165487%2c6775967.934575723%2c-248658.86884834513%2c6778261.045424278>
~68ms on first run (~83ms without SLD)
WMS as PNG (Approx 1:17k)
==========================
http://localhost:8080/geoserver/openmap-local/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&STYLES&LAYERS=openmap-local%3Aroundabout&SRS=EPSG%3A3857&WIDTH=1227&HEIGHT=960&BBOX=-253206.87203131313%2c6774771.217351635%2c-247345.1074246937%2c6779357.439048746
<http://localhost:8080/geoserver/openmap-local/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&STYLES&LAYERS=openmap-local%3Aroundabout&SRS=EPSG%3A3857&WIDTH=1227&HEIGHT=960&BBOX=-253206.87203131313%2c6774771.217351635%2c-247345.1074246937%2c6779357.439048746>
~93ms on first run (~109ms without SLD)
WMS as VectorTile (Approx 1:17k)
================================
http://localhost:8080/geoserver/openmap-local/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=application%2Fx-protobuf%3Btype%3Dmapbox-vector&TRANSPARENT=true&STYLES&LAYERS=openmap-local%3Aroundabout&SRS=EPSG%3A3857&WIDTH=1227&HEIGHT=960&BBOX=-253206.87203131313%2c6774771.217351635%2c-247345.1074246937%2c6779357.439048746
<http://localhost:8080/geoserver/openmap-local/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=application%2Fx-protobuf%3Btype%3Dmapbox-vector&TRANSPARENT=true&STYLES&LAYERS=openmap-local%3Aroundabout&SRS=EPSG%3A3857&WIDTH=1227&HEIGHT=960&BBOX=-253206.87203131313%2c6774771.217351635%2c-247345.1074246937%2c6779357.439048746>
~107ms on first run (~135ms without SLD)
With Polygon Data
=================
SLD
===
<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd"
<http://www.opengis.net/sldhttp://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd>
xmlns="http://www.opengis.net/sld" <http://www.opengis.net/sld>
xmlns:ogc="http://www.opengis.net/ogc" <http://www.opengis.net/ogc>
xmlns:xlink="http://www.w3.org/1999/xlink"
<http://www.w3.org/1999/xlink>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<http://www.w3.org/2001/XMLSchema-instance>>
<NamedLayer>
<Name>Polygon Test</Name>
<UserStyle>
<Title>A grey polygon style</Title>
<FeatureTypeStyle>
<Rule>
<Title>grey polygon</Title>
<MaxScaleDenominator>10000</MaxScaleDenominator>
<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">#cccccc
</CssParameter>
</Fill>
<Stroke>
<CssParameter name="stroke">#000000</CssParameter>
<CssParameter name="stroke-width">0.5</CssParameter>
</Stroke>
</PolygonSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
Results
=======
WMS as PNG (Approx 1:8500)
==========================
http://localhost:8080/geoserver/openmap-local/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&STYLES&LAYERS=openmap-local%3Abuilding&SRS=EPSG%3A3857&WIDTH=1227&HEIGHT=960&BBOX=-251589.75115165487%2c6775967.934575723%2c-248658.86884834513%2c6778261.045424278
<http://localhost:8080/geoserver/openmap-local/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&STYLES&LAYERS=openmap-local%3Abuilding&SRS=EPSG%3A3857&WIDTH=1227&HEIGHT=960&BBOX=-251589.75115165487%2c6775967.934575723%2c-248658.86884834513%2c6778261.045424278>
~242ms on first run (~220 without SLD)
WMS as VectorTile (Approx 1:8500)
=================================
http://localhost:8080/geoserver/openmap-local/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=application%2Fx-protobuf%3Btype%3Dmapbox-vector&TRANSPARENT=true&STYLES&LAYERS=openmap-local%3Abuilding&SRS=EPSG%3A3857&WIDTH=1227&HEIGHT=960&BBOX=-251589.75115165487%2c6775967.934575723%2c-248658.86884834513%2c6778261.045424278
<http://localhost:8080/geoserver/openmap-local/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=application%2Fx-protobuf%3Btype%3Dmapbox-vector&TRANSPARENT=true&STYLES&LAYERS=openmap-local%3Abuilding&SRS=EPSG%3A3857&WIDTH=1227&HEIGHT=960&BBOX=-251589.75115165487%2c6775967.934575723%2c-248658.86884834513%2c6778261.045424278>
~184ms on first run (~189ms without SLD)
WMS as PNG (Approx 1:17k)
==========================
http://localhost:8080/geoserver/openmap-local/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&STYLES&LAYERS=openmap-local%3Abuilding&SRS=EPSG%3A3857&WIDTH=1227&HEIGHT=960&BBOX=-253206.87203131313%2c6774771.217351635%2c-247345.1074246937%2c6779357.439048746
<http://localhost:8080/geoserver/openmap-local/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&STYLES&LAYERS=openmap-local%3Abuilding&SRS=EPSG%3A3857&WIDTH=1227&HEIGHT=960&BBOX=-253206.87203131313%2c6774771.217351635%2c-247345.1074246937%2c6779357.439048746>
~95ms on first run (~511ms without SLD)
WMS as VectorTile (Approx 1:17k)
================================
http://localhost:8080/geoserver/openmap-local/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=application%2Fx-protobuf%3Btype%3Dmapbox-vector&TRANSPARENT=true&STYLES&LAYERS=openmap-local%3Aroundabout&SRS=EPSG%3A3857&WIDTH=1227&HEIGHT=960&BBOX=-253206.87203131313%2c6774771.217351635%2c-247345.1074246937%2c6779357.439048746
<http://localhost:8080/geoserver/openmap-local/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=application%2Fx-protobuf%3Btype%3Dmapbox-vector&TRANSPARENT=true&STYLES&LAYERS=openmap-local%3Aroundabout&SRS=EPSG%3A3857&WIDTH=1227&HEIGHT=960&BBOX=-253206.87203131313%2c6774771.217351635%2c-247345.1074246937%2c6779357.439048746>
~5416ms on first run (~362ms without SLD)
--- end ---
The point data didn't really show any issues. It's possible that
this is because that dataset is pretty sparse in comparison to
other datasets that I'm working with. The real issues arise when
using polygon data---serving as VectorTile with the SLD took a
whopping 5.5 seconds to generate a completely empty tile, but if I
turned off the SLD it only took 0.3 seconds!
In reality I'm using TMS combined with GWC, so I'd only see these
times once when populating the cache, but it means that populating
my cache is taking an inordinate amount of time longer than it
ought to.
Is there a problem with the SLDs that I have used? I basically
took the default templates and added a MaxScaleDenominator to
them, which appears to do the job just fine for the PNG request,
and also results in the correctly empty tile for VectorTile, but
it shouldn't be taking so long to produce them.
Thanks for your help!
On 26/07/17 00:22, Dave Blasby wrote:
Hi, Dylan,
The VT renderer should be taking the min/max scale range into
consideration when querying the underlying data.
Do you have access to a dev environment? If you do, please look
in VectorTileMapOutputFormat#produceMap(). About half way down,
you should see;
Query query = getStyleQuery(layer, mapContent);
This should be taking the min/max scale denominator into
consideration.
Questions;
1. what's your SLD
2. what type of data set are you using (postgis? shp?)
3. could you verify that all your CRSes are setup correctly for
the layer and request? (it could be calculating the incorrect
map scale)
4. how are your requests setup? Are you using the SLD in #1?
Could you give an example request that directly communicates with
the WMS (that's quick for an image format and slow for a mapbox
VT format)?
Thanks,
Dave
------------------------------------------------------------------------
Dylan Parry
Lead Developer, Blue Fox Technology Ltd
------------------------------------------------------------------------
<http://www.opusmap.co.uk> T: 01452 524901
W: www.opusmap.co.uk <http://www.opusmap.co.uk/>
LinkedIn
<https://www.linkedin.com/company/blue-fox-technology-ltd?trk=biz-companies-cym>
Twitter <https://twitter.com/opusmap> YouTube
<https://www.youtube.com/channel/UCIpw1EnG55-D9DzzbkZXV_A> Google+
<https://plus.google.com/u/0/b/112115908251760042852/+OpusmapUk>
Opus Map - Try it for free <http://www.opusmap.co.uk/free-demo/>
Registered in England and Wales, Company No. 05908226.
Registered office: Windsor House, 26 Mostyn Avenue, Craig-Y-Don,
Llandudno, Conwy LL30 1YY
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
Please make sure you read the following two resources before
posting to this list:
- Earning your support instead of buying it, but Ian Turton:
http://www.ianturton.com/talks/foss4g.html#/
<http://www.ianturton.com/talks/foss4g.html#/>
- The GeoServer user list posting guidelines:
http://geoserver.org/comm/userlist-guidelines.html
<http://geoserver.org/comm/userlist-guidelines.html>
Geoserver-users@lists.sourceforge.net
<mailto:Geoserver-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/geoserver-users
<https://lists.sourceforge.net/lists/listinfo/geoserver-users>
------------------------------------------------------------------------
Dylan Parry
Lead Developer, Blue Fox Technology Ltd
------------------------------------------------------------------------
<http://www.opusmap.co.uk> T: 01452 524901
W: www.opusmap.co.uk <http://www.opusmap.co.uk/>
LinkedIn
<https://www.linkedin.com/company/blue-fox-technology-ltd?trk=biz-companies-cym>
Twitter <https://twitter.com/opusmap> YouTube
<https://www.youtube.com/channel/UCIpw1EnG55-D9DzzbkZXV_A> Google+
<https://plus.google.com/u/0/b/112115908251760042852/+OpusmapUk>
Opus Map - Try it for free <http://www.opusmap.co.uk/free-demo/>
Registered in England and Wales, Company No. 05908226.
Registered office: Windsor House, 26 Mostyn Avenue, Craig-Y-Don,
Llandudno, Conwy LL30 1YY
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
Please make sure you read the following two resources before posting to this
list:
- Earning your support instead of buying it, but Ian Turton:
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines:
http://geoserver.org/comm/userlist-guidelines.html
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users