[Geoserver-users] Colon after namespace

Hello there,

PREAMBLE:

My name is Gissur and I just joined this list since I will be deploying several applications using Geoserver in the near future, sure enough I've already run into trouble. I hope this is too much of a newbie question, since I couldn't find anything on this exact subject online, I started wondering whether I'm not missing something glaringly obvious.

SETUP:

I just set up Geoserver on Windows 2003 Server to serve vector data to an openlayer client through tilecache served up by the latest build of Apache and mod_python. I've already set up the tilecache against another WMS server, so I know that it works fine.

The problem I'm experiencing is that I'm making tilecache cache to the disk(diskcache) at the moment and when I try to cache from Geoserver, tilecache tries to create a directory structure which uses the name of the layer as its parent. The name of the layer is [namespace]:[layername] (topp:layer13 in my case).

Anybody see the problem yet?

Windows 2003 throws a hissy fit if you try to create a directory with a colon (':') in the name, so I get the following:

An error occurred: [Error 22] The directory name is invalid: 'G:/tilecache\\topp:Level_13'
  File "c:\python25\lib\site-packages\TileCache-2.01-py2.5.egg\TileCache\Service.py", line 198, in modPythonHandler
    host )
  File "c:\python25\lib\site-packages\TileCache-2.01-py2.5.egg\TileCache\Service.py", line 182, in dispatchRequest
    return self.renderTile(tile, params.has_key('FORCE'))
  File "c:\python25\lib\site-packages\TileCache-2.01-py2.5.egg\TileCache\Service.py", line 120, in renderTile
    if (data): image = self.cache.set(tile, data)
  File "c:\python25\lib\site-packages\TileCache-2.01-py2.5.egg\TileCache\Caches\Disk.py", line 66, in set
    self.makedirs(dirname)
  File "c:\python25\lib\site-packages\TileCache-2.01-py2.5.egg\TileCache\Caches\Disk.py", line 24, in makedirs
    os.makedirs(path)
  File "C:\Python25\lib\os.py", line 163, in makedirs
    makedirs(head, mode)
  File "C:\Python25\lib\os.py", line 163, in makedirs
    makedirs(head, mode)
  File "C:\Python25\lib\os.py", line 163, in makedirs
    makedirs(head, mode)
  File "C:\Python25\lib\os.py", line 163, in makedirs
    makedirs(head, mode)
  File "C:\Python25\lib\os.py", line 163, in makedirs
    makedirs(head, mode)
  File "C:\Python25\lib\os.py", line 163, in makedirs
    makedirs(head, mode)
  File "C:\Python25\lib\os.py", line 166, in makedirs
    mkdir(name, mode)

So what I really need to know I guess is whether there is any way around this(I assume there is). I tried looking for a way to change the namespace separator(to a dash or what not) but was unable to pinpoint a way to do that.

You guys have any ideas?

Kind regards from Iceland,

Gissur Þórhallsson

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.19.0/1218 - Release Date: 10.1.2008 13:32

Gissur Þórhallsson ha scritto:
...

The problem I’m experiencing is that I’m making tilecache cache to the disk(diskcache) at the moment and when I try to cache from Geoserver, tilecache tries to create a directory structure which uses the name of the layer as its parent. The name of the layer is [namespace]*:*[layername] (topp*:*layer13 in my case).

Anybody see the problem yet?

All the installations of GeoServer + TileCache I'm aware of are under
the linux operating system, where ":" is a legal part of a filename,
so no, I wasn't aware of it.

I think I can suggest a workaround. GeoServer will respond to queries
that do not include the namespace provided the layer is in the default
namespace. For example, this request:
http://geo.openplans.org:8080/geoserver/wms?bbox=-130,24,-66,50&styles=population&Format=image/png&request=GetMap&layers=topp:states&width=550&height=250&srs=EPSG:4326

works also if you name the layer without namespace:
http://geo.openplans.org:8080/geoserver/wms?bbox=-130,24,-66,50&styles=population&Format=image/png&request=GetMap&layers=states&width=550&height=250&srs=EPSG:4326

This is because topp is the default namespace.
So if you put all your layers in the default namespace (or make the
namespace the layers are now into the default one) you can make tilecache work without the column.

Hope this helps
Cheers
Andrea