[OpenLayers-Users] TileCache w/ Mapserver WMS question

Matthew Perry perrygeo at gmail.com
Tue Dec 5 13:57:11 EST 2006


On 12/5/06, Christopher Schmidt <crschmidt at metacarta.com> wrote:
> Can you check your server log and see what URL it's actually requesting?
> This error message means "The WMS server gave me no data", but without
> knowing the WMS URL, it's hard to know why. (TileCache is unfortunately
> not the most informative in this situation.)

That's just the problem.. tilecache isn't requesting any WMS urls at
all. The apache access logs show no WMS requests (but plenty of
tilecache.py requests ;-)

I modified Client.WMS.fetch to print out self.url() and can confirm
that the URL passed into urllib2.Request() is a valid one according to
my browser:

http://ebm.nceas.ucsb.edu/cgi-bin/mapserv?map=/maps/threats.map&layers=nedrape&styles=&service=WMS&width=256&format=image%2Fpng&request=GetMap&height=256&srs=EPSG%3A4326&version=1.1.1&bbox=-45.0%2C0.0%2C0.0%2C45.0

But for some reason, urllib2 doesn't like it and throws a 404. Yes a
404 even though no wms requests make it to the our apache server. You
can test it out with the following python snippet.. I'll let you know
if it shows up in my logs!
----------------
import urllib2
url = 'http://ebm.nceas.ucsb.edu/cgi-bin/mapserv?map=/maps/threats.map&layers=nedrape&styles=&service=WMS&width=256&format=image%2Fpng&request=GetMap&height=256&srs=EPSG%3A4326&version=1.1.1&bbox=-45.0%2C0.0%2C0.0%2C45.0'
urlrequest = urllib2.Request(url)
client = urllib2.build_opener()
response = client.open(urlrequest)
----------------

So it would appear that the url constructed by tilecache doesn't site
well with urllib2.

Just FYI, I moved from using a WMSLayer to a MapServerLayer to bypass
this problem but I thought everyone should know about it.

-- 
Matthew T. Perry
GIS Analyst / Software Engineer
National Center for Ecological Analysis and Synthesis (NCEAS)
work: perry at nceas.ucsb.edu
web: http://www.perrygeo.net



More information about the Users mailing list