Ahh, ok.  I'm not sure in what fashion you are using TileCache, but my
experience has been with using it to create tiles to display in Google
Maps.  Google Maps uses the projection which is EPSG:900913.  I
believe there are other codes for it, but that is the one I use.

All of my source data for the MapServer projects I make are in
EPSG:4326.  So there are 3 things I need to do in order to make the
Tilecache output tiles align correctly in Gmaps.

1. I set both the mapfile and the layer projections to EPSG:4326.
MAP
  NAME  'v2_80m_global'
  PROJECTION
    "init=epsg:4326"
  END

  LAYER
    NAME 'imagery'
    PROJECTION
      "init=epsg:4326"
    END
<snip...>

2. I explicity allow for a wms request to be made for the layer in
EPSG:900913 by setting the following in my MapServer LAYER:
    METADATA
      "wms_srs"             "EPSG:4326 EPSG:900913"
<snip...>

3. I define my TileCache layer so that it requests images from
Mapserver in EPSG:900913.
[v2_20m_global]
type=MapServerLayer
mapfile=/var/www/mapfiles/v2_20m_global/v2_20m_global.map
metaTile=true
metaSize=2,2
metaBuffer=0,500
layers=imagery
spherical_mercator=true
srs=EPSG:900913

That's what works for me.

Roger
--

On Thu, May 21, 2009 at 5:24 AM, Chad Clabaugh <[email protected]> wrote:
> Thank you Roger, for your response.  I have done that but I do not
> understand how tilecache works.  The images that are returned from mapserver
> line up perfectly. But the images returned from tilecache do not align very
> well (they're distorted).  If tilecache is simply caching the returned
> images then I do not understand where this distortion comes from.  Any
> thoughts?
>
> Thanks!
>
> -----Original Message-----
> From: Roger André [mailto:[email protected]]
> Sent: Wednesday, May 20, 2009 11:46 PM
> To: Chad Clabaugh
> Cc: [email protected]
> Subject: Re: [mapserver-users] Precache
>
> Your request is somewhat lacking in detail, but assuming that your
> goal is a simple one, here is one way to accomplish this.
>
> 1. Create a MapServer project that displays your shapefile in whatever
> style you choose.
> 2. Setup a TileCache instance that points to your MapServer project.
> 3. Run the tilecache_seed.py script to pre-generate tiles.
>
> Roger
> --
>
> On Wed, May 20, 2009 at 12:16 PM, Chad Clabaugh <[email protected]>
> wrote:
>> How can I precache tile images from shapefiles?
>>
>>
>>
>> Thanks
>>
>>
>>
>> Chad Clabaugh
>>
>> Technical Support, Engineering
>>
>> Office: 260.760.6398
>>
>> Mobile: 260.466.8861
>>
>>
>>
>> _______________________________________________
>> mapserver-users mailing list
>> [email protected]
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>
>>
>
>
>
_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to