Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

we've made an application that uses GeoServer WMS tiles on an OpenLayers map. We have a layer of Bus Stops which we filter based on search results from previous search i.e. User searches for 'The Square', we find 20 stops that say 'The Square' and filter them in the WMS requests using FeatureID like so.

http://wms.geowessex.com/geoserver/wms?LAYERS=dev%3ADFT_BUS_STOPS&CACHE=true&TRANSPARENT=true&FORMAT=image%2Fpng8&EXCEPTIONS=application%2Fvnd.ogc.se_xml&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&FEATUREID=DFT_BUS_STOPS.2106%2CDFT_BUS_STOPS.239%2CDFT_BUS_STOPS.357%2CDFT_BUS_STOPS.1217%2CDFT_BUS_STOPS.1185%2CDFT_BUS_STOPS.245%2CDFT_BUS_STOPS.1175%2CDFT_BUS_STOPS.2261%2CDFT_BUS_STOPS.1199%2CDFT_BUS_STOPS.1665%2CDFT_BUS_STOPS.1664%2CDFT_BUS_STOPS.1214%2CDFT_BUS_STOPS.1181%2CDFT_BUS_STOPS.1712%2CDFT_BUS_STOPS.1258%2CDFT_BUS_STOPS.2078%2CDFT_BUS_STOPS.1741%2CDFT_BUS_STOPS.1176%2CDFT_BUS_STOPS.1165%2CDFT_BUS_STOPS.1137%2CDFT_BUS_STOPS.1068%2CDFT_BUS_STOPS.2084%2CDFT_BUS_STOPS.353%2CDFT_BUS_STOPS.1139%2CDFT_BUS_STOPS.1248%2CDFT_BUS_STOPS.203%2CDFT_BUS_STOPS.1731%2CDFT_BUS_STOPS.205%2CDFT_BUS_STOPS.1239%2CDFT_BUS_STOPS.2453%2CDFT_BUS_STOPS.1679%2CDFT_BUS_STOPS.1678%2CDFT_BUS_STOPS.356%2CDFT_BUS_STOPS.1701%2CDFT_BUS_STOPS.1715%2CDFT_BUS_STOPS.250%2CDFT_BUS_STOPS.1704%2CDFT_BUS_STOPS.358&SRS=EPSG%3A900913&BBOX=-275784.79880351,6550959.0701793,-275173.30257734,6551570.5664055&WIDTH=256&HEIGHT=256

(this particular example only shows two of the filtered stops, but you get the picture)

This works fine, but with some of the search results the amount of stops can be significantly higher, so we end up with a request like this.

http://wms.geowessex.com/geoserver/wms?LAYERS=dev%3ADFT_BUS_STOPS&CACHE=true&TRANSPARENT=true&FORMAT=image%2Fpng8&EXCEPTIONS=application%2Fvnd.ogc.se_xml&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&FEATUREID=DFT_BUS_STOPS.2106,DFT_BUS_STOPS.239,DFT_BUS_STOPS.357,DFT_BUS_STOPS.1217,DFT_BUS_STOPS.1185,DFT_BUS_STOPS.245,DFT_BUS_STOPS.1175,DFT_BUS_STOPS.2261,DFT_BUS_STOPS.1199,DFT_BUS_STOPS.1665,DFT_BUS_STOPS.1664,DFT_BUS_STOPS.1214,DFT_BUS_STOPS.1181,DFT_BUS_STOPS.1712,DFT_BUS_STOPS.1258,DFT_BUS_STOPS.2078,DFT_BUS_STOPS.1741,DFT_BUS_STOPS.1176,DFT_BUS_STOPS.1165,DFT_BUS_STOPS.1137,DFT_BUS_STOPS.1068,DFT_BUS_STOPS.2084,DFT_BUS_STOPS.353,DFT_BUS_STOPS.1139,DFT_BUS_STOPS.1248,DFT_BUS_STOPS.203,DFT_BUS_STOPS.1731,DFT_BUS_STOPS.205,DFT_BUS_STOPS.1239,DFT_BUS_STOPS.2453,DFT_BUS_STOPS.1679,DFT_BUS_STOPS.1678,DFT_BUS_STOPS.356,DFT_BUS_STOPS.1701,DFT_BUS_STOPS.1715,DFT_BUS_STOPS.250,DFT_BUS_STOPS.1704,DFT_BUS_STOPS.358,DFT_BUS_STOPS.204,DFT_BUS_STOPS.1198,DFT_BUS_STOPS.2363,DFT_BUS_STOPS.2449,DFT_BUS_STOPS.2450,DFT_BUS_STOPS.1260,DFT_BUS_STOPS.1707,DFT_BUS_STOPS.1699,DFT_BUS_STOPS.1700,DFT_BUS_STOPS.228,DFT_BUS_STOPS.1675,DFT_BUS_STOPS.1711,DFT_BUS_STOPS.1710,DFT_BUS_STOPS.1528,DFT_BUS_STOPS.1706,DFT_BUS_STOPS.1705,DFT_BUS_STOPS.243,DFT_BUS_STOPS.265,DFT_BUS_STOPS.1160,DFT_BUS_STOPS.1261,DFT_BUS_STOPS.227,DFT_BUS_STOPS.1164,DFT_BUS_STOPS.1177,DFT_BUS_STOPS.1736,DFT_BUS_STOPS.985,DFT_BUS_STOPS.263,DFT_BUS_STOPS.1748,DFT_BUS_STOPS.1266,DFT_BUS_STOPS.1178,DFT_BUS_STOPS.1163,DFT_BUS_STOPS.2125,DFT_BUS_STOPS.1061,DFT_BUS_STOPS.1780,DFT_BUS_STOPS.1268,DFT_BUS_STOPS.1747,DFT_BUS_STOPS.1152,DFT_BUS_STOPS.1738,DFT_BUS_STOPS.2531,DFT_BUS_STOPS.251,DFT_BUS_STOPS.1155,DFT_BUS_STOPS.2530,DFT_BUS_STOPS.1151,DFT_BUS_STOPS.1156,DFT_BUS_STOPS.1132,DFT_BUS_STOPS.1073,DFT_BUS_STOPS.1154,DFT_BUS_STOPS.252,DFT_BUS_STOPS.1722,DFT_BUS_STOPS.1723,DFT_BUS_STOPS.1744,DFT_BUS_STOPS.2104,DFT_BUS_STOPS.236,DFT_BUS_STOPS.1721,DFT_BUS_STOPS.1720,DFT_BUS_STOPS.1064,DFT_BUS_STOPS.195,DFT_BUS_STOPS.1745,DFT_BUS_STOPS.369,DFT_BUS_STOPS.1170,DFT_BUS_STOPS.858,DFT_BUS_STOPS.1070,DFT_BUS_STOPS.1193,DFT_BUS_STOPS.1192,DFT_BUS_STOPS.2420,DFT_BUS_STOPS.1670,DFT_BUS_STOPS.1671,DFT_BUS_STOPS.1245,DFT_BUS_STOPS.2412,DFT_BUS_STOPS.2427,DFT_BUS_STOPS.206,DFT_BUS_STOPS.1255,DFT_BUS_STOPS.1256,DFT_BUS_STOPS.1742,DFT_BUS_STOPS.1072,DFT_BUS_STOPS.1133,DFT_BUS_STOPS.1734,DFT_BUS_STOPS.1733,DFT_BUS_STOPS.293,DFT_BUS_STOPS.2447,DFT_BUS_STOPS.2448,DFT_BUS_STOPS.1144,DFT_BUS_STOPS.2347,DFT_BUS_STOPS.249,DFT_BUS_STOPS.1693,DFT_BUS_STOPS.1692,DFT_BUS_STOPS.197,DFT_BUS_STOPS.1142,DFT_BUS_STOPS.1784,DFT_BUS_STOPS.1783,DFT_BUS_STOPS.968,DFT_BUS_STOPS.1785,DFT_BUS_STOPS.1143,DFT_BUS_STOPS.1781,DFT_BUS_STOPS.1782,DFT_BUS_STOPS.202,DFT_BUS_STOPS.986,DFT_BUS_STOPS.862,DFT_BUS_STOPS.2107,DFT_BUS_STOPS.247,DFT_BUS_STOPS.898,DFT_BUS_STOPS.237,DFT_BUS_STOPS.248,DFT_BUS_STOPS.1191,DFT_BUS_STOPS.1265,DFT_BUS_STOPS.927,DFT_BUS_STOPS.1737,DFT_BUS_STOPS.261,DFT_BUS_STOPS.262,DFT_BUS_STOPS.1189&SRS=EPSG%3A900913&BBOX=-275784.79880351,6550959.0701793,-275173.30257734,6551570.5664055&WIDTH=256&HEIGHT=256

Now obviously I have hit some sort of limit here, my main question is, is the limit based on the length of the url, or is it based on the amount of FeatureIDs I am filtering by. I think ultimately I am going to have to put a limit in place on the filter, so that if there are more than 120 results (my request failed at 147 FeatureID filters, this gives some wiggle room) the results do not get filtered, unless anyone has any other ideas? Thanks!

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You can use an HTTP POST request to send the filter to GeoServer which will avoid the length limit on the URL. You can use the demos section of GeoServer for testing. Something like:

<?xml version="1.0" encoding="UTF-8"?>

<ogc:GetMap 
xmlns:ogc="http://www.opengis.net/ows"
xmlns:gml="http://www.opengis.net/gml"
version="1.1.1" service="WMS">
<StyledLayerDescriptor version="1.0.0">
<NamedLayer>
 <Name>states</Name>  
 <NamedStyle>
  <Name>population</Name>
 </NamedStyle>
</NamedLayer>
</StyledLayerDescriptor>
<BoundingBox srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
<gml:coord>
<gml:X>-130.0</gml:X> 
<gml:Y>24.0</gml:Y>
</gml:coord>
<gml:coord>
<gml:X>-66.0</gml:X>
<gml:Y>50.0</gml:Y>
</gml:coord>
</BoundingBox>
<Output><Format>image/png</Format>
<Size>
<Width>600</Width>
<Height>320</Height>
</Size>
</Output>
<Exceptions>application/vnd.ogc.se+xml</Exceptions>
</ogc:GetMap>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.