What happens if you use tiffcp to create a tiled raster?

  tiffcp -t your-input.tif your-tiled-raster.tif

Then manually set the lox,loy, hix,hiy bounds in your mapnik file and
use the raster input instead of gdal? I was having a similar gdal
issue and artem suggested using the raster input which is working much
better for me.

Your datasource should look something like:

<Datasource>
  <Parameter name="type">raster</Parameter>
  <Parameter name="file">/mapnik/data/raster/your-tiled-raster.tif</Parameter>
  <Parameter name="lox">1113148.557</Parameter>
  <Parameter name="loy">6446203.745</Parameter>
  <Parameter name="hix">1669798.557</Parameter>
 <Parameter name="hiy">6446203.745</Parameter>
</Datasource>

From there you can split your geotiff into as many layers as you see
fit. I ended up using openlayers and the moveend event to fire off a
function that gets the appropriate layers for the current bounding box
so I'm not loading too many layers at once.

Hope this helps,
Matt

On Tue, Dec 2, 2008 at 2:01 AM, Jürgen Spille
<[EMAIL PROTECTED]> wrote:
>
>
> Hi,
>
> Peter, thanks for your hint. I tried to split the tiff into small pieces. But 
> also no success.
>
> Here is the gdalinfo of my first, big GTiff:
> Driver: GTiff/GeoTIFF
> Files: srtm_39_03_900913_hillshade.tif
> Size is 18555, 27490
> Coordinate System is:
> PROJCS["unnamed",
>    GEOGCS["unnamed ellipse",
>        DATUM["unknown",
>            SPHEROID["unnamed",6378137,0]],
>        PRIMEM["Greenwich",0],
>        UNIT["degree",0.0174532925199433]],
>    PROJECTION["Mercator_1SP"],
>    PARAMETER["central_meridian",0],
>    PARAMETER["scale_factor",1],
>    PARAMETER["false_easting",0],
>    PARAMETER["false_northing",0],
>    UNIT["metre",1,
>        AUTHORITY["EPSG","9001"]]]
> Origin = (1113148.557154602400000,6446203.744899881100000)
> Pixel Size = (30.000000000000000,-30.000000000000000)
> Metadata:
>  AREA_OR_POINT=Area
> Image Structure Metadata:
>  INTERLEAVE=BAND
> Corner Coordinates:
> Upper Left  ( 1113148.557, 6446203.745) (  9d59'58.50"E, 49d59'58.50"N)
> Lower Left  ( 1113148.557, 5621503.745) (  9d59'58.50"E, 44d59'59.59"N)
> Upper Right ( 1669798.557, 6446203.745) ( 15d 0'0.20"E, 49d59'58.50"N)
> Lower Right ( 1669798.557, 5621503.745) ( 15d 0'0.20"E, 44d59'59.59"N)
> Center      ( 1391473.557, 6033853.745) ( 12d29'59.35"E, 47d33'33.59"N)
> Band 1 Block=18555x1 Type=Byte, ColorInterp=Gray
>  NoData Value=32767
>
> and here the gdalinfo of one of the small pieces:
> Driver: GTiff/GeoTIFF
> Files: srtm_39_03_900913_hillshade_oa.tif
> Size is 1812, 1976
> Coordinate System is:
> PROJCS["unnamed",
>    GEOGCS["unnamed ellipse",
>        DATUM["unknown",
>            SPHEROID["unnamed",6378137,0]],
>        PRIMEM["Greenwich",0],
>        UNIT["degree",0.0174532925199433]],
>    PROJECTION["Mercator_1SP"],
>    PARAMETER["central_meridian",0],
>    PARAMETER["scale_factor",1],
>    PARAMETER["false_easting",0],
>    PARAMETER["false_northing",0],
>    UNIT["metre",1,
>        AUTHORITY["EPSG","9001"]]]
> Origin = (1114078.557154602400000,6054943.744899881100000)
> Pixel Size = (30.000000000000000,-30.000000000000000)
> Metadata:
>  AREA_OR_POINT=Area
> Image Structure Metadata:
>  INTERLEAVE=BAND
> Corner Coordinates:
> Upper Left  ( 1114078.557, 6054943.745) ( 10d 0'28.58"E, 47d41'13.28"N)
> Lower Left  ( 1114078.557, 5995663.745) ( 10d 0'28.58"E, 47d19'38.31"N)
> Upper Right ( 1168438.557, 6054943.745) ( 10d29'46.54"E, 47d41'13.28"N)
> Lower Right ( 1168438.557, 5995663.745) ( 10d29'46.54"E, 47d19'38.31"N)
> Center      ( 1141258.557, 6025303.745) ( 10d15'7.56"E, 47d30'26.91"N)
> Band 1 Block=1812x4 Type=Byte, ColorInterp=Gray
>  NoData Value=32767
>
>
> The SRS of my map is:
>
> <Map srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 
> +y_0=0 +k=1.0 +units=m [EMAIL PROTECTED] +no_defs +over">
>
> I generate the map with TileCache and the hillshading was generated using the 
> instructions of this site:
> http://wiki.openstreetmap.org/wiki/HikingBikingMaps#Hill_Shading
>
> My idea was, to merge all my DEM-tiles (covering almost whole Europe) to a 
> BigTiff and then generate one big shaded relief with pyramids, one for every 
> zoomlevel. I want to avoid using dozens of layers only for the shading. Is 
> that a wrong way? I liked the possibility to use an image mosaic in Mapserver 
> or Geoserver. I didn't found a similar way together with gdal.
>
> regards
> Jürgen
>
>
> -------- Original Message --------
> Subject: Re: [Mapnik-users]  Problems with raster data (01-Dez-2008 21:57)
> From:    BP <[EMAIL PROTECTED]>
> To:      [EMAIL PROTECTED]
>
>> Hi!
>>
>> I'm a newbee working on a project to make a good looking map based on
>> turistautak.hu database (it is about hiking trails). It is still under
>> development on a temporary site. (peterbus.extra.hu/tuhu)
>> Anyway I had the same problem. The GeoTiff was too big.
>> My solution was to slice it up (or merge smaller bounds from srtm) and
>> feed in several layers.
>> At least it worked for me. (It is not uploaded yet to the site)
>>
>> Regards
>> Peter
>>
>> spillocaster írta:
>> > Hi all,
>> >
>> > I was testing now a couple of hours, but I can't find the problem. I simply
>> > want to display a shading with a GeoTiff, but it doesn't work.
>> >
>> > My XML-Style:
>> >     <Style name="raster">
>> >             <Rule>
>> >                     <RasterSymbolizer>
>> >                     </RasterSymbolizer>
>> >             </Rule>
>> >     </Style>
>> >
>> > My Layer:
>> >   <Layer name="shading" status="on" srs="+proj=merc +a=6378137 +b=6378137
>> > +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m [EMAIL PROTECTED]
>> > +no_defs +over">
>> >     <StyleName>raster</StyleName>
>> >     <Datasource>
>> >             <Parameter name="type">gdal</Parameter>
>> >             <Parameter
>> > name="file">/mapnik/data/raster/39_03_900913_hillshade.tif</Parameter>
>> >             <Parameter name="format">tiff</Parameter>
>> >     </Datasource>
>> >   </Layer>
>> >
>> > My system:
>> > Debian-linux 2.6.24-etchnhalf.1-686
>> >
>> > My map projection is in spherical mercator and so I warped my rasterfile
>> > also to the same srs. With "tiffinfo" on my GeoTiff, I get this info:
>> >
>> > TIFFReadDirectory: Warning, Unknown field with tag 33550 (0x830e)
>> > encountered.
>> > TIFFReadDirectory: Warning, Unknown field with tag 33922 (0x8482)
>> > encountered.
>> > TIFFReadDirectory: Warning, Unknown field with tag 34735 (0x87af)
>> > encountered.
>> > TIFFReadDirectory: Warning, Unknown field with tag 34736 (0x87b0)
>> > encountered.
>> > TIFFReadDirectory: Warning, Unknown field with tag 34737 (0x87b1)
>> > encountered.
>> > TIFFReadDirectory: Warning, Unknown field with tag 42113 (0xa481)
>> > encountered.
>> > TIFF Directory at offset 0x1e6a83b8 (510297016)
>> >   Image Width: 18555 Image Length: 27490
>
>
> To: [EMAIL PROTECTED]
> Cc: [email protected]
> _______________________________________________
> Mapnik-users mailing list
> [email protected]
> https://lists.berlios.de/mailman/listinfo/mapnik-users
>
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to