global raster data rendered incorrectly #1480

Closed
yarray opened this Issue Sep 12, 2012 · 7 comments

Projects

None yet

3 participants

@yarray
yarray commented Sep 12, 2012

I came across the issue when using tilestache with mapnik to render a global raster data. And I found the rightest column of tiles are always messy color lines. After some experiments, the simplest case of this issue is as belows:

data:

http://129.123.16.127/globe/TrueMarble_GeoTIFF/TrueMarble.32km.1350x675.tif.gz

map file(TrueMarble.32km.1350x675.tif.xml):

<?xml version="1.0" encoding="utf-8"?>
<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 +nadgrids=@null +no_defs" background-color="rgba(0,0,0,0)" base="resources" maximum-extent="-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892">
    <Style name="style">
        <Rule>
            <RasterSymbolizer/>
        </Rule>
    </Style>
    <Layer name="TrueMarble.32km.1350x675.tif" srs="+proj=longlat +datum=WGS84 +no_defs ">
        <StyleName>style</StyleName>
        <Datasource>
            <Parameter name="file">TrueMarble.32km.1350x675.tif</Parameter>
            <Parameter name="type">gdal</Parameter>
        </Datasource>
    </Layer>
</Map>

And I use a python script to render it:

import mapnik

map = mapnik.Map(1024, 1024)
mapnik.load_map(map, 'TrueMarble.32km.1350x675.tif.xml')
map.zoom_all()
mapnik.render_to_file(map, 'example.png')

Here is the result picture. Sorry I don't know how to embed it here.

http://flic.kr/p/da6W4Z

Tested on mapnik 2.0.1 and 2.1.0

@artemp
Member
artemp commented Sep 13, 2012

looks like gdal.input issue, I get correctly reprojected tiff using raster.input :

<?xml version="1.0" encoding="utf-8"?>
<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 +nadgrids=@null +no_defs" background-color="rgba(0,0,0,0)" base="resources" maximum-extent="-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892">
    <Style name="style">
        <Rule>
            <RasterSymbolizer/>
        </Rule>
    </Style>
    <Layer name="TrueMarble.32km.1350x675.tif" srs="+proj=longlat +datum=WGS84 +no_defs ">
        <StyleName>style</StyleName>
        <Datasource>
            <Parameter name="file">TrueMarble.32km.1350x675.tif</Parameter>
            <Parameter name="type">raster</Parameter>
            <Parameter name="extent">-180,-90,180,90</Parameter>
        </Datasource>
    </Layer>
</Map>

@yarray - Thanks for reporting!

@springmeyer springmeyer referenced this issue in tilemill-project/tilemill Sep 14, 2012
Closed

mapnik 2.1.1 fixes #1683

@yarray
yarray commented Sep 14, 2012

Thank you for your quick & kind reply! I tried your xml, but it seems raster datasource cannot deal with multi-band tiff like this, and I got only a blank picture. Did I get anything wrong?

@springmeyer
Member

@yarray that makes sense. We will try to fix for the gdal datasource soon. In the meantime you should be able to workaround this by projecting your faster ahead of time using gdal warp.

@yarray
yarray commented Sep 14, 2012

@springmeyer Ok, thank you. It is a good workaround for me now.

@artemp
Member
artemp commented Sep 19, 2012

@yarray @springmeyer - 97463ab should fix this

@springmeyer
Member

I was unable to replicate any problem with the test case. Basically that file seems to reproject file, without distortions. I do however see other problems, so I've created another issue specific to a single dataset that exhibits problems more predictably. See #1500

@springmeyer
Member

closing, will track at #1500.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment