kartena / Proj4Leaflet

Smooth Proj4js integration with Leaflet.
http://kartena.github.io/Proj4Leaflet/
BSD 2-Clause "Simplified" License
589 stars 173 forks source link

How to count resolutions/scales ? (unclear docs) #146

Closed Olgagr closed 7 years ago

Olgagr commented 7 years ago

I have to project to EPSG:2180. My projection string looks like this:

+proj=tmerc +lat_0=0 +lon_0=19 +k=0.9993 +x_0=500000 +y_0=-5300000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs

According to docs I should setup resolutions or scales. However, this is not clear for me how should I do it. I found somewhere that resolution should be count like this:

resolution = ScaleDenominator * PixelWidth

Is this correct ? Can we provide more clear docs on this topic ?

perliedman commented 7 years ago

Resolution is the number of projected units per pixel (meters per pixel, in the case of EPSG:2180), scale is the same but inverted, so the number of pixels per meter.

You will have to get these numbers from your tile set.

I guess this could be included in the docs, but at the same time we do not want to include all info on how projections and maps work, since other resources do that better.