Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm new to GIS so this may be trivial: I'm using MapFish Print to create some PNG. I have issues to place the viewport. When I use a random GPS coordinate: -20.904522,55.475106 which seem to point roughly (<20m accuracy) to the same place in google and in openstreetmap.org, my viewport in MapFish Print is way up north (more than 100km).

What did I miss ?

Here's my config (I've commented some lines that I did try):

{
  layout: 'A5 landscape',
  title: '',
  units: 'dd',
  #srs: 'EPSG:900913',
  srs: 'EPSG:4326',
  #srs: 'EPSG:3857',
  #geodetic: true,
  #geodetic: false,
  outputFilename: 'mapfish-print',
  outputFormat: 'pdf',
  layers: [
    {
        type: 'OSM',
        format: 'image/png',
        baseURL: 'http://tile.openstreetmap.org/',
        ## This one seems incorrect and sets the 0,0 several
        ## thousand kilometer in the north
        #maxExtent: [-180,-90, 180, 90],
        maxExtent: [-180,-180, 180, 180],
        #srs: 'EPSG:900913',
        #geodetic: false,
        tileSize: [256, 256],
        resolutions : [
          1.40625, 0.703125, 0.3515625, 0.17578125, 0.087890625, 
          0.0439453125, 0.02197265625, 0.010986328125, 0.0054931640625, 
          0.00274658203125, 0.001373291015625, 0.0006866455078125, 
          0.00034332275390625, 0.000171661376953125, 0.0000858306884765625, 
          0.00004291534423828125],
        extension: 'png',
    },
  ],
  pages: [
    {
        center: [55.475106, -20.904522],
        #center: [0, 0],
        #srs: 'EPSG:4326',
        srs: 'EPSG:900913',
        #srs: 'EPSG:3857',
        geodetic: false,
        #geodetic: true,
        scale: 500000,
        dpi: 190,
        mapTitle: "",
        comment: "",
    }
  ]
}
share|improve this question
    
I'm not familiar with MapFish, so this could be irrelevant, but what's the deal with maxExtent: [-180,-180, 180, 180]? I would assume this means your north and south bounds are much further away than they should be, which could be skewing distances –  tomfumb Aug 17 '12 at 17:36
    
@tomfumb: if I set maxExtent: [-180, -90, 180, 90], the localisation error spans on several thousand kilometer to the north (several order of magnitude worse than the current error). I have no idea why. –  vaab Aug 20 '12 at 6:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.