GeoWebCache / geowebcache

GeoWebCache is a tile caching server implemented in Java that provides various tile caching services like WMS-C, TMS, WMTS, Google Maps, MS Bing and more
https://www.geowebcache.org
343 stars 281 forks source link

GeoWebcache gmaps gridsubsets problem #124

Open tevbrasch opened 12 years ago

tevbrasch commented 12 years ago

It seems that you will not get a gmaps response (tiles) if you use just gridsubsets in your gwc config file, however if you add in the old 'bounds/coords' method, it then starts to work. This is only tested with gmaps v.02 which is predominantly the version used by our users.

The client code is:

var tilelayer = new GTileLayer(null, null, null, { tileUrlTemplate: 'http://skrivte58:8080/geowebcache/service/gmaps?layers=topo23&zoom={Z}&x={X}&y={Y}', isPng:true, opacity:1.0 } );

and the geowebcache.xml wms_layer config looks like this: (GeoWebCache version 1.3-RC3, built 2012-05-08)

'''>

 <name>topo23</name>
 <mimeFormats>
   <string>image/jpeg</string>
   <string>image/png</string>
 </mimeFormats>
 <formatModifiers>
   <formatModifier>
     <responseFormat>image/jpeg</responseFormat>
     <requestFormat>image/png; mode=24bit</requestFormat>
     <transparent>false</transparent>
     <bgColor>0xFFFFFF</bgColor>

     <compressionQuality>0.7</compressionQuality>
   </formatModifier>
 </formatModifiers>
   <gridSubsets>
           <gridSubset>
                   <gridSetName>900913</gridSetName>
                   <extent>
                           <coords>
                                   <double>-20037508.34</double>
                                   <double>-20037508.34</double>
                                   <double>20037508.34</double>
                                   <double>20037508.34</double>
                   </coords>
                   </extent>
                   <zoomStart>0</zoomStart>
                   <zoomStop>20</zoomStop>
           </gridSubset>
   </gridSubsets>
   <wmsUrl>
   <string>http://skrivap60/cgi-bin/topo2</string>
   <string>http://skrivap61/cgi-bin/topo2</string>
 </wmsUrl>
 <wmsLayers>topo2_WMS</wmsLayers>
 <wmsStyles>default</wmsStyles>
 <metaWidthHeight>
   <int>2</int>
   <int>2</int>
 </metaWidthHeight>
 <gutter>100</gutter>
 <tiled>false</tiled>
 <expireCacheList>
   <expirationRule minZoom="0" expiration="604800"/>
   <expirationRule minZoom="13" expiration="604800"/>
 </expireCacheList>
 <expireClientsList>
   <expirationRule minZoom="0" expiration="604800"/>
 </expireClientsList>
 <transparent>true</transparent>
 <errorMime>application/vnd.ogc.se_xml</errorMime>
 <bgColor/>
 <palette/>
 <vendorParameters/>

'''

This returns nothing at all to the client. However if I add to the section with:

'''>

   <entry>
     <srs>
       <number>900913</number>
     </srs>
     <grid>
       <srs>
         <number>900913</number>
       </srs>
       <dataBounds>
         <coords>
           <double>-20037508.34</double>
           <double>-20037508.34</double>
           <double>20037508.34</double>
           <double>20037508.34</double>
         </coords>
       </dataBounds>
       <gridBounds>
         <coords>
           <double>-20037508.34</double>
           <double>-20037508.34</double>
           <double>20037508.34</double>
           <double>20037508.34</double>
         </coords>
       </gridBounds>
       <zoomStart>0</zoomStart>
       <zoomStop>19</zoomStop>
     </grid>
   </entry>
 </grids>'''

it works and I get tiles back.

I assume that the gridsubset method should work for gmaps as well as OL.

best regards

Tom

tevbrasch commented 12 years ago

Just a quick addition, the access error message I get back when I try and use just gridsubsets with a gmaps client is:

09 Aug 10:25:39 ERROR [geowebcache.GeoWebCacheDispatcher] - null http://xxxxxxxxx/geowebcache/service/gmaps java.lang.NullPointerException at org.geowebcache.layer.wms.WMSLayer.getTile(WMSLayer.java:280) at org.geowebcache.GeoWebCacheDispatcher.handleServiceRequest(GeoWebCacheDispatcher.java:353) at org.geowebcache.GeoWebCacheDispatcher.handleRequestInternal(GeoWebCacheDispatcher.java:244) at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:615) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:679)