2

I have a simple question: What does it mean to set the scale of a d3 projection to 1 compared to, say, 150? What do these values actually translate to in plain English? I understand that it scales the projection up and down (duh), but according to what principle?

var projection = d3.geo.mercator()
    .scale(1) //what does this mean?
durrrutti
  • 1,020
  • 1
  • 8
  • 18
  • does the following question not answer your's? http://stackoverflow.com/questions/21565511/what-does-it-mean-to-scale-a-projection-in-d3 – hubson bropa May 21 '15 at 15:51
  • @hubsonbropa I guess I'm looking for a more specific answer than "scale is used in the general sense of the size of something". If there is one. – durrrutti May 21 '15 at 15:57
  • Have you checked [the documentation](https://github.com/mbostock/d3/wiki/Geo-Projections#scale)? The scale factor affects the distance between projected points. – Lars Kotthoff May 21 '15 at 16:10
  • 1
    @LarsKotthoff Yeah. But what does that mean? With scale set to 1, one meter equals one pixel, and with scale 150, one meter equals 150 pixels, or what? – durrrutti May 21 '15 at 16:18
  • @durrrutti What it means exactly depends on the projection you're using. What a scale of 1 corresponds to varies by projection, but a scale of 150 will put the same points 150 times as far apart for the same projection. – Lars Kotthoff May 21 '15 at 16:20
  • @LarsKotthoff Ok. I used the mercator projection with Natural Earth data and set the scale to 1. The bounding box for the whole world ended up being [`[-3.14, -2.88], [3.14, 3.14]]`. I guess I'm bothered by the fact that I have no idea how these starting values were computed. – durrrutti May 21 '15 at 16:36
  • @durrrutti You can always have a look at the source :) – Lars Kotthoff May 21 '15 at 16:39
  • @LarsKotthoff Too much math :) But perhaps the answer is that there's no trivial, non-mathematical, answer to the question. – durrrutti May 21 '15 at 16:57
  • @durrrutti Exactly -- it really depends on what the projection does under the hood and there's no intrinsic meaning of a "1" here. – Lars Kotthoff May 21 '15 at 17:05

0 Answers0