WMTS GetCapabilities request

9529
9
06-26-2012 10:00 AM
by Anonymous User
Not applicable
Original User: Michael-1138

After a fair amount of trial and error I am almost able to view a GeoServer WMTS layer in Flex Viewer 3.0. The final(?) problem seems to be related to the WMTS GetCapabilities request.

Looking at the Firebug responses I can see that the viewer is able to communicate with GeoServer as the request status returns 200 OK, same as the ArcGIS Server tiled and dynamic services that are successfully displayed. The difference is that, while the Response tab for the ArcGIS Server requests are populated with their capabilities, the tab is empty for the GeoServer request.

I know the Flex Viewer request is formatted correctly because when I copy and paste the web address used in the request directly into the browser address bar a WMTS capabilities document is returned, but the browser will not display it. I need to save the returned capabilities document as an XML/TXT file before I can read it.

Is there something I need to configure on the Windows 2003 server the Flex Viewer apps are served from so it can recognize what GeoServer returns, or is there a setting in GeoServer that needs to be changed so the GetCapabilities document is formatted differently?

I have attached the capabilities document returned by GeoServer and the MAP section of the config.xml in case the solution can be found in them.

Software and servers involved:
Flash Builder 4.6
ArcGIS API for Flex 3.0
GeoServer 2.1.4
Windows 2003 Server (both app and wms servers)


- Michael
0 Kudos
9 Replies
ChenfengXiong
New Contributor
I met exactly the same problem as you have. Geoserver's "GetCapabilities" response shows nothing in WMTSLayer.

I'm doubting it is a bug of WMTSLayer class. Hope someone come out to explain it.
0 Kudos
by Anonymous User
Not applicable
Original User: dpaddock

It may just be a limitation of Firebug where it doesn't show the response since Firefox doesn't want to show the response either. This is based on the response's content-type header. Flex can read the response regardless what the content-type header is. You can try another Firefox plugin like HttpFox or try a tool like Charles Proxy or Fiddler.
0 Kudos
MichaelSmith2
New Contributor III
HTTPFox shows that the viewer is receiving the full GetCapabilities request and is correctly formatting it. Does this mean that the WMTS support in the viewer is only for ESRI generated WMTS, not third-party WMTS?
0 Kudos
by Anonymous User
Not applicable
Original User: bjorn

Does this mean that the WMTS support in the viewer is only for ESRI generated WMTS, not third-party WMTS?


No, the WMTSLayer should work with both Esri and third-party WMTS.

Do you have a public service?
0 Kudos
MichaelSmith2
New Contributor III
Unfortunately, no. The GeoServer server is behind our firewall. Since I have the nagging sense that I just have a setting off on one side of the transaction or other I was hoping someone else had gone through this and could point me in the right direction.
0 Kudos
by Anonymous User
Not applicable
Original User: sdatt

Hey Michael,

Since your service has one 'layer' and one 'tilematrixset', can you try this for wmts layer in the config(using the defaults):

<layer label="Debris Flow" type="wmts" visible="true" alpha="1.0" imageformat="png" 
               url="http://ip_address:8080/geoserver/gwc/service/wmts" 
               servicemode="KVP"/>
0 Kudos
MichaelSmith2
New Contributor III
My apologies. I needed take care of a number of other things before I could get back to this. In response to your suggested code, I cannot use it as I have more than one layer and tilematixset in GeoServer. I had deleted the information related to the other layers and projections from the GetCapabilities document to make it shorter/more readable.

I have poked around a bit in the manager files to see how the WMTS layer request is actually processed, and, unfortunately, that has only resulted in more questions. The first question is, why does this appear to be based solely on a GetCapabilities document if regular requests are based on a GetTiles request? Or is it just something in the SWC that I cannot get to? The second question is where is the request actually processed? I looked in ConfigManager.as and it provides the base formatting for all layer requests except WMTS.

I referred again to the WMTS sample provided on the Flex API site and noticed that it now works because it exclusively references ArcGIS Online services. Something I noticed while reviewing the sample is that the GetCapabilities request returned by ArcGIS Online is significantly different from the base GeoServer response as it includes ScaleDenominator and TopLeftCorner tags for each level of the TileMatrix, and labels the matrix levels differently than GeoServer. I will assume that the WMTS capabilities built into the 3.0 API are based on how ArcGIS Online formats its GetCapabilities request as it would make sense that ESRI APIs are based on ESRI products.

Is there documentation somewhere that we can use to edit our capabilites XSL stylesheet so that the document returned is formatted in a way that the ESRI Flex API can understand? I think that the different formats could be significant in determining whether or not the tiles end up being delivered to the viewer since the viewer can display the GeoServer WMS service the WMTS service is based on. Since both come from the same GeoServer installation and the main difference between accessing the two is a slight change to the URL a translation issue related to the returned GetCapabilities request does not seem too far fetched.
0 Kudos
by Anonymous User
Not applicable
Original User: bjorn

I will assume that the WMTS capabilities built into the 3.0 API are based on how ArcGIS Online formats its GetCapabilities request as it would make sense that ESRI APIs are based on ESRI products.


That's an incorrect assumption. 

The WMTS layer works with non-Esri WMTS services.  There just isn't a lot of them in public that we can use for our samples.

If you share a less-shortened example somebody might be able to help with your specific setup.
0 Kudos
MichaelSmith2
New Contributor III
I did finally get the GeoServer WMTS to work in the app I was working on. The problem, for me, was that something did not like that I was mixing services from ArcGIS Server and GeoServer WMTS, and even though everything was in the same projection they would not both draw. Once I removed my ArcGIS Server services from the app the Flex API worked like a charm. So for that particular app I stopped using services from ArcGIS and made it so all services were coming from GeoServer.

Now, that said, I know that ESRI built the capability to mix services from multiple providers into the API. The fact that I could not get it to work with the services I am using was my fault.

- Michael
0 Kudos