TransWikia.com

GeoServer: How do I get rid of error Unable to parse number For input string: "x"?

Geographic Information Systems Asked on May 24, 2021

I am using GeoServer version 2.17.2 at my Windows 10 (x64) machine. In the PostGIS store, I have an SLD symbology coupled layer. Using GeoWebCache, I have created tiles of the same, and I could see several PNGs in Geoserver data directory (Windows machine root directory):

enter image description here

At the moment, I am trying to display (without any mapping client, OL3, Leaflet, etc.) these tiles (via GWC TMS service) in my Google Chrome browser using:

http://my_server:my_port/geoserver/gwc/service/tms/1.0.0/my_workspace%3Amy_layer@EPSG%3A900913@png/{z}/{x}/{y}.png

But, I keep getting the error:

400: Unable to parse number For input string: "{x}" from /service/tms/1.0.0/my_workspace:my_layer@EPSG:900913@png/{z}/{x}/{y}.png

I tried to google but couldn’t get any hint to resolve the above error. Can someone help me to understand what am I doing wrong here?

One Answer

You are asking for WMTS tiles using the "REST" API - so when you request the getCapabilities document for your layer you will see something like:

<Layer>
<ows:Title>USA Population</ows:Title>
<ows:Abstract>This is some census data on the states.</ows:Abstract>
<ows:WGS84BoundingBox>
<ows:LowerCorner>-124.73142200000001 24.955967</ows:LowerCorner>
<ows:UpperCorner>-66.969849 49.371735</ows:UpperCorner>
</ows:WGS84BoundingBox>
<ows:Identifier>topp:states</ows:Identifier>
<Style>
<ows:Identifier>polygon</ows:Identifier>
<LegendURL format="image/png" xlink:href="http://localhost:8080/geoserver-2.17.2/ows?service=WMS&request=GetLegendGraphic&format=image%2Fpng&width=20&height=20&layer=topp%3Astates&style=polygon" width="20" height="20"/>
</Style>
<Style>
<ows:Identifier>pophatch</ows:Identifier>
<LegendURL format="image/png" xlink:href="http://localhost:8080/geoserver-2.17.2/ows?service=WMS&request=GetLegendGraphic&format=image%2Fpng&width=84&height=80&layer=topp%3Astates&style=pophatch" width="84" height="80"/>
</Style>
<Style isDefault="true">
<ows:Identifier>population</ows:Identifier>
<LegendURL format="image/png" xlink:href="http://localhost:8080/geoserver-2.17.2/ows?service=WMS&request=GetLegendGraphic&format=image%2Fpng&width=84&height=80&layer=topp%3Astates" width="84" height="80"/>
</Style>
<Format>image/png</Format>
<Format>image/jpeg</Format>
<InfoFormat>text/plain</InfoFormat>
<InfoFormat>application/vnd.ogc.gml</InfoFormat>
<InfoFormat>text/xml</InfoFormat>
<InfoFormat>application/vnd.ogc.gml/3.1.1</InfoFormat>
<InfoFormat>text/xml</InfoFormat>
<InfoFormat>text/html</InfoFormat>
<InfoFormat>application/json</InfoFormat>
<TileMatrixSetLink>
<TileMatrixSet>EPSG:4326</TileMatrixSet>
<TileMatrixSetLimits>
<TileMatrixLimits>
<TileMatrix>EPSG:4326:0</TileMatrix>
<MinTileRow>0</MinTileRow>
<MaxTileRow>0</MaxTileRow>
<MinTileCol>0</MinTileCol>
<MaxTileCol>0</MaxTileCol>
</TileMatrixLimits>
<TileMatrixLimits>
<TileMatrix>EPSG:4326:1</TileMatrix>
<MinTileRow>0</MinTileRow>
<MaxTileRow>0</MaxTileRow>
<MinTileCol>0</MinTileCol>
<MaxTileCol>1</MaxTileCol>
</TileMatrixLimits>
<TileMatrixLimits>
<TileMatrix>EPSG:4326:2</TileMatrix>
<MinTileRow>0</MinTileRow>
<MaxTileRow>1</MaxTileRow>
<MinTileCol>1</MinTileCol>
<MaxTileCol>2</MaxTileCol>
</TileMatrixLimits>
<TileMatrixLimits>
<TileMatrix>EPSG:4326:3</TileMatrix>
<MinTileRow>1</MinTileRow>
<MaxTileRow>2</MaxTileRow>
<MinTileCol>2</MinTileCol>
<MaxTileCol>5</MaxTileCol>
</TileMatrixLimits>
<TileMatrixLimits>
<TileMatrix>EPSG:4326:4</TileMatrix>
<MinTileRow>3</MinTileRow>
<MaxTileRow>5</MaxTileRow>
<MinTileCol>4</MinTileCol>
<MaxTileCol>10</MaxTileCol>
</TileMatrixLimits>
...

First you need to pick your TileMatrixSet or which projection you want. Then for each TileMatrixLimits you can get the Z value from the TileMatrix after the 2nd : and the min/max for X and Y from the Min/MaxTileRow/Col entries.

Answered by Ian Turton on May 24, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP