Closed sconnelley closed 7 years ago
It's been a while since I did something like that, but I'd assume Pixel Size
is the same as resolution
; that is, resolution is projected units per pixel, which is the same as a pixel's size.
thanks @perliedman, I still don't know exactly what to do with the Pixel Size
values?
Well, the pixel size is the resolution of the tiff, wasn't that what you asked in the question?
Sorry yes, I wasn't very clear with my response. I plugged in the positive Pixel Size
number and wasn't seeing any improvement, but I finally figured out I needed the bounds
property configured. Everything seems to be working pretty good, but placing markers tend to be a little off (20 pixels or so) when compared to a standard leaflet instantiation.
Here is what I came up with:
return new L.Proj.CRS('EPSG:4326',
'+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs',
{
origin: [-90.307150990844619, 38.722811704256983],
resolutions: [
...,
0.000004756579429 // Positive Pixel Size from gdalinfo
],
bounds: L.bounds([-90.3071510, 38.7228117], [-90.1801741, 38.5330955])
}
)
Thanks for your time
Huh, that's weird (the offset, I mean). BTW, you should be fine with just bounds, origin is calculated from the bounds if they are provided, IIRC.
Looking for help in calculating the resolution values for a geotiff tiled with
gdal2tiles.py
with profile set to 'raster'. Here is the output fromgdalinfo.py
: