Closed nreese closed 7 years ago
The first encoded URL is missing the backslash to escape the comma. See below (note the escaped \
, %5C
).
http://localhost:8080/geoserver/denver/wms?SERVICE=WMS&REQUEST=GetMap&VERSION=1.1.1&LAYERS=denver%3Areport&STYLES=geohashgrid&FORMAT=image%2Fpng&TRANSPARENT=true&HEIGHT=256&WIDTH=256&VIEWPARAMS=a%3A%7B%22agg%22%3A%20%7B%22geohash_grid%22%3A%20%7B%22field%22%3A%20%22location%22%5C%2C%20%22precision%22%3A%203%7D%7D%7D&SRS=EPSG%3A3857&BBOX=-11662456.027639052,4774562.53480525,-11623320.26915704,4813698.293287256
Maybe in the layer definition you need a double backslash to make sure it's included in the request?
Thanks for the extra set of eyes - adding an additional backslash resolved the error.
viewparams: 'a:{"agg": {"geohash_grid": {"field": "location"\\, "precision": 3}}}'
Now all of my tiles are empty. Is there a simple SLD that will display grids with counts greater than zero one color and empty grids another?
I'd expect you'd see something with the example SLD from the docs but you could try updating ColorMapEntry
quantity values with better max value for your expected doc counts.
<ColorMapEntry color="#FFFFFF" quantity="0" label="nodata" opacity="0"/>
<ColorMapEntry color="#00FF00" quantity="1" label="values"/>
<ColorMapEntry color="#0000FF" quantity="1000" label="label"/>
If this doesn't help you might turn up logging and check the queries that are being executed.
Putting some debug code into GeoHashGrid, I get the following when initalize is called.
num buckets: 0
precision: 2
cellWidth: 11.25
cellHeight: 5.625
The number of buckets should not be zero. Is there a way to print the Elasticsearch aggregation request and response?
Found the problem. My elastic store was using port 9300 instead of port 9200 for REST client like the documentation stated. I am out of the starting blocks.
I am attempting to use leaflet to experiment with a WMS layer generated from elasticsearch with geogrid aggregation.
I am using elasticsearch 5.1.2. I have an index with a geo_point field called location. I created a new layer in geoserver. I created a new style, geohashgrid, copied from gs-web-elasticsearch/doc/index.rst (replacing
<ogc:PropertyName>geo</ogc:PropertyName></Geometry>
with<ogc:PropertyName>location</ogc:PropertyName></Geometry>
). All tile requests result in the exceptionorg.geoserver.platform.ServiceException
.html
Generated WMS url
Server exception
I can manually replace the URL encoded viewparams attribute and then the request returns an empty tile.
How can leaflet be used to view WMS tiles generated via geogrid aggregation?