Module:Infobox dim: Difference between revisions

Content deleted Content added
wrong function
update dim/scale conversion, add types
Line 21:
dim = dim*1000
end
-- assuminggeohack dim spansassumes a map width of 800px10cm (=on 24cm onthe screen)
-- Using 0.3 mm/pixel from https://wiki.openstreetmap.org/wiki/Zoom_levels, and
-- which seems nuts, but we have to be compatible
-- assuming dim spans a map width of 800px (= 24cm on screen)
-- thus, dim has to correspond to 10cm, so scale is dim (in meters) * 10
return ppm/80010 * dim
end
 
Line 30 ⟶ 31:
scale = tonumber(scale)
if not scale or scale <= 0 then return end
return 0.8/ppmscale * scale1e-3
end
 
Line 36 ⟶ 37:
local function geohackTypeToScale(type, population)
local typeScale = {
country = 10000000,
satellite = 10000000,
state = 3000000,
adm1st = 1000000,
adm2nd = 300000,
adm3rd = 100000,
airport = 30000,
city = 100000,
countryisle = 10000000100000,
mountain = 100000,
waterbodyriver = 100000,
waterbody = 100000,
edu = 10000,
event = 50000,
forest = 50000,
glacier = 50000,
isleairport = 10000030000,
landmark = 10000,
mountain = 100000,
pass = 10000,
railwaystation = 10000,
riveredu = 10000010000,
satellitepass = 1000000010000,
waterbody = 100000,
camera = 10000
}