bbox and ImageLayer

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

bbox and ImageLayer

Mikel Maron
Hi

I'm trying to set up an ImageLayer in TileCache. The bbox covers a small area, and I want the TMS requests to correspond with spherical mercator style; a particular tile request to OSM should correspond geographically to the same tile request against this image.

However, the requests against the TileCache aren't acting as I'd expect ... a request for /0/0/0.png retrieves the image, resized to 256x256, rather than a zoomed out world view.

This is my current configuration

[health_meeting_1_group_3]
type=ImageLayer
bbox=36.771332811,-1.325321221,36.80718373,-1.300412621
filebounds=36.771332811,-1.325321221,36.80718373,-1.300412621
file=/var/www/aerial.maps.jsintl.org/data/IMG_6275-trimmed.JPG
tms_type=google

The OpenLayers config

                        var health_meeting_1_group_3 = new OpenLayers.Layer.TMS( "Health1-3",
                        "http://aerial.maps.jsintl.org/tilecache/tilecache.cgi/1.0.0/health_meeting_1_group_3/",
                                                { type: 'png', getURL: osm_getTileURL, numZoomLevels:20 } );

Any pointers?

Best
Mikel
 
== Mikel Maron ==
+254(0)724899738 @mikel s:mikelmaron
http://mapkibera.org/
http://wiki.openstreetmap.org/index.php/Haiti


_______________________________________________
Tilecache mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/tilecache
Reply | Threaded
Open this post in threaded view
|

Re: bbox and ImageLayer

christopher.schmidt
On Apr 27, 2010, at 1:40 PM, ext Mikel Maron wrote:

> Hi
>
> I'm trying to set up an ImageLayer in TileCache. The bbox covers a small area, and I want the TMS requests to correspond with spherical mercator style; a particular tile request to OSM should correspond geographically to the same tile request against this image.

1. Your image isn't in spherical mercator. Since TileCache has no support for reprojection, this is very much not going to work. You will need to reproject your image first.
2. Setting the bbox and filebounds to the same thing isn't going to work. The bbox should match the maxExtent of the OpenLayers layer you want to create -- which in this case, is the spherical mercator extent. (The same is true of resolution.) You can set both of these via spherical_mercator=true.
3. Once you reproject the image to spherical mercator, you'll need to make sure the filebounds map to the spherical mercator coordinates, not the lat/lon coords.

-- Chris



> However, the requests against the TileCache aren't acting as I'd expect ... a request for /0/0/0.png retrieves the image, resized to 256x256, rather than a zoomed out world view.
>
> This is my current configuration
>
> [health_meeting_1_group_3]
> type=ImageLayer
> bbox=36.771332811,-1.325321221,36.80718373,-1.300412621
> filebounds=36.771332811,-1.325321221,36.80718373,-1.300412621
> file=/var/www/aerial.maps.jsintl.org/data/IMG_6275-trimmed.JPG
> tms_type=google
>
> The OpenLayers config
>
>                         var health_meeting_1_group_3 = new OpenLayers.Layer.TMS( "Health1-3",
>                         "http://aerial.maps.jsintl.org/tilecache/tilecache.cgi/1.0.0/health_meeting_1_group_3/",
>                                                 { type: 'png', getURL: osm_getTileURL, numZoomLevels:20 } );
>
> Any pointers?
>
> Best
> Mikel
>  
> == Mikel Maron ==
> +254(0)724899738 @mikel s:mikelmaron
> http://mapkibera.org/
> http://wiki.openstreetmap.org/index.php/Haiti
>
> <ATT00001..txt>

_______________________________________________
Tilecache mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/tilecache
Reply | Threaded
Open this post in threaded view
|

Re: bbox and ImageLayer

Mikel Maron

Hi Chris

> 1. Your image isn't in spherical mercator. Since TileCache has no support for reprojection, this is very much not going to work. You will need to reproject your image first.
> 2. Setting the bbox and filebounds to the same thing isn't going to work. The bbox should match the maxExtent of the OpenLayers layer you want to create -- which in this case, is the spherical
> mercator extent. (The same is true of resolution.) You can set both of these via spherical_mercator=true.                         
> 3. Once you reproject the image to spherical mercator, you'll need to make sure the filebounds map to the spherical mercator coordinates, not the lat/lon coords.

Ok ... I've tried the following configuration. I haven't yet reprojected the image ... I'm hoping with such a small scale image it won't be necessary, so as not to introduce any distortions.

Here's the new configuration ... but only getting blank white tiles now.

[health_meeting_1_group_3]
type=ImageLayer
bbox=-20037508, -20037508, 20037508, 20037508.34
#filebounds=36.771332811,-1.325321221,36.80718373,-1.300412621
filebounds=-147534.08,4407281.28,-144761.27,4412264.65
file=/var/www/aerial.maps.jsintl.org/data/handdrawn/IMG_6275-trimmed.PNG
tms_type=google
spherical_mercator=true

I'm probably missing something obvious. Any further pointers?

Thanks
Mikel

_______________________________________________
Tilecache mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/tilecache