Difficulty with positioning mapnik images generated from a geotiff

20 views
Skip to first unread message

mbaz...@hailstrike.com

unread,
Oct 7, 2016, 11:57:24 PM10/7/16
to Tilestache
I'm attempting to use TileStache to display radar images over the US, but the images instead appear over the ocean and parts of northern Europe. It doesn't seem to matter what changes I make to the configuration files, the image just won't move. I've attempted reprojecting it from WGS84 to spherical mercator, as well, with no luck.
Here's a sample of the mapnik xml I've tried:
<Map srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" maximum-extent="-126.0025 23.0025 -65.0025 50.0025">

 
<Style name="My Style">
   
<Rule>
       
<RasterSymbolizer />
   
</Rule>
 
</Style>

 
<Layer name="world" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
   
<StyleName>My Style</StyleName>
   
<Datasource>
     
<Parameter name="type">gdal</Parameter>
     
<Parameter name="file">test.tif</Parameter>
   
</Datasource>
 
</Layer>

</Map>

And TileStache config:
{
 
"cache":
 
{
   
"name": "Disk",
   
"path": "/tmp/stache",
   
"umask": "0000"
 
},
 
"layers":
 
{
   
"precip":
   
{
       
"provider":{"name":"mapnik", "mapfile":"test2.xml"},
       
"projection":"WGS84",
       
"allowed origin":"*"
   
}
 
}
}


And for good measure, the gdalinfo for one of the geotiff files:
Driver: GTiff/GeoTIFF
Files: test.tif
Size is 12200, 5400
Coordinate System is:
GEOGCS
["WGS 84",
    DATUM
["WGS_1984",
        SPHEROID
["WGS 84",6378137,298.257223563,
            AUTHORITY
["EPSG","7030"]],
        AUTHORITY
["EPSG","6326"]],
    PRIMEM
["Greenwich",0],
    UNIT
["degree",0.0174532925199433],
    AUTHORITY
["EPSG","4326"]]
Origin = (-126.002499999999998,50.002499999999998)
Pixel Size = (0.005000000000000,-0.005000000000000)
Metadata:
  AREA_OR_POINT
=Area
Image Structure Metadata:
  INTERLEAVE
=PIXEL
Corner Coordinates:
Upper Left  (-126.0025000,  50.0025000) (126d 0' 9.00"W, 50d 0' 9.00"N)
Lower Left  (-126.0025000,  23.0025000) (126d 0' 9.00"
W, 23d 0' 9.00"N)
Upper Right ( -65.0025000,  50.0025000) ( 65d 0'
9.00"W, 50d 0' 9.00"N)
Lower Right ( -65.0025000,  23.0025000) ( 65d 0' 9.00"W, 23d 0' 9.00"N)
Center      ( -95.5025000,  36.5025000) ( 95d30' 9.00"
W, 36d30' 9.00"N)
Band 1 Block=12200x1 Type=Byte, ColorInterp=Red
  NoData Value=0
Band 2 Block=12200x1 Type=Byte, ColorInterp=Green
  NoData Value=0
Band 3 Block=12200x1 Type=Byte, ColorInterp=Blue
  NoData Value=0
Band 4 Block=12200x1 Type=Byte, ColorInterp=Alpha
  NoData Value=0

I'm using using mod_wsgi to host TileStache, if that makes any difference.

mbaz...@hailstrike.com

unread,
Oct 8, 2016, 11:19:17 AM10/8/16
to Tilestache
I was finally able to get the image into the proper location using a spherical mercator projection, but I wonder if there isn't some problem with the WGS84 projection.
Reply all
Reply to author
Forward
0 new messages