Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add/explain scale targets #24

Closed
bhrutledge opened this issue Jul 11, 2016 · 1 comment
Closed

Add/explain scale targets #24

bhrutledge opened this issue Jul 11, 2016 · 1 comment

Comments

@bhrutledge
Copy link

The current 10m/1:10,000,000 scale is great, but it'd be nice to have an option for higher precision, especially as a basis for generating TopoJSON for individual states.

This seems to be the result of quantization and simplification. So, changing:

        --no-pre-quantization \
        --post-quantization=1e6 \
        --simplify=7e-7 \

to:

        --no-pre-quantization \
        --post-quantization=1e4 \
        --simplify-proportion=.5 \

results in more precise TopoJSON. But, I don't understand how the first set of arguments was derived from a 1:10,000,000 scale, or what I'd have to do to precisely define, say, a 1m or 100k scale.

Apologies if this information is already available in the docs, or via links. I'm definitely a newbie in this area.

@mbostock
Copy link
Member

mbostock commented Jul 11, 2016

The Makefiles are just a starting point and you’re expected to fork and modify them to suit your needs. The intent of this repo is to help you find geometry and learn how to use TopoJSON. The initial values were chosen somewhat arbitrarily for displaying static maps in a 960×600 pixel area, but with plenty of extra resolution for zooming in to show more detail (say to compare counties for a given state). For example, see http://bl.ocks.org/mbostock/4060606. The source data is 1:1,000,000 from the USGS.

If you want more detail in the generated TopoJSON file, you’ll want to pass a larger value to --post-quantization, not a smaller value. The wiki is a little out-of-date (in that it doesn’t distinguish --pre-quantization from --post-quantization) but see the TopoJSON Command Line Reference for details. Of course, better is to pre-project the geometry and then simplify to the resolution you need in pixels. But sometimes you want a dynamic projection or to know the geographic coordinates… so this is again just a generic starting point.

If you have more questions, I recommend Stack Overflow or https://gis.stackexchange.com/. I’m not always able to answer issues promptly (as evinced by my recent closing of unanswered issues).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants