├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── build_communities.sh ├── cartography ├── redlines.tm2 │ ├── .thumb.png │ ├── LICENSE.txt │ ├── bookmarks.yml │ ├── bubbles │ │ ├── MAW.ttf │ │ ├── community_legend.csv │ │ ├── index.html │ │ └── rasterize.js │ ├── communities.mss │ ├── exports │ │ ├── los_angeles_communities_2014.png │ │ └── tribes_06_037.png │ ├── fonts │ │ ├── Linotte-SemiBold.otf │ │ └── MAW.ttf │ ├── img │ │ ├── dot_fill.jpg │ │ ├── dot_fill_2.jpg │ │ ├── hatch.png │ │ ├── line_dotted_10.png │ │ ├── line_dotted_12.png │ │ ├── line_dotted_4.png │ │ ├── line_dotted_6.png │ │ ├── line_dotted_8.png │ │ ├── line_double_14.png │ │ ├── line_double_14_mask.png │ │ ├── line_double_16.png │ │ ├── line_double_16_mask.png │ │ ├── line_double_18.png │ │ ├── line_double_18_mask.png │ │ ├── line_double_20.png │ │ ├── line_double_20_mask.png │ │ ├── line_shade_22.png │ │ ├── line_shade_22_1.png │ │ ├── line_shade_22_2.png │ │ ├── line_shade_22_4.png │ │ ├── line_solid_6.png │ │ ├── line_solid_7.png │ │ ├── line_water_14.png │ │ ├── linedpaper.png │ │ ├── linedpaper_256.png │ │ ├── natural_paper.png │ │ ├── shade_dark.png │ │ ├── shade_light.png │ │ ├── shade_medium.png │ │ ├── shade_medium_2.png │ │ ├── shade_medium_seamless.png │ │ ├── texture.png │ │ ├── texture_2.png │ │ ├── texture_3.png │ │ └── water.png │ ├── labels.mss │ ├── legend │ │ ├── MAW.ttf │ │ ├── community_legend.csv │ │ ├── index.html │ │ ├── legend.png │ │ ├── rasterize.js │ │ └── texture.png │ ├── pop_legend │ │ ├── MAW.ttf │ │ ├── index.html │ │ ├── rasterize.js │ │ └── texture.png │ ├── project.xml │ ├── project.yml │ ├── project.ymltmp3.bak │ ├── road.mss │ └── style.mss ├── rl_ga_fulton_county.tm2 │ ├── .thumb.png │ ├── LICENSE.txt │ ├── bookmarks.yml │ ├── bubbles │ │ ├── MAW.ttf │ │ ├── bubbles.png │ │ ├── community_legend.csv │ │ ├── index.html │ │ └── rasterize.js │ ├── communities.mss │ ├── exports │ │ ├── bubbles.png │ │ ├── legend.png │ │ ├── los_angeles_communities_2014.png │ │ └── tribes_06_037.png │ ├── fonts │ │ ├── Linotte-SemiBold.otf │ │ └── MAW.ttf │ ├── img │ │ ├── bubbles.png │ │ ├── dot_fill.jpg │ │ ├── dot_fill_2.jpg │ │ ├── hatch.png │ │ ├── legend.png │ │ ├── line_dotted_10.png │ │ ├── line_dotted_12.png │ │ ├── line_dotted_4.png │ │ ├── line_dotted_6.png │ │ ├── line_dotted_8.png │ │ ├── line_double_14.png │ │ ├── line_double_14_mask.png │ │ ├── line_double_16.png │ │ ├── line_double_16_mask.png │ │ ├── line_double_18.png │ │ ├── line_double_18_mask.png │ │ ├── line_double_20.png │ │ ├── line_double_20_mask.png │ │ ├── line_shade_22.png │ │ ├── line_shade_22_1.png │ │ ├── line_shade_22_2.png │ │ ├── line_shade_22_4.png │ │ ├── line_solid_6.png │ │ ├── line_solid_7.png │ │ ├── line_water_14.png │ │ ├── linedpaper.png │ │ ├── linedpaper_256.png │ │ ├── natural_paper.png │ │ ├── shade_dark.png │ │ ├── shade_light.png │ │ ├── shade_medium.png │ │ ├── shade_medium_2.png │ │ ├── shade_medium_seamless.png │ │ ├── texture.png │ │ ├── texture_2.png │ │ ├── texture_3.png │ │ └── water.png │ ├── labels.mss │ ├── legend │ │ ├── MAW.ttf │ │ ├── community_legend.csv │ │ ├── index.html │ │ ├── legend.png │ │ ├── rasterize.js │ │ └── texture.png │ ├── pop_legend │ │ ├── MAW.ttf │ │ ├── index.html │ │ ├── rasterize.js │ │ └── texture.png │ ├── project.xml │ ├── project.yml │ ├── project.ymltmp2.bak │ ├── project.ymltmp3.bak │ ├── project.ymltmp4.bak │ ├── project.ymltmp5.bak │ ├── road.mss │ └── style.mss └── tribes.gl.json ├── data ├── census_community_fields.csv └── census_fips_codes.csv ├── nyc_tribes.png ├── original.png └── processing ├── dissolve ├── index.js └── package.json ├── form ├── form.sql ├── index.js └── package.json ├── join ├── index.js └── package.json ├── parse ├── index.js └── package.json ├── pull ├── index.js └── package.json ├── roads ├── index.js ├── package.json └── roads.sql └── water ├── bathwater.js ├── bbox.js ├── get.js ├── package.json ├── piranha.sql └── roads.sql /.gitattributes: -------------------------------------------------------------------------------- 1 | *.geojson filter=lfs diff=lfs merge=lfs -text 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 18 | .grunt 19 | 20 | # node-waf configuration 21 | .lock-wscript 22 | 23 | # Compiled binary addons (http://nodejs.org/api/addons.html) 24 | build/Release 25 | 26 | # Dependency directory 27 | node_modules 28 | 29 | # Optional npm cache directory 30 | .npm 31 | 32 | # Optional REPL history 33 | .node_repl_history 34 | data/tmp_* 35 | *.xcf 36 | cartography/tribes_*.tm2/ 37 | cartography/tribes-seg_*.tm2/ 38 | cartography/tribes-pop_*.tm2/ 39 | tmp.geojson 40 | .DS_Store 41 | tiles.txt 42 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Attribution 4.0 International 2 | 3 | ======================================================================= 4 | 5 | Creative Commons Corporation ("Creative Commons") is not a law firm and 6 | does not provide legal services or legal advice. Distribution of 7 | Creative Commons public licenses does not create a lawyer-client or 8 | other relationship. Creative Commons makes its licenses and related 9 | information available on an "as-is" basis. Creative Commons gives no 10 | warranties regarding its licenses, any material licensed under their 11 | terms and conditions, or any related information. Creative Commons 12 | disclaims all liability for damages resulting from their use to the 13 | fullest extent possible. 14 | 15 | Using Creative Commons Public Licenses 16 | 17 | Creative Commons public licenses provide a standard set of terms and 18 | conditions that creators and other rights holders may use to share 19 | original works of authorship and other material subject to copyright 20 | and certain other rights specified in the public license below. The 21 | following considerations are for informational purposes only, are not 22 | exhaustive, and do not form part of our licenses. 23 | 24 | Considerations for licensors: Our public licenses are 25 | intended for use by those authorized to give the public 26 | permission to use material in ways otherwise restricted by 27 | copyright and certain other rights. Our licenses are 28 | irrevocable. Licensors should read and understand the terms 29 | and conditions of the license they choose before applying it. 30 | Licensors should also secure all rights necessary before 31 | applying our licenses so that the public can reuse the 32 | material as expected. Licensors should clearly mark any 33 | material not subject to the license. This includes other CC- 34 | licensed material, or material used under an exception or 35 | limitation to copyright. More considerations for licensors: 36 | wiki.creativecommons.org/Considerations_for_licensors 37 | 38 | Considerations for the public: By using one of our public 39 | licenses, a licensor grants the public permission to use the 40 | licensed material under specified terms and conditions. If 41 | the licensor's permission is not necessary for any reason--for 42 | example, because of any applicable exception or limitation to 43 | copyright--then that use is not regulated by the license. Our 44 | licenses grant only permissions under copyright and certain 45 | other rights that a licensor has authority to grant. Use of 46 | the licensed material may still be restricted for other 47 | reasons, including because others have copyright or other 48 | rights in the material. A licensor may make special requests, 49 | such as asking that all changes be marked or described. 50 | Although not required by our licenses, you are encouraged to 51 | respect those requests where reasonable. More_considerations 52 | for the public: 53 | wiki.creativecommons.org/Considerations_for_licensees 54 | 55 | ======================================================================= 56 | 57 | Creative Commons Attribution 4.0 International Public License 58 | 59 | By exercising the Licensed Rights (defined below), You accept and agree 60 | to be bound by the terms and conditions of this Creative Commons 61 | Attribution 4.0 International Public License ("Public License"). To the 62 | extent this Public License may be interpreted as a contract, You are 63 | granted the Licensed Rights in consideration of Your acceptance of 64 | these terms and conditions, and the Licensor grants You such rights in 65 | consideration of benefits the Licensor receives from making the 66 | Licensed Material available under these terms and conditions. 67 | 68 | 69 | Section 1 -- Definitions. 70 | 71 | a. Adapted Material means material subject to Copyright and Similar 72 | Rights that is derived from or based upon the Licensed Material 73 | and in which the Licensed Material is translated, altered, 74 | arranged, transformed, or otherwise modified in a manner requiring 75 | permission under the Copyright and Similar Rights held by the 76 | Licensor. For purposes of this Public License, where the Licensed 77 | Material is a musical work, performance, or sound recording, 78 | Adapted Material is always produced where the Licensed Material is 79 | synched in timed relation with a moving image. 80 | 81 | b. Adapter's License means the license You apply to Your Copyright 82 | and Similar Rights in Your contributions to Adapted Material in 83 | accordance with the terms and conditions of this Public License. 84 | 85 | c. Copyright and Similar Rights means copyright and/or similar rights 86 | closely related to copyright including, without limitation, 87 | performance, broadcast, sound recording, and Sui Generis Database 88 | Rights, without regard to how the rights are labeled or 89 | categorized. For purposes of this Public License, the rights 90 | specified in Section 2(b)(1)-(2) are not Copyright and Similar 91 | Rights. 92 | 93 | d. Effective Technological Measures means those measures that, in the 94 | absence of proper authority, may not be circumvented under laws 95 | fulfilling obligations under Article 11 of the WIPO Copyright 96 | Treaty adopted on December 20, 1996, and/or similar international 97 | agreements. 98 | 99 | e. Exceptions and Limitations means fair use, fair dealing, and/or 100 | any other exception or limitation to Copyright and Similar Rights 101 | that applies to Your use of the Licensed Material. 102 | 103 | f. Licensed Material means the artistic or literary work, database, 104 | or other material to which the Licensor applied this Public 105 | License. 106 | 107 | g. Licensed Rights means the rights granted to You subject to the 108 | terms and conditions of this Public License, which are limited to 109 | all Copyright and Similar Rights that apply to Your use of the 110 | Licensed Material and that the Licensor has authority to license. 111 | 112 | h. Licensor means the individual(s) or entity(ies) granting rights 113 | under this Public License. 114 | 115 | i. Share means to provide material to the public by any means or 116 | process that requires permission under the Licensed Rights, such 117 | as reproduction, public display, public performance, distribution, 118 | dissemination, communication, or importation, and to make material 119 | available to the public including in ways that members of the 120 | public may access the material from a place and at a time 121 | individually chosen by them. 122 | 123 | j. Sui Generis Database Rights means rights other than copyright 124 | resulting from Directive 96/9/EC of the European Parliament and of 125 | the Council of 11 March 1996 on the legal protection of databases, 126 | as amended and/or succeeded, as well as other essentially 127 | equivalent rights anywhere in the world. 128 | 129 | k. You means the individual or entity exercising the Licensed Rights 130 | under this Public License. Your has a corresponding meaning. 131 | 132 | 133 | Section 2 -- Scope. 134 | 135 | a. License grant. 136 | 137 | 1. Subject to the terms and conditions of this Public License, 138 | the Licensor hereby grants You a worldwide, royalty-free, 139 | non-sublicensable, non-exclusive, irrevocable license to 140 | exercise the Licensed Rights in the Licensed Material to: 141 | 142 | a. reproduce and Share the Licensed Material, in whole or 143 | in part; and 144 | 145 | b. produce, reproduce, and Share Adapted Material. 146 | 147 | 2. Exceptions and Limitations. For the avoidance of doubt, where 148 | Exceptions and Limitations apply to Your use, this Public 149 | License does not apply, and You do not need to comply with 150 | its terms and conditions. 151 | 152 | 3. Term. The term of this Public License is specified in Section 153 | 6(a). 154 | 155 | 4. Media and formats; technical modifications allowed. The 156 | Licensor authorizes You to exercise the Licensed Rights in 157 | all media and formats whether now known or hereafter created, 158 | and to make technical modifications necessary to do so. The 159 | Licensor waives and/or agrees not to assert any right or 160 | authority to forbid You from making technical modifications 161 | necessary to exercise the Licensed Rights, including 162 | technical modifications necessary to circumvent Effective 163 | Technological Measures. For purposes of this Public License, 164 | simply making modifications authorized by this Section 2(a) 165 | (4) never produces Adapted Material. 166 | 167 | 5. Downstream recipients. 168 | 169 | a. Offer from the Licensor -- Licensed Material. Every 170 | recipient of the Licensed Material automatically 171 | receives an offer from the Licensor to exercise the 172 | Licensed Rights under the terms and conditions of this 173 | Public License. 174 | 175 | b. No downstream restrictions. You may not offer or impose 176 | any additional or different terms or conditions on, or 177 | apply any Effective Technological Measures to, the 178 | Licensed Material if doing so restricts exercise of the 179 | Licensed Rights by any recipient of the Licensed 180 | Material. 181 | 182 | 6. No endorsement. Nothing in this Public License constitutes or 183 | may be construed as permission to assert or imply that You 184 | are, or that Your use of the Licensed Material is, connected 185 | with, or sponsored, endorsed, or granted official status by, 186 | the Licensor or others designated to receive attribution as 187 | provided in Section 3(a)(1)(A)(i). 188 | 189 | b. Other rights. 190 | 191 | 1. Moral rights, such as the right of integrity, are not 192 | licensed under this Public License, nor are publicity, 193 | privacy, and/or other similar personality rights; however, to 194 | the extent possible, the Licensor waives and/or agrees not to 195 | assert any such rights held by the Licensor to the limited 196 | extent necessary to allow You to exercise the Licensed 197 | Rights, but not otherwise. 198 | 199 | 2. Patent and trademark rights are not licensed under this 200 | Public License. 201 | 202 | 3. To the extent possible, the Licensor waives any right to 203 | collect royalties from You for the exercise of the Licensed 204 | Rights, whether directly or through a collecting society 205 | under any voluntary or waivable statutory or compulsory 206 | licensing scheme. In all other cases the Licensor expressly 207 | reserves any right to collect such royalties. 208 | 209 | 210 | Section 3 -- License Conditions. 211 | 212 | Your exercise of the Licensed Rights is expressly made subject to the 213 | following conditions. 214 | 215 | a. Attribution. 216 | 217 | 1. If You Share the Licensed Material (including in modified 218 | form), You must: 219 | 220 | a. retain the following if it is supplied by the Licensor 221 | with the Licensed Material: 222 | 223 | i. identification of the creator(s) of the Licensed 224 | Material and any others designated to receive 225 | attribution, in any reasonable manner requested by 226 | the Licensor (including by pseudonym if 227 | designated); 228 | 229 | ii. a copyright notice; 230 | 231 | iii. a notice that refers to this Public License; 232 | 233 | iv. a notice that refers to the disclaimer of 234 | warranties; 235 | 236 | v. a URI or hyperlink to the Licensed Material to the 237 | extent reasonably practicable; 238 | 239 | b. indicate if You modified the Licensed Material and 240 | retain an indication of any previous modifications; and 241 | 242 | c. indicate the Licensed Material is licensed under this 243 | Public License, and include the text of, or the URI or 244 | hyperlink to, this Public License. 245 | 246 | 2. You may satisfy the conditions in Section 3(a)(1) in any 247 | reasonable manner based on the medium, means, and context in 248 | which You Share the Licensed Material. For example, it may be 249 | reasonable to satisfy the conditions by providing a URI or 250 | hyperlink to a resource that includes the required 251 | information. 252 | 253 | 3. If requested by the Licensor, You must remove any of the 254 | information required by Section 3(a)(1)(A) to the extent 255 | reasonably practicable. 256 | 257 | 4. If You Share Adapted Material You produce, the Adapter's 258 | License You apply must not prevent recipients of the Adapted 259 | Material from complying with this Public License. 260 | 261 | 262 | Section 4 -- Sui Generis Database Rights. 263 | 264 | Where the Licensed Rights include Sui Generis Database Rights that 265 | apply to Your use of the Licensed Material: 266 | 267 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right 268 | to extract, reuse, reproduce, and Share all or a substantial 269 | portion of the contents of the database; 270 | 271 | b. if You include all or a substantial portion of the database 272 | contents in a database in which You have Sui Generis Database 273 | Rights, then the database in which You have Sui Generis Database 274 | Rights (but not its individual contents) is Adapted Material; and 275 | 276 | c. You must comply with the conditions in Section 3(a) if You Share 277 | all or a substantial portion of the contents of the database. 278 | 279 | For the avoidance of doubt, this Section 4 supplements and does not 280 | replace Your obligations under this Public License where the Licensed 281 | Rights include other Copyright and Similar Rights. 282 | 283 | 284 | Section 5 -- Disclaimer of Warranties and Limitation of Liability. 285 | 286 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE 287 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS 288 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF 289 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, 290 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, 291 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 292 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, 293 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT 294 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT 295 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. 296 | 297 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE 298 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, 299 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, 300 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, 301 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR 302 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN 303 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR 304 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR 305 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. 306 | 307 | c. The disclaimer of warranties and limitation of liability provided 308 | above shall be interpreted in a manner that, to the extent 309 | possible, most closely approximates an absolute disclaimer and 310 | waiver of all liability. 311 | 312 | 313 | Section 6 -- Term and Termination. 314 | 315 | a. This Public License applies for the term of the Copyright and 316 | Similar Rights licensed here. However, if You fail to comply with 317 | this Public License, then Your rights under this Public License 318 | terminate automatically. 319 | 320 | b. Where Your right to use the Licensed Material has terminated under 321 | Section 6(a), it reinstates: 322 | 323 | 1. automatically as of the date the violation is cured, provided 324 | it is cured within 30 days of Your discovery of the 325 | violation; or 326 | 327 | 2. upon express reinstatement by the Licensor. 328 | 329 | For the avoidance of doubt, this Section 6(b) does not affect any 330 | right the Licensor may have to seek remedies for Your violations 331 | of this Public License. 332 | 333 | c. For the avoidance of doubt, the Licensor may also offer the 334 | Licensed Material under separate terms or conditions or stop 335 | distributing the Licensed Material at any time; however, doing so 336 | will not terminate this Public License. 337 | 338 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 339 | License. 340 | 341 | 342 | Section 7 -- Other Terms and Conditions. 343 | 344 | a. The Licensor shall not be bound by any additional or different 345 | terms or conditions communicated by You unless expressly agreed. 346 | 347 | b. Any arrangements, understandings, or agreements regarding the 348 | Licensed Material not stated herein are separate from and 349 | independent of the terms and conditions of this Public License. 350 | 351 | 352 | Section 8 -- Interpretation. 353 | 354 | a. For the avoidance of doubt, this Public License does not, and 355 | shall not be interpreted to, reduce, limit, restrict, or impose 356 | conditions on any use of the Licensed Material that could lawfully 357 | be made without permission under this Public License. 358 | 359 | b. To the extent possible, if any provision of this Public License is 360 | deemed unenforceable, it shall be automatically reformed to the 361 | minimum extent necessary to make it enforceable. If the provision 362 | cannot be reformed, it shall be severed from this Public License 363 | without affecting the enforceability of the remaining terms and 364 | conditions. 365 | 366 | c. No term or condition of this Public License will be waived and no 367 | failure to comply consented to unless expressly agreed to by the 368 | Licensor. 369 | 370 | d. Nothing in this Public License constitutes or may be interpreted 371 | as a limitation upon, or waiver of, any privileges and immunities 372 | that apply to the Licensor or You, including from the legal 373 | processes of any jurisdiction or authority. 374 | 375 | 376 | ======================================================================= 377 | 378 | Creative Commons is not a party to its public 379 | licenses. Notwithstanding, Creative Commons may elect to apply one of 380 | its public licenses to material it publishes and in those instances 381 | will be considered the “Licensor.” The text of the Creative Commons 382 | public licenses is dedicated to the public domain under the CC0 Public 383 | Domain Dedication. Except for the limited purpose of indicating that 384 | material is shared under a Creative Commons public license or as 385 | otherwise permitted by the Creative Commons policies published at 386 | creativecommons.org/policies, Creative Commons does not authorize the 387 | use of the trademark "Creative Commons" or any other trademark or logo 388 | of Creative Commons without its prior written consent including, 389 | without limitation, in connection with any unauthorized modifications 390 | to any of its public licenses or any other arrangements, 391 | understandings, or agreements concerning use of licensed material. For 392 | the avoidance of doubt, this paragraph does not form part of the 393 | public licenses. 394 | 395 | Creative Commons may be contacted at creativecommons.org. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Redlines 2 | Urban planners used to see lines in the human canvas of America's cities. They used to see a series of communities and tribes, clustered and separately identifiable, each with its own history, customs and rights. This view of lines is antiquated in the equality-minded planning policy of today, theoretically blind to race, ethnicity and ancestry. 3 | 4 | But the lines remain. 5 | 6 | This project began as a recreation of [a 1976 map representing Chicago's racial and ancestral groups ca. 1950](https://upload.wikimedia.org/wikipedia/commons/b/b5/Chicago_Demographics_in_1950_Map.jpg). It expanded to include the complex picture that the original mapmakers missed - where the lines are blurry and where they seem fixed in the asphalt still. These updated maps incorporate the observations of [Jane Jacobs](https://en.wikipedia.org/wiki/The_Death_and_Life_of_Great_American_Cities#City_neighborhoods) and [Ta-Nehisi Coates](http://www.theatlantic.com/magazine/archive/2014/06/the-case-for-reparations/361631/); they show where people are coming together and where they are still separated by invisible lines. 7 | 8 | ### Then: 9 | ![original](original.png) 10 | 11 | ### Now: 12 | ![current](nyc_tribes.png) 13 | 14 | ## Methods 15 | This is a tough map to recreate with 21st century data. The reason for using an aggregate approach is that the census [only reports ancestry for slightly more than half of the US population](http://factfinder.census.gov/faces/tableservices/jsf/pages/productview.xhtml?pid=ACS_13_5YR_B04001&prodType=table), including in configurations that fail to represent whole racial/ethnic groups, which are in turn detailed on other tables. In order to capture the conceptual spirit and geographic detail of the original map, it is worthwhile to combine the two in the most-representative way possible. 16 | 17 | This map draws from [99 distinct ancestry/race/ethnicity/origin categories from across 5 census tables](data/census_community_fields.csv) to produce maps [like this](data/communities_17_031.geojson). 18 | 19 | ## Data sources 20 | - [Census TIGER geographic boundaries - tract-level](data/cook_county_blocks.geojson) 21 | - [Census API SF1 and ACS](https://api.census.gov/data/2010/sf1/variables.html) 22 | - [OpenStreetmap reference data via Mapbox](http://www.openstreetmap.org/) 23 | 24 | ## Processing steps 25 | 1. [Hit the Census API for tabular data](processing/pull/index.js) 26 | 2. Add `largest_group` aggregate field, populated with largest ancestry/racial/ethnic group in each census tract by proportion of the population; retain proportion stats 27 | 3. Add plurality and population density 28 | 4. Get geodata 29 | 5. Join tract geometries, `community`, ancestry and race tables on geoid 30 | 6. Delete empty tracts 31 | 7. Expand block boundaries by 50m, dissolve, then erode by 150m and simplify a bit for cartographic effect 32 | 8. Map [according to original style](cartography/redlines.tm2/style.mss) with additional small multiples and supporting charts 33 | 34 | ## Usage 35 | 36 | ### Dependencies 37 | _(Sorry, things got out of hand)_ 38 | 39 | - [node.js](https://nodejs.org/en/) 40 | - [GDAL/OGR](http://trac.osgeo.org/gdal/wiki/DownloadingGdalBinaries) 41 | - [PostGIS](http://postgis.org) 42 | - [csvkit](http://csvkit.readthedocs.org/en/540/) 43 | - [Mapbox CLI](https://github.com/mapbox/mapbox-cli-py#upload) 44 | - [Mapbox Studio Classic](https://www.mapbox.com/mapbox-studio-classic/#darwin) (Gotta have that CartoCSS) 45 | - [Mercantile](https://github.com/mapbox/mercantile/blob/master/docs/cli.rst) 46 | - [geojson-merge](https://github.com/mapbox/geojson-merge) 47 | - [phantomjs](http://phantomjs.org/screen-capture.html) (to capture chart images) 48 | - Census [API key](https://api.census.gov/data/key_signup.html) 49 | - [jq](https://stedolan.github.io/jq/) for json parsing in bash 50 | 51 | In theory this will work for any county in the country. Set location parameters as arguments in the order below: 52 | 53 | ```bash 54 | bash build_communities.sh 55 | ``` 56 | 57 | e.g. this: 58 | ``` 59 | bash build_communities.sh MA Suffolk 60 | ``` 61 | . . . will get you a map of Suffolk county (Boston), MA 62 | 63 | ## Assumptions (a running list) 64 | - __Meta-assumption: ancestry can be inferred by race.__ This is a dramatic oversimplification, to say the least. 65 | - Census categories that dance around race, ancestry and ethnicity can be coherently flattened to a non-overlapping set of categories. 66 | - Counting multiple races as multiple people is legit, when trying to show community membership. 67 | - Asian and Hispanic/Latino groups can be represented by race in the absence of ancestral categories encompassing them. 68 | - In majority-black census blocks, "American" ancestry refers almost exclusively to African-Americans. 69 | - The "Mixed" racial group in a block is adequately represented by the largest ancestral group in the containing tract. 70 | - Margin of error can be ignored. 71 | - To make it under the API limit (50 variables), the smallest-population groups (<100,000 nationally) may be ignored. 72 | - Religion-based communities (e.g. Jewish, Mennonite) may be excluded; the Census does not collect information on religious practice. 73 | -------------------------------------------------------------------------------- /build_communities.sh: -------------------------------------------------------------------------------- 1 | # Build the dataset for a modern demographic map 2 | # USAGE: bash build_communities.sh 3 | 4 | # params (ncluding ridiculous handlers for extra quotes, caps, spaces, and apostrophes) 5 | set -eo pipefail 6 | DATE=`date +%Y_%m_%d` 7 | STATE_ABBRV=$(echo $1 | awk '{print tolower($0)}') 8 | LOCATION_DETAILS=$(csvgrep -c 1 -m $1 data/census_fips_codes.csv | csvgrep -c 5 -m $2 | csvjson) 9 | STATE_NAME=$(echo $LOCATION_DETAILS | jq '.[0].state_long') 10 | STATE_NAME="${STATE_NAME%\"}" 11 | STATE_NAME="${STATE_NAME#\"}" 12 | STATE_FIPS=$(echo $LOCATION_DETAILS | jq '.[0].state_fips') 13 | STATE_FIPS="${STATE_FIPS%\"}" 14 | STATE_FIPS="${STATE_FIPS#\"}" 15 | COUNTY_FIPS=$(echo $LOCATION_DETAILS | jq '.[0].county_fips') 16 | COUNTY_FIPS="${COUNTY_FIPS%\"}" 17 | COUNTY_FIPS="${COUNTY_FIPS#\"}" 18 | COUNTY_NAME=$(echo $LOCATION_DETAILS | jq '.[0].county') 19 | COUNTY_NAME="${COUNTY_NAME//[ ,\']/_}" 20 | COUNTY_NAME=$(echo $COUNTY_NAME | awk '{print tolower($0)}') 21 | COUNTY_NAME="${COUNTY_NAME%\"}" 22 | COUNTY_NAME="${COUNTY_NAME#\"}" 23 | TILE_ZOOM=11 24 | CENSUS_KEY=6cf83ef5cf4401ace5c8dcccae0bd9ca2999aeb1 25 | REDLINES_MB_TOKEN=sk.eyJ1IjoibGFuZHBsYW5uZXIiLCJhIjoiY2lsaXFkMng1M2NxMXY2bTBvaXQ0Z2N0eCJ9.dl5GmYgdPdNupaYxk8y16g 26 | TILES_MB_TOKEN=sk.eyJ1IjoibGFuZHBsYW5uZXIiLCJhIjoiY2ltcjB0MmozMDB0MHY5a2t5c2Fsb3Q0diJ9.3qyTzT995P_Fo1fJ2tyr6A 27 | MB_USER=landplanner 28 | 29 | echo '------------cleaning house------------' 30 | rm -rf data/tmp_$STATE_ABBRV"_"$COUNTY_NAME/ 31 | 32 | echo '------------creating temp location------------' 33 | mkdir data/tmp_$STATE_ABBRV"_"$COUNTY_NAME/ 34 | 35 | echo '------------getting ancestry and race data------------' 36 | cd processing/pull 37 | npm install 38 | echo 'getting decennial census data' 39 | node index.js sf1 $CENSUS_KEY $STATE_FIPS $COUNTY_FIPS $STATE_ABBRV $COUNTY_NAME 40 | echo 'getting american community survey data' 41 | node index.js acs5 $CENSUS_KEY $STATE_FIPS $COUNTY_FIPS $STATE_ABBRV $COUNTY_NAME 42 | cd ../../data/tmp_$STATE_ABBRV"_"$COUNTY_NAME/ 43 | csvjoin -c "tract" sf1.csv acs5.csv > community_attributes.csv 44 | csvcut -c 49-51,1-48,52-104 community_attributes.csv > community_attributes_ordered.csv 45 | 46 | echo '------------identifying the largest group in each tract------------' 47 | cd ../../processing/parse 48 | npm install 49 | node index.js ../../data/tmp_$STATE_ABBRV"_"$COUNTY_NAME/community_attributes_ordered.csv 50 | 51 | echo '------------joining literate group names------------' 52 | cd ../../data/tmp_$STATE_ABBRV"_"$COUNTY_NAME 53 | mv community_attributes_ordered.csv.tmp community_attributes_ordered_max.csv 54 | csvjoin -c "largest_group,code" --left community_attributes_ordered_max.csv ../census_community_fields.csv > community_properties.csv 55 | csvcut -c "1-4,103-109" community_properties.csv > community_properties_light.csv 56 | sed -i tmp.bak 's/name,/largest_community_name,/g' community_properties_light.csv 57 | 58 | echo '------------importing geodata (tracts)------------' 59 | wget -c ftp://ftp2.census.gov/geo/tiger/TIGER2015/TRACT/tl_2015_$STATE_FIPS"_tract.zip" 60 | unzip tl_2015_$STATE_FIPS"_tract.zip" 61 | ogr2ogr -t_srs "EPSG:4326" -f GeoJSON -where "COUNTYFP = '$COUNTY_FIPS'" tracts_$COUNTY_FIPS.geojson tl_2015_$STATE_FIPS"_tract.shp" 62 | 63 | echo '------------importing geodata (OSM water)------------' 64 | cd ../../processing/water 65 | npm install 66 | # get expanded bbox from tracts_$COUNTY_FIPS.geojson 67 | COMMUNITY_BBOX=$(node bbox.js ../../data/tmp_$STATE_ABBRV"_"$COUNTY_NAME/tracts_$COUNTY_FIPS.geojson) 68 | # pipe it through a tile cruncher 69 | echo $COMMUNITY_BBOX | mercantile tiles $TILE_ZOOM > ../../data/tmp_$STATE_ABBRV"_"$COUNTY_NAME/tiles.txt 70 | # . . . and then the mapbox api in 6x parallel to get geojson 71 | cat ../../data/tmp_$STATE_ABBRV"_"$COUNTY_NAME/tiles.txt | parallel -j6 node get.js {} ../../data/tmp_$STATE_ABBRV"_"$COUNTY_NAME/ $TILES_MB_TOKEN 72 | # combine it all into one beastly geojson for the hell of it 73 | geojson-merge ../../data/tmp_$STATE_ABBRV"_"$COUNTY_NAME/osm_water*.geojson > ../../data/tmp_$STATE_ABBRV"_"$COUNTY_NAME/all_osm_water.geojson 74 | 75 | echo '------------joining attributes to tract boundaries------------' 76 | cd ../../processing/join 77 | npm install 78 | node index.js ../../data/tmp_$STATE_ABBRV"_"$COUNTY_NAME/tracts_$COUNTY_FIPS.geojson ../../data/tmp_$STATE_ABBRV"_"$COUNTY_NAME/community_properties_light.csv $STATE_ABBRV $COUNTY_NAME 79 | 80 | echo '------------moving it all into postgis------------' 81 | dropdb communities 82 | createdb communities 83 | psql communities -c "CREATE EXTENSION IF NOT EXISTS postgis" 84 | psql communities -c "CREATE EXTENSION IF NOT EXISTS postgis_topology" 85 | cd ../../data/tmp_$STATE_ABBRV"_"$COUNTY_NAME/ 86 | psql communities -c "DROP TABLE IF EXISTS community_tracts" 87 | ogr2ogr -t_srs "EPSG:4326" -f "PostgreSQL" PG:"host=localhost dbname=communities" community_tracts_$COUNTY_NAME.geojson -nln community_tracts -nlt PROMOTE_TO_MULTI -lco PRECISION=NO 88 | psql communities -c "CREATE TABLE tracts_backfill AS (SELECT * FROM community_tracts)" 89 | 90 | echo '------------remove water polygons from the tract boundaries------------' 91 | for g in $(ls osm_water*.geojson); do 92 | ogr2ogr -t_srs "EPSG:4326" -f "PostgreSQL" PG:"host=localhost dbname=communities" $g -nln water_tile -nlt PROMOTE_TO_MULTI -lco PRECISION=NO 93 | # fix what polygons can be fixed 94 | psql communities -c "DROP TABLE IF EXISTS valid_water" 95 | psql communities -c "CREATE TABLE valid_water AS ( SELECT ST_Makevalid(wkb_geometry) AS the_geom FROM water_tile)" 96 | # blow away the small ones 97 | psql communities -c "DELETE FROM valid_water WHERE ST_Area( ST_Transform( the_geom, 3857 ) ) < 500000" 98 | POND_COUNT=$(psql communities -t -c "SELECT count(*) FROM valid_water") 99 | if [ $POND_COUNT = 0 ]; then 100 | echo "no large-ish water bodies" 101 | psql communities -c "DROP TABLE IF EXISTS water_tile" 102 | psql communities -c "DROP TABLE IF EXISTS valid_water" 103 | else 104 | psql communities -f ../../processing/water/piranha.sql 105 | sleep 2 106 | echo "chomped $POND_COUNT water bodies in tile $g" 107 | fi 108 | done 109 | psql communities -c "DROP TABLE IF EXISTS backfilled_tracts" 110 | psql communities -c "CREATE TABLE backfilled_tracts AS (SELECT * FROM tracts_backfill WHERE geoid NOT IN (SELECT geoid FROM community_tracts) UNION ALL SELECT * FROM community_tracts)" 111 | psql communities -c "DROP TABLE IF EXISTS community_tracts" 112 | psql communities -c "ALTER TABLE backfilled_tracts RENAME TO community_tracts" 113 | psql communities -c "ALTER TABLE community_tracts ALTER COLUMN p0010001 TYPE int USING p0010001::int" 114 | psql communities -c "ALTER TABLE community_tracts RENAME COLUMN p0010001 TO total_population" 115 | psql communities -c "ALTER TABLE community_tracts ALTER COLUMN largest_group_count TYPE int USING largest_group_count::int" 116 | psql communities -c "ALTER TABLE community_tracts ALTER COLUMN largest_group_proportion TYPE float USING largest_group_proportion::float" 117 | psql communities -c "ALTER TABLE community_tracts ADD COLUMN population_density int" 118 | # calc populatioln density using albers because mercator was just comprehensively awful for everything 119 | psql communities -c "UPDATE community_tracts SET population_density = round(total_population/(ST_Area(ST_Transform(wkb_geometry,2163))/1000000)) WHERE (ST_Area(ST_Transform(wkb_geometry,2163))/1000000) > 0" 120 | 121 | echo '------------dissolving and eroding community boundaries------------' 122 | psql communities -f ../../processing/form/form.sql 123 | 124 | echo '------------exporting final geojson(s)------------' 125 | # CLEAR THE DECKS 126 | rm -f communities_polys.geojson 127 | rm -f communities_points.geojson 128 | rm -f communities_mask.geojson 129 | rm -f communities_tracts.geojson 130 | 131 | # EXPORT THE 3 MAP-READY FILES TO THE TMP DATA DIRECTORY 132 | ogr2ogr -f "GeoJSON" communities_polys.geojson PG:"host=localhost dbname=communities" -sql "SELECT * from community_polys WHERE largest_group_count IS NOT NULL AND total_population IS NOT NULL" 133 | ogr2ogr -f "GeoJSON" communities_points.geojson PG:"host=localhost dbname=communities" -sql "SELECT * from community_centroids WHERE largest_group_count IS NOT NULL AND total_population IS NOT NULL" 134 | ogr2ogr -f "GeoJSON" communities_mask.geojson PG:"host=localhost dbname=communities" -sql "SELECT * from community_mask" 135 | ogr2ogr -f "GeoJSON" communities_tracts.geojson PG:"host=localhost dbname=communities" -sql "SELECT * from community_tracts WHERE largest_group_count > 0 AND total_population > 0" 136 | # DEFINE DATA LAYER NAMES 137 | POLYS=$MB_USER.rl_$STATE_ABBRV"_"$COUNTY_NAME 138 | POINTS=$MB_USER.rl_points_$STATE_ABBRV"_"$COUNTY_NAME 139 | MASK=$MB_USER.rl_mask_$STATE_ABBRV"_"$COUNTY_NAME 140 | TRACTS=$MB_USER.rl_tracts_$STATE_ABBRV"_"$COUNTY_NAME 141 | 142 | echo '------------uploading geojson to mapbox data' 143 | export MAPBOX_ACCESS_TOKEN=$REDLINES_MB_TOKEN 144 | mapbox upload communities_polys.geojson $POLYS --name communities_polys 145 | mapbox upload communities_points.geojson $POINTS --name communities_points 146 | mapbox upload communities_mask.geojson $MASK --name communities_mask 147 | mapbox upload communities_tracts.geojson $TRACTS --name communities_tracts 148 | 149 | echo "------------creating mapbox studio projects for $STATE_NAME county $COUNTY_FIPS------------" 150 | cd ../../cartography 151 | # CREATE A COUNTY-SPECIFIC MAPBOX STUDIO CLASSIC PROJECT 152 | rm -rf rl_$STATE_ABBRV"_"$COUNTY_NAME.tm2 153 | cp -r redlines.tm2 rl_$STATE_ABBRV"_"$COUNTY_NAME.tm2 154 | 155 | # GET CENTROID OF COUNTY 156 | COUNTY_LAT=$(psql communities -t -c "SELECT ST_Y(ST_Centroid(ST_Collect(the_geom))) FROM community_polys") 157 | COUNTY_LON=$(psql communities -t -c "SELECT ST_X(ST_Centroid(ST_Collect(the_geom))) FROM community_polys") 158 | 159 | # REWRITE PROJECT CONFIG FILES 160 | cd rl_$STATE_ABBRV"_"$COUNTY_NAME.tm2/ 161 | sed -i tmp2.bak "s/name: Tribes/name: Tribes - $COUNTY_NAME, $STATE_NAME/g" project.yml 162 | sed -i tmp3.bak "s/landplanner.0xsgug3g/$POLYS/g" project.yml 163 | sed -i tmp3.bak "s/landplanner.69rz84n1/$POINTS/g" project.yml 164 | sed -i tmp3.bak "s/landplanner.0ufuyubk/$MASK/g" project.yml 165 | sed -i tmp3.bak "s/landplanner.placeholder/$TRACTS/g" project.yml 166 | sed -i tmp4.bak "s/- -118.2437/-$COUNTY_LON/g" project.yml 167 | sed -i tmp5.bak "s/- 34.0522/-$COUNTY_LAT/g" project.yml 168 | 169 | # EXPORT LEGEND WITH EMPTY GROUPS REMOVED 170 | psql communities -c "\\copy (SELECT * FROM community_legend) TO STDOUT DELIMITER ',' CSV HEADER" | csvgrep -c 2 -r '\S' > legend/community_legend.csv 171 | 172 | cp legend/community_legend.csv bubbles/ 173 | 174 | # TODO fix static server and install phantomjs 175 | 176 | # EXPORT LEGEND TO PNG FOR LAYOUT 177 | cd legend/ 178 | # START A WEB SERVER 179 | static-server -p 8000 "$output""$ext" & 180 | STATICPID=$! 181 | sleep 10 182 | echo 'waiting 10s for server to spin up' 183 | # EXPORT THE IMAGE 184 | phantomjs rasterize.js http://localhost:8000/index.html legend.png 185 | # KILL THE WEBSERVER 186 | kill -s 9 $STATICPID 187 | cp legend.png ../img/ 188 | cp legend.png ../exports/ 189 | 190 | # EXPORT BUBBLE CHART TO PNG FOR LAYOUT 191 | cd ../bubbles/ 192 | # START A WEB SERVER 193 | static-server -p 8000 "$output""$ext" & 194 | STATICPID=$! 195 | sleep 10 196 | echo 'waiting 10s for server to spin up' 197 | # EXPORT THE IMAGE 198 | phantomjs rasterize.js http://localhost:8000/index.html bubbles.png 199 | # KILL THE WEBSERVER 200 | kill -s 9 $STATICPID 201 | cp bubbles.png ../img/ 202 | cp bubbles.png ../exports/ 203 | cd ../../../ 204 | 205 | # CLEAR OUT THE TEMP DATA TO SAVE SPACE 206 | rm -rf data/tmp/ 207 | 208 | echo "------------done! go add the project to mapbox studio and you're off to the races!------------" -------------------------------------------------------------------------------- /cartography/redlines.tm2/.thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/.thumb.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright © 2014, Mapbox. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in 11 | the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of the Mapbox, Inc. nor the names of 14 | its contributors may be used to endorse or promote products 15 | derived from this software without specific prior written 16 | permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 19 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 21 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 22 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 23 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 25 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 26 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 27 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /cartography/redlines.tm2/bookmarks.yml: -------------------------------------------------------------------------------- 1 | - place_name: 2811 W 36th Pl, Chicago, Illinois 60632, United States 2 | zoom: 10 3 | center: 4 | - 41.82698033386299 5 | - -87.69665249476249 6 | tags: 7 | - userbookmark 8 | index: 0 9 | -------------------------------------------------------------------------------- /cartography/redlines.tm2/bubbles/MAW.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/bubbles/MAW.ttf -------------------------------------------------------------------------------- /cartography/redlines.tm2/bubbles/community_legend.csv: -------------------------------------------------------------------------------- 1 | largest_community_name,membership,avg_plurality,map_color,group 2 | African American,10506480,0.223334508,#5A89A1,African 3 | Chinese,30315,0.217408168,#574752,Asian 4 | Colombian,457,0.192664418,#6b595e,Hispanic/Latino 5 | Dominican,525,0.225225225,#536f91,Hispanic/Latino 6 | English,228,0.159887798,#725d3f,European 7 | German,469,0.166666667,#D99E39,European 8 | Irish,5472988,0.296888568,#405A56,European 9 | Italian,460902,0.252163924,#696935,European 10 | Puerto Rican,553,0.136106325,#363A3D,Hispanic/Latino 11 | Salvadoran,159912,0.198232689,#564e6d,Hispanic/Latino 12 | Polish,7079,0.111111111,#AB4C3C,European 13 | Vietnamese,1828,0.28336692,#365F74,Asian -------------------------------------------------------------------------------- /cartography/redlines.tm2/bubbles/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | -------------------------------------------------------------------------------- /cartography/redlines.tm2/bubbles/rasterize.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var page = require('webpage').create(), 3 | system = require('system'), 4 | address, output, size; 5 | 6 | if (system.args.length < 3 || system.args.length > 5) { 7 | console.log('Usage: rasterize.js URL filename [paperwidth*paperheight|paperformat] [zoom]'); 8 | console.log(' paper (pdf output) examples: "5in*7.5in", "10cm*20cm", "A4", "Letter"'); 9 | console.log(' image (png/jpg output) examples: "1920px" entire page, window width 1920px'); 10 | console.log(' "800px*600px" window, clipped to 800x600'); 11 | phantom.exit(1); 12 | } else { 13 | address = system.args[1]; 14 | output = system.args[2]; 15 | page.viewportSize = { width: 600, height: 600 }; 16 | if (system.args.length > 3 && system.args[2].substr(-4) === ".pdf") { 17 | size = system.args[3].split('*'); 18 | page.paperSize = size.length === 2 ? { width: size[0], height: size[1], margin: '0px' } 19 | : { format: system.args[3], orientation: 'portrait', margin: '1cm' }; 20 | } else if (system.args.length > 3 && system.args[3].substr(-2) === "px") { 21 | size = system.args[3].split('*'); 22 | if (size.length === 2) { 23 | pageWidth = parseInt(size[0], 10); 24 | pageHeight = parseInt(size[1], 10); 25 | page.viewportSize = { width: pageWidth, height: pageHeight }; 26 | page.clipRect = { top: 0, left: 0, width: pageWidth, height: pageHeight }; 27 | } else { 28 | console.log("size:", system.args[3]); 29 | pageWidth = parseInt(system.args[3], 10); 30 | pageHeight = parseInt(pageWidth * 3/4, 10); // it's as good an assumption as any 31 | console.log ("pageHeight:",pageHeight); 32 | page.viewportSize = { width: pageWidth, height: pageHeight }; 33 | } 34 | } 35 | if (system.args.length > 4) { 36 | page.zoomFactor = system.args[4]; 37 | } 38 | page.open(address, function (status) { 39 | if (status !== 'success') { 40 | console.log('Unable to load the address!'); 41 | phantom.exit(1); 42 | } else { 43 | window.setTimeout(function () { 44 | page.render(output); 45 | phantom.exit(); 46 | }, 200); 47 | } 48 | }); 49 | } -------------------------------------------------------------------------------- /cartography/redlines.tm2/communities.mss: -------------------------------------------------------------------------------- 1 | // Use for redlines 2 | #communities_polys { 3 | line-color: #FFF; 4 | line-width: 0; 5 | line-opacity: 1; 6 | polygon-smooth:0.4; 7 | polygon-opacity:0.9; 8 | polygon-comp-op:overlay; 9 | image-filters:agg-stack-blur(3,3); 10 | [largest_community_name='Total']{ polygon-fill: #ffffff; } 11 | [largest_community_name='White']{ polygon-fill: #333333; } 12 | [largest_community_name='African American']{ polygon-fill: #5A89A1; } 13 | [largest_community_name='American Indian']{ polygon-fill: #8b9cb3; } 14 | [largest_community_name='Asian']{ polygon-fill: #9297a7; } 15 | [largest_community_name='Hawaiian/Pacific Islander']{ polygon-fill: #999099; } 16 | [largest_community_name='Other race']{ polygon-fill: #9e8b8c; } 17 | [largest_community_name='More than one race']{ polygon-fill: #a3857f; } 18 | [largest_community_name='Hispanic/Latino']{ polygon-fill: #a67f72; } 19 | [largest_community_name='Indian']{ polygon-fill: #352B6C; } 20 | [largest_community_name='Bangladeshi']{ polygon-fill: #a97965; } 21 | [largest_community_name='Bhutanese']{ polygon-fill: #ab745a; } 22 | [largest_community_name='Burmese']{ polygon-fill: #ad6d4d; } 23 | [largest_community_name='Cambodian']{ polygon-fill: #ae6741; } 24 | [largest_community_name='Chinese']{ polygon-fill: #574752; } 25 | [largest_community_name='Filipino']{ polygon-fill: #B9A450; } 26 | [largest_community_name='Hmong']{ polygon-fill: #ad6237; } 27 | [largest_community_name='Indonesian']{ polygon-fill: #a4613f; } 28 | [largest_community_name='Japanese']{ polygon-fill: #9a6047; } 29 | [largest_community_name='Korean']{ polygon-fill: #E0C087; } 30 | [largest_community_name='Laotian']{ polygon-fill: #8f5e4f; } 31 | [largest_community_name='Malaysian']{ polygon-fill: #865d55; } 32 | [largest_community_name='Nepalese']{ polygon-fill: #7b5c5d; } 33 | [largest_community_name='Pakistani']{ polygon-fill: #6e5b64; } 34 | [largest_community_name='Sri Lankan']{ polygon-fill: #5f5a6c; } 35 | [largest_community_name='Taiwanese']{ polygon-fill: #525871; } 36 | [largest_community_name='Thai']{ polygon-fill: #3e5779; } 37 | [largest_community_name='Vietnamese']{ polygon-fill: #365F74; } 38 | [largest_community_name='Mexican']{ polygon-fill: #B87824; } 39 | [largest_community_name='Puerto Rican']{ polygon-fill: #363A3D; } 40 | [largest_community_name='Cuban']{ polygon-fill: #567b99; } 41 | [largest_community_name='Dominican']{ polygon-fill: #536f91; } 42 | [largest_community_name='Costa Rican']{ polygon-fill: #51648a; } 43 | [largest_community_name='Guatemalan']{ polygon-fill: #505c83; } 44 | [largest_community_name='Honduran']{ polygon-fill: #50567d; } 45 | [largest_community_name='Nicaraguan']{ polygon-fill: #515277; } 46 | [largest_community_name='Panamanian']{ polygon-fill: #534f72; } 47 | [largest_community_name='Salvadoran']{ polygon-fill: #564e6d; } 48 | [largest_community_name='Argentinean']{ polygon-fill: #5a4e69; } 49 | [largest_community_name='Bolivian']{ polygon-fill: #5f5065; } 50 | [largest_community_name='Chilean']{ polygon-fill: #645461; } 51 | [largest_community_name='Colombian']{ polygon-fill: #6b595e; } 52 | [largest_community_name='Ecuadorian']{ polygon-fill: #735f5c; } 53 | [largest_community_name='Paraguayan']{ polygon-fill: #7c675a; } 54 | [largest_community_name='Peruvian']{ polygon-fill: #867058; } 55 | [largest_community_name='Uruguayan']{ polygon-fill: #917b56; } 56 | [largest_community_name='Venezuelan']{ polygon-fill: #9d8754; } 57 | [largest_community_name='Spanish']{ polygon-fill: #aa9552; } 58 | [largest_community_name='Afghan']{ polygon-fill: #b9a450; } 59 | [largest_community_name='Albanian']{ polygon-fill: #e0c087; } 60 | [largest_community_name='Egyptian']{ polygon-fill: #dbb478; } 61 | [largest_community_name='Iraqi']{ polygon-fill: #d5a968; } 62 | [largest_community_name='Lebanese']{ polygon-fill: #cf9d59; } 63 | [largest_community_name='Moroccan']{ polygon-fill: #c8924a; } 64 | [largest_community_name='Palestinian']{ polygon-fill: #c1873a; } 65 | [largest_community_name='Syrian']{ polygon-fill: #ba7c2a; } 66 | [largest_community_name='Armenian']{ polygon-fill: #aa7129; } 67 | [largest_community_name='Austrian']{ polygon-fill: #96672f; } 68 | [largest_community_name='Brazilian']{ polygon-fill: #825d33; } 69 | [largest_community_name='Cajun']{ polygon-fill: #6e5337; } 70 | [largest_community_name='Croatian']{ polygon-fill: #5a4a3a; } 71 | [largest_community_name='Czech']{ polygon-fill: #45403c; } 72 | [largest_community_name='Danish']{ polygon-fill: #3f3f3e; } 73 | [largest_community_name='Dutch']{ polygon-fill: #584d3f; } 74 | [largest_community_name='English']{ polygon-fill: #725d3f; } 75 | [largest_community_name='Finnish']{ polygon-fill: #8b6c3f; } 76 | [largest_community_name='French']{ polygon-fill: #a47d3e; } 77 | [largest_community_name='French Canadian']{ polygon-fill: #be8d3c; } 78 | [largest_community_name='German']{ polygon-fill: #D99E39; } 79 | [largest_community_name='Greek']{ polygon-fill: #1F1C2D; } 80 | [largest_community_name='Guyanese']{ polygon-fill: #d99e39; } 81 | [largest_community_name='Hungarian']{ polygon-fill: #1f1c2d; } 82 | [largest_community_name='Iranian']{ polygon-fill: #232332; } 83 | [largest_community_name='Irish']{ polygon-fill: #405A56; } 84 | [largest_community_name='Israeli']{ polygon-fill: #272a37; } 85 | [largest_community_name='Italian']{ polygon-fill: #696935; } 86 | [largest_community_name='Lithuanian']{ polygon-fill: #2b323c; } 87 | [largest_community_name='Norwegian']{ polygon-fill: #303941; } 88 | [largest_community_name='Pennsylvania German']{ polygon-fill: #334145; } 89 | [largest_community_name='Polish']{ polygon-fill: #AB4C3C; } 90 | [largest_community_name='Portuguese']{ polygon-fill: #37494b; } 91 | [largest_community_name='Romanian']{ polygon-fill: #8B9CB3; } 92 | [largest_community_name='Russian']{ polygon-fill: #AF6235; } 93 | [largest_community_name='Scottish']{ polygon-fill: #3b5150; } 94 | [largest_community_name='Slovak']{ polygon-fill: #3f5955; } 95 | [largest_community_name='Cape Verdean']{ polygon-fill: #4f5e4c; } 96 | [largest_community_name='Ethiopian']{ polygon-fill: #60653e; } 97 | [largest_community_name='Ghanaian']{ polygon-fill: #ab4c3c; } 98 | [largest_community_name='Nigerian']{ polygon-fill: #7d6a53; } 99 | [largest_community_name='Somali']{ polygon-fill: #806c53; } 100 | [largest_community_name='Sudanese']{ polygon-fill: #846f53; } 101 | [largest_community_name='Swedish']{ polygon-fill: #877353; } 102 | [largest_community_name='Swiss']{ polygon-fill: #8b7753; } 103 | [largest_community_name='Turkish']{ polygon-fill: #8e7953; } 104 | [largest_community_name='Ukrainian']{ polygon-fill: #3E5779; } 105 | [largest_community_name='Welsh']{ polygon-fill: #927d53; } 106 | [largest_community_name='Haitian']{ polygon-fill: #958153; } 107 | [largest_community_name='Jamaican']{ polygon-fill: #695653; } 108 | ::labels [zoom>=15]{ 109 | //marker-width:20px; 110 | text-name: "[largest_community_name]"; 111 | text-transform: uppercase; 112 | text-face-name: @normal; 113 | text-wrap-width: 100; 114 | text-wrap-before: true; 115 | text-fill: #222; 116 | text-halo-fill:#777; 117 | text-halo-radius:1.8px; 118 | text-halo-rasterizer:fast; 119 | text-size: 24; 120 | text-avoid-edges: true; 121 | text-repeat-distance: 200px; 122 | text-margin:30px; 123 | text-comp-op:grain-extract; 124 | } 125 | } 126 | 127 | #communities_points { 128 | ::labels [zoom<15]{ 129 | //marker-width:20px; 130 | text-name: "[largest_community_name]"; 131 | text-transform: uppercase; 132 | text-face-name: @normal; 133 | text-wrap-width: 100; 134 | text-wrap-before: true; 135 | text-fill: #222; 136 | text-halo-fill:#777; 137 | text-halo-radius:1.8px; 138 | text-halo-rasterizer:fast; 139 | text-size: 24; 140 | text-avoid-edges: true; 141 | text-repeat-distance: 200px; 142 | text-margin:30px; 143 | text-comp-op:grain-extract; 144 | } 145 | } 146 | 147 | 148 | // Use for segregation 149 | /*#communities_tracts { 150 | line-width: 0; 151 | line-opacity: 1; 152 | polygon-smooth:0.1; 153 | polygon-opacity:0.9; 154 | polygon-fill: #e66101; 155 | [largest_group_proportion<0.1]{ polygon-opacity: 0 } 156 | [largest_group_proportion>=0.1][largest_group_proportion<0.2]{ polygon-opacity: 0.1 } 157 | [largest_group_proportion>=0.2][largest_group_proportion<0.3]{ polygon-opacity: 0.2 } 158 | [largest_group_proportion>=0.3][largest_group_proportion<0.4]{ polygon-opacity: 0.3 } 159 | [largest_group_proportion>=0.4][largest_group_proportion<0.5]{ polygon-opacity: 0.4 } 160 | [largest_group_proportion>=0.5][largest_group_proportion<0.6]{ polygon-opacity: 0.5 } 161 | [largest_group_proportion>=0.6][largest_group_proportion<0.7]{ polygon-opacity: 0.7 } 162 | [largest_group_proportion>=0.7][largest_group_proportion<0.8]{ polygon-opacity: 0.8 } 163 | [largest_group_proportion>=0.8][largest_group_proportion<0.9]{ polygon-opacity: 0.9 } 164 | [largest_group_proportion>=1]{ polygon-opacity: 1 } 165 | }*/ 166 | // Use for population density 167 | /*#communities_tracts { 168 | line-width: 0; 169 | line-opacity: 1; 170 | polygon-smooth:0.1; 171 | polygon-opacity:0.9; 172 | polygon-fill: #5e3c99; 173 | [population_density<50]{ polygon-opacity: 0 } 174 | [population_density>=50][population_density<100]{ polygon-opacity: 0.1 } 175 | [population_density>=100][population_density<250]{ polygon-opacity: 0.2 } 176 | [population_density>=250][population_density<500]{ polygon-opacity: 0.3 } 177 | [population_density>=500][population_density<1000]{ polygon-opacity: 0.4 } 178 | [population_density>=1000][population_density<2000]{ polygon-opacity: 0.5 } 179 | [population_density>=2000][population_density<3000]{ polygon-opacity: 0.7 } 180 | [population_density>=3000][population_density<5000]{ polygon-opacity: 0.8 } 181 | [population_density>=5000][population_density<7500]{ polygon-opacity: 0.9 } 182 | [population_density>=7500]{ polygon-opacity: 1 } 183 | } 184 | */ 185 | // use for redlines overlay 186 | /*#communities_polys { 187 | line-color: #333; 188 | line-width: 3; 189 | line-offset:2; 190 | line-opacity: 1; 191 | polygon-opacity: 0; 192 | } 193 | */ 194 | // mask for all configurations 195 | #communities_mask { 196 | polygon-opacity: 0; 197 | polygon-comp-op: src; 198 | line-width:8px; 199 | line-color:#F1EDE1; 200 | line-opacity: 0.2; 201 | line-smooth: 0.5; 202 | } -------------------------------------------------------------------------------- /cartography/redlines.tm2/exports/los_angeles_communities_2014.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/exports/los_angeles_communities_2014.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/exports/tribes_06_037.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/exports/tribes_06_037.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/fonts/Linotte-SemiBold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/fonts/Linotte-SemiBold.otf -------------------------------------------------------------------------------- /cartography/redlines.tm2/fonts/MAW.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/fonts/MAW.ttf -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/dot_fill.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/dot_fill.jpg -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/dot_fill_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/dot_fill_2.jpg -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/hatch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/hatch.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/line_dotted_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/line_dotted_10.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/line_dotted_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/line_dotted_12.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/line_dotted_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/line_dotted_4.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/line_dotted_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/line_dotted_6.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/line_dotted_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/line_dotted_8.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/line_double_14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/line_double_14.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/line_double_14_mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/line_double_14_mask.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/line_double_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/line_double_16.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/line_double_16_mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/line_double_16_mask.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/line_double_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/line_double_18.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/line_double_18_mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/line_double_18_mask.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/line_double_20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/line_double_20.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/line_double_20_mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/line_double_20_mask.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/line_shade_22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/line_shade_22.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/line_shade_22_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/line_shade_22_1.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/line_shade_22_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/line_shade_22_2.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/line_shade_22_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/line_shade_22_4.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/line_solid_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/line_solid_6.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/line_solid_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/line_solid_7.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/line_water_14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/line_water_14.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/linedpaper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/linedpaper.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/linedpaper_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/linedpaper_256.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/natural_paper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/natural_paper.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/shade_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/shade_dark.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/shade_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/shade_light.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/shade_medium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/shade_medium.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/shade_medium_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/shade_medium_2.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/shade_medium_seamless.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/shade_medium_seamless.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/texture.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/texture_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/texture_2.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/texture_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/texture_3.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/img/water.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/img/water.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/labels.mss: -------------------------------------------------------------------------------- 1 | @normal: 'MAW Medium'; 2 | 3 | #place_label [scalerank<3],[name_en='downtown'] { 4 | text-name: "[name_en]"; 5 | text-transform: uppercase; 6 | text-face-name: @normal; 7 | text-wrap-width: 20; 8 | text-wrap-before: true; 9 | text-avoid-edges: true; 10 | text-min-padding:50px; 11 | text-fill: #333; 12 | text-size: 14; 13 | //text-comp-op: grain-merge; 14 | } 15 | 16 | #poi_label[scalerank<2] { 17 | text-name: "[name]"; 18 | text-transform: uppercase; 19 | text-face-name: @normal; 20 | text-wrap-width: 20; 21 | text-wrap-before: true; 22 | //text-avoid-edges: true; 23 | text-margin: 10px; 24 | text-fill: #333; 25 | text-size: 16; 26 | //text-comp-op: grain-merge; 27 | } 28 | 29 | 30 | #road_label [class='main'] { 31 | text-name: "[name]"; 32 | text-transform: uppercase; 33 | text-face-name: @normal; 34 | text-placement: line; 35 | text-fill: #555; 36 | text-size: 10; 37 | //text-allow-overlap: true; 38 | text-avoid-edges: true; 39 | text-margin:50px; 40 | text-repeat-distance:500px; 41 | text-min-padding:50px; 42 | //text-comp-op:grain-merge; 43 | } -------------------------------------------------------------------------------- /cartography/redlines.tm2/legend/MAW.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/legend/MAW.ttf -------------------------------------------------------------------------------- /cartography/redlines.tm2/legend/community_legend.csv: -------------------------------------------------------------------------------- 1 | largest_community_name,membership,avg_plurality,map_color 2 | African American,10506480,0.223334508094195,#5A89A1 3 | Chinese,30315,0.217408167920748,#574752 4 | Colombian,457,0.192664418212479,#6b595e 5 | Dominican,525,0.225225225225225,#536f91 6 | English,228,0.159887798036466,#725d3f 7 | Hawaiian/Pacific Islander,1,0.166666666666667,#999099 8 | Irish,5472988,0.296888568326522,#405A56 9 | Italian,460902,0.252163924456585,#696935 10 | Puerto Rican,553,0.136106325375338,#363A3D 11 | Salvadoran,159912,0.198232688749065,#564e6d 12 | Spanish,1,0.111111111111111,#aa9552 13 | Vietnamese,1828,0.283366919857386,#365F74 14 | -------------------------------------------------------------------------------- /cartography/redlines.tm2/legend/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Bar Chart 6 | 7 | 23 | 24 | 25 |
26 | 27 | 120 | 121 | -------------------------------------------------------------------------------- /cartography/redlines.tm2/legend/legend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/legend/legend.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/legend/rasterize.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var page = require('webpage').create(), 3 | system = require('system'), 4 | address, output, size; 5 | 6 | if (system.args.length < 3 || system.args.length > 5) { 7 | console.log('Usage: rasterize.js URL filename [paperwidth*paperheight|paperformat] [zoom]'); 8 | console.log(' paper (pdf output) examples: "5in*7.5in", "10cm*20cm", "A4", "Letter"'); 9 | console.log(' image (png/jpg output) examples: "1920px" entire page, window width 1920px'); 10 | console.log(' "800px*600px" window, clipped to 800x600'); 11 | phantom.exit(1); 12 | } else { 13 | address = system.args[1]; 14 | output = system.args[2]; 15 | page.viewportSize = { width: 600, height: 600 }; 16 | if (system.args.length > 3 && system.args[2].substr(-4) === ".pdf") { 17 | size = system.args[3].split('*'); 18 | page.paperSize = size.length === 2 ? { width: size[0], height: size[1], margin: '0px' } 19 | : { format: system.args[3], orientation: 'portrait', margin: '1cm' }; 20 | } else if (system.args.length > 3 && system.args[3].substr(-2) === "px") { 21 | size = system.args[3].split('*'); 22 | if (size.length === 2) { 23 | pageWidth = parseInt(size[0], 10); 24 | pageHeight = parseInt(size[1], 10); 25 | page.viewportSize = { width: pageWidth, height: pageHeight }; 26 | page.clipRect = { top: 0, left: 0, width: pageWidth, height: pageHeight }; 27 | } else { 28 | console.log("size:", system.args[3]); 29 | pageWidth = parseInt(system.args[3], 10); 30 | pageHeight = parseInt(pageWidth * 3/4, 10); // it's as good an assumption as any 31 | console.log ("pageHeight:",pageHeight); 32 | page.viewportSize = { width: pageWidth, height: pageHeight }; 33 | } 34 | } 35 | if (system.args.length > 4) { 36 | page.zoomFactor = system.args[4]; 37 | } 38 | page.open(address, function (status) { 39 | if (status !== 'success') { 40 | console.log('Unable to load the address!'); 41 | phantom.exit(1); 42 | } else { 43 | window.setTimeout(function () { 44 | page.render(output); 45 | phantom.exit(); 46 | }, 200); 47 | } 48 | }); 49 | } -------------------------------------------------------------------------------- /cartography/redlines.tm2/legend/texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/legend/texture.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/pop_legend/MAW.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/pop_legend/MAW.ttf -------------------------------------------------------------------------------- /cartography/redlines.tm2/pop_legend/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Continuous legend 6 | 7 | 23 | 24 | 25 |
26 | 27 | 59 | 60 | -------------------------------------------------------------------------------- /cartography/redlines.tm2/pop_legend/rasterize.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var page = require('webpage').create(), 3 | system = require('system'), 4 | address, output, size; 5 | 6 | if (system.args.length < 3 || system.args.length > 5) { 7 | console.log('Usage: rasterize.js URL filename [paperwidth*paperheight|paperformat] [zoom]'); 8 | console.log(' paper (pdf output) examples: "5in*7.5in", "10cm*20cm", "A4", "Letter"'); 9 | console.log(' image (png/jpg output) examples: "1920px" entire page, window width 1920px'); 10 | console.log(' "800px*600px" window, clipped to 800x600'); 11 | phantom.exit(1); 12 | } else { 13 | address = system.args[1]; 14 | output = system.args[2]; 15 | page.viewportSize = { width: 600, height: 600 }; 16 | if (system.args.length > 3 && system.args[2].substr(-4) === ".pdf") { 17 | size = system.args[3].split('*'); 18 | page.paperSize = size.length === 2 ? { width: size[0], height: size[1], margin: '0px' } 19 | : { format: system.args[3], orientation: 'portrait', margin: '1cm' }; 20 | } else if (system.args.length > 3 && system.args[3].substr(-2) === "px") { 21 | size = system.args[3].split('*'); 22 | if (size.length === 2) { 23 | pageWidth = parseInt(size[0], 10); 24 | pageHeight = parseInt(size[1], 10); 25 | page.viewportSize = { width: pageWidth, height: pageHeight }; 26 | page.clipRect = { top: 0, left: 0, width: pageWidth, height: pageHeight }; 27 | } else { 28 | console.log("size:", system.args[3]); 29 | pageWidth = parseInt(system.args[3], 10); 30 | pageHeight = parseInt(pageWidth * 3/4, 10); // it's as good an assumption as any 31 | console.log ("pageHeight:",pageHeight); 32 | page.viewportSize = { width: pageWidth, height: pageHeight }; 33 | } 34 | } 35 | if (system.args.length > 4) { 36 | page.zoomFactor = system.args[4]; 37 | } 38 | page.open(address, function (status) { 39 | if (status !== 'success') { 40 | console.log('Unable to load the address!'); 41 | phantom.exit(1); 42 | } else { 43 | window.setTimeout(function () { 44 | page.render(output); 45 | phantom.exit(); 46 | }, 200); 47 | } 48 | }); 49 | } -------------------------------------------------------------------------------- /cartography/redlines.tm2/pop_legend/texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/redlines.tm2/pop_legend/texture.png -------------------------------------------------------------------------------- /cartography/redlines.tm2/project.yml: -------------------------------------------------------------------------------- 1 | _prefs: 2 | saveCenter: false 3 | _properties: {} 4 | attribution: "Terms & Feedback" 5 | bounds: 6 | - -180 7 | - -85.0511 8 | - 180 9 | - 85.0511 10 | center: 11 | - -118.2437 12 | - 34.0522 13 | - 11 14 | description: A recreation of a 1950 community map of Chicago using census data 15 | format: "png8:m=h" 16 | interactivity_layer: '' 17 | layers: 18 | - landuse 19 | - waterway 20 | - water 21 | - aeroway 22 | - barrier_line 23 | - building 24 | - landuse_overlay 25 | - tunnel 26 | - road 27 | - bridge 28 | - admin 29 | - communities_tracts 30 | - communities_polys 31 | - communities_tracts 32 | - communities_points 33 | - country_label_line 34 | - country_label 35 | - marine_label 36 | - state_label 37 | - place_label 38 | - water_label 39 | - poi_label 40 | - road_label 41 | - waterway_label 42 | - housenum_label 43 | - communities_mask 44 | maxzoom: 21 45 | minzoom: 0 46 | name: Redlines 47 | source: "mapbox:///mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5,mapbox.mapbox-bathymetry-v1,landplanner.0xsgug3g,landplanner.69rz84n1,landplanner.0ufuyubk,landplanner.placeholder" 48 | styles: 49 | - style.mss 50 | - road.mss 51 | - communities.mss 52 | - labels.mss 53 | template: '' 54 | -------------------------------------------------------------------------------- /cartography/redlines.tm2/project.ymltmp3.bak: -------------------------------------------------------------------------------- 1 | _prefs: 2 | saveCenter: false 3 | _properties: {} 4 | attribution: "Terms & Feedback" 5 | bounds: 6 | - -180 7 | - -85.0511 8 | - 180 9 | - 85.0511 10 | center: 11 | - -118.2437 12 | - 34.0522 13 | - 11 14 | description: A recreation of a 1950 community map of Chicago using census data 15 | format: "png8:m=h" 16 | interactivity_layer: '' 17 | layers: 18 | - landuse 19 | - waterway 20 | - water 21 | - aeroway 22 | - barrier_line 23 | - building 24 | - landuse_overlay 25 | - tunnel 26 | - road 27 | - bridge 28 | - admin 29 | - communities_06_037 30 | - communities_points_06_037 31 | - country_label_line 32 | - country_label 33 | - marine_label 34 | - state_label 35 | - place_label 36 | - water_label 37 | - poi_label 38 | - road_label 39 | - waterway_label 40 | - housenum_label 41 | - communities_mask_06_037 42 | maxzoom: 21 43 | minzoom: 0 44 | name: Tribes 45 | source: "mapbox:///mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5,mapbox.mapbox-bathymetry-v1,landplanner.0xsgug3g,landplanner.69rz84n1,landplanner.0ufuyubk" 46 | styles: 47 | - style.mss 48 | - road.mss 49 | - communities.mss 50 | - labels.mss 51 | template: '' 52 | -------------------------------------------------------------------------------- /cartography/redlines.tm2/road.mss: -------------------------------------------------------------------------------- 1 | #road['mapnik::geometry_type'=2]::line, 2 | #bridge['mapnik::geometry_type'=2]::line, 3 | #tunnel['mapnik::geometry_type'=2]::line { 4 | [class='motorway'] { 5 | [zoom>=7][zoom<=12] { 6 | a/line-width:0.6; 7 | a/line-opacity:0.2; 8 | a/line-dasharray:2,1; 9 | b/line-width:0.8; 10 | b/line-opacity:0.2; 11 | b/line-dasharray:12,1; 12 | [zoom>=9] { 13 | a/line-opacity:0.1; 14 | b/line-opacity:0.1; 15 | } 16 | [zoom>=8] { 17 | a/line-width:1; 18 | b/line-width:1.2; 19 | } 20 | [zoom>=10] { 21 | a/line-width:1.6; 22 | b/line-width:2.0; 23 | } 24 | } 25 | [zoom=12] { line-pattern-file:url(img/line_solid_7.png); } 26 | } 27 | [class='motorway_link'], 28 | [class='main'] { 29 | [zoom>=7][zoom<=12] { 30 | a/line-color: #222; 31 | a/line-opacity: 0.25; 32 | a/line-width: 0.8; 33 | [zoom=8] { a/line-width: 0.9; } 34 | [zoom=9] { a/line-width: 1; } 35 | [zoom=10] { a/line-width: 1.1; } 36 | [zoom=11] { a/line-width: 1.2; } 37 | } 38 | [zoom=12] { line-pattern-file:url(img/line_solid_6.png); } 39 | [zoom=13] { line-pattern-file:url(img/line_solid_7.png); } 40 | } 41 | [class='major_rail'][zoom>=14], 42 | [class='minor_rail'][zoom>=16] { 43 | ['mapnik::geometry_type'=2] { 44 | a/line-width:1; 45 | a/line-opacity:0.05; 46 | a/line-dasharray:2,1; 47 | b/line-width:1.5; 48 | b/line-opacity:0.05; 49 | b/line-dasharray:12,1; 50 | c/line-width:2; 51 | c/line-opacity:0.05; 52 | c/line-dasharray:20,3; 53 | } 54 | } 55 | } 56 | 57 | #road::case, 58 | #bridge::case, 59 | #tunnel::case { 60 | ['mapnik::geometry_type'=2][zoom>=12][zoom<=20] { 61 | [class='motorway'] { 62 | [zoom=12] { line-pattern-file:url(img/line_double_14.png); } 63 | [zoom=13] { line-pattern-file:url(img/line_double_16.png); } 64 | [zoom=14] { line-pattern-file:url(img/line_double_18.png); } 65 | [zoom>15] { line-pattern-file:url(img/line_double_20.png); } 66 | } 67 | } 68 | } 69 | 70 | #road::dot['mapnik::geometry_type'=1][class='turning_circle'][zoom>=15] { 71 | marker-width: 6; 72 | [zoom>=16] { marker-width: 9; } 73 | [zoom>=17] { marker-width: 12; } 74 | marker-fill: #e6e6e6; 75 | marker-line-color: #707070; 76 | marker-line-width: 1.5; 77 | } 78 | 79 | #road::fill, 80 | #bridge::fill { 81 | ['mapnik::geometry_type'=2][zoom>=12][zoom<=20] { 82 | [class='motorway'] { 83 | [zoom>=12] { line-pattern-file:url(img/line_double_14_mask.png); } 84 | [zoom=14] { line-pattern-file:url(img/line_double_16_mask.png); } 85 | [zoom=15] { line-pattern-file:url(img/line_double_18_mask.png); } 86 | [zoom>15] { line-pattern-file:url(img/line_double_20_mask.png); } 87 | } 88 | [class='motorway_link'], 89 | [class='main'] { 90 | [zoom=14] { line-pattern-file:url(img/line_double_14_mask.png); } 91 | [zoom=15] { line-pattern-file:url(img/line_double_16_mask.png); } 92 | [zoom>15] { line-pattern-file:url(img/line_double_20_mask.png); } 93 | } 94 | [class='street'], 95 | [class='street_limited'] { 96 | [zoom>=15] { line-pattern-file:url(img/line_double_14_mask.png); } 97 | [zoom>=16] { line-pattern-file:url(img/line_double_16_mask.png); } 98 | } 99 | } 100 | } 101 | 102 | #tunnel::case { opacity:0.25; } -------------------------------------------------------------------------------- /cartography/redlines.tm2/style.mss: -------------------------------------------------------------------------------- 1 | Map { 2 | //background-image:url(img/texture_3.png); 3 | font-directory: url('fonts'); 4 | buffer-size: 1024px; 5 | } 6 | 7 | #water { 8 | ::light14[zoom<=14], 9 | ::light15[zoom=15], 10 | ::light16[zoom=16], 11 | ::light17[zoom>=17] { 12 | polygon-fill: #ddd9ce; 13 | polygon-gamma: 0.3; 14 | polygon-opacity:0.6; 15 | image-filters: agg-stack-blur(8,8); 16 | image-filters-inflate: true; 17 | } 18 | ::light15[zoom=15] { image-filters: agg-stack-blur(16,16); } 19 | ::light16[zoom=16] { image-filters: agg-stack-blur(32,32); } 20 | ::light17[zoom<=17] { image-filters: agg-stack-blur(64,64); } 21 | // Pencil shading texture: 22 | ::texture { 23 | polygon-pattern-opacity:0.5; 24 | comp-op: multiply; 25 | polygon-pattern-alignment: global; 26 | polygon-pattern-file:url(img/hatch.png); 27 | } 28 | } 29 | 30 | #waterway [class!='river'] { 31 | line-color: #7E93AE; 32 | line-width:1px; 33 | line-smooth:1.8; 34 | line-opacity:0.2; 35 | line-cap:round; 36 | [class='canal'] { line-width:1.5px; } 37 | [class='river'] { line-width:3px; } 38 | } 39 | 40 | #aeroway['mapnik::geometry_type'=2][zoom>=12] { 41 | comp-op: multiply; 42 | opacity:0.5; 43 | [type='taxiway'] { 44 | [zoom=12] { line-pattern-file:url(img/line_solid_6.png); } 45 | [zoom=13] { line-pattern-file:url(img/line_solid_7.png); } 46 | [zoom=15] { line-pattern-file:url(img/line_shade_22_1.png); } 47 | [zoom=16] { line-pattern-file:url(img/line_shade_22_2.png); } 48 | [zoom>16] { line-pattern-file:url(img/line_shade_22_4.png); } 49 | } 50 | [type='runway'] { 51 | line-pattern-file:url(img/line_shade_22.png); 52 | [zoom>=15] { line-pattern-file:url(img/line_shade_22_2.png); } 53 | [zoom>=16] { line-pattern-file:url(img/line_shade_22_4.png); } 54 | } 55 | } -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/.thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/.thumb.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright © 2014, Mapbox. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in 11 | the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of the Mapbox, Inc. nor the names of 14 | its contributors may be used to endorse or promote products 15 | derived from this software without specific prior written 16 | permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 19 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 21 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 22 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 23 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 25 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 26 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 27 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/bookmarks.yml: -------------------------------------------------------------------------------- 1 | - place_name: 2811 W 36th Pl, Chicago, Illinois 60632, United States 2 | zoom: 10 3 | center: 4 | - 41.82698033386299 5 | - -87.69665249476249 6 | tags: 7 | - userbookmark 8 | index: 0 9 | -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/bubbles/MAW.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/bubbles/MAW.ttf -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/bubbles/bubbles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/bubbles/bubbles.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/bubbles/community_legend.csv: -------------------------------------------------------------------------------- 1 | largest_community_name,code,avg_plurality,membership,map_color 2 | African American,P0030003,0.253448434101636,405575,#5A89A1 3 | English,B04006_036E,0.182521766917769,68219,#725d3f 4 | German,B04006_042E,0.186100924631211,63481,#D99E39 5 | Indian,PCT0050002,0.190228453542137,21976,#352B6C 6 | Irish,B04006_049E,0.151139190535567,56091,#405A56 7 | Mexican,PCT0110004,0.35717151478255,44125,#B87824 8 | -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/bubbles/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/bubbles/rasterize.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var page = require('webpage').create(), 3 | system = require('system'), 4 | address, output, size; 5 | 6 | if (system.args.length < 3 || system.args.length > 5) { 7 | console.log('Usage: rasterize.js URL filename [paperwidth*paperheight|paperformat] [zoom]'); 8 | console.log(' paper (pdf output) examples: "5in*7.5in", "10cm*20cm", "A4", "Letter"'); 9 | console.log(' image (png/jpg output) examples: "1920px" entire page, window width 1920px'); 10 | console.log(' "800px*600px" window, clipped to 800x600'); 11 | phantom.exit(1); 12 | } else { 13 | address = system.args[1]; 14 | output = system.args[2]; 15 | page.viewportSize = { width: 600, height: 600 }; 16 | if (system.args.length > 3 && system.args[2].substr(-4) === ".pdf") { 17 | size = system.args[3].split('*'); 18 | page.paperSize = size.length === 2 ? { width: size[0], height: size[1], margin: '0px' } 19 | : { format: system.args[3], orientation: 'portrait', margin: '1cm' }; 20 | } else if (system.args.length > 3 && system.args[3].substr(-2) === "px") { 21 | size = system.args[3].split('*'); 22 | if (size.length === 2) { 23 | pageWidth = parseInt(size[0], 10); 24 | pageHeight = parseInt(size[1], 10); 25 | page.viewportSize = { width: pageWidth, height: pageHeight }; 26 | page.clipRect = { top: 0, left: 0, width: pageWidth, height: pageHeight }; 27 | } else { 28 | console.log("size:", system.args[3]); 29 | pageWidth = parseInt(system.args[3], 10); 30 | pageHeight = parseInt(pageWidth * 3/4, 10); // it's as good an assumption as any 31 | console.log ("pageHeight:",pageHeight); 32 | page.viewportSize = { width: pageWidth, height: pageHeight }; 33 | } 34 | } 35 | if (system.args.length > 4) { 36 | page.zoomFactor = system.args[4]; 37 | } 38 | page.open(address, function (status) { 39 | if (status !== 'success') { 40 | console.log('Unable to load the address!'); 41 | phantom.exit(1); 42 | } else { 43 | window.setTimeout(function () { 44 | page.render(output); 45 | phantom.exit(); 46 | }, 200); 47 | } 48 | }); 49 | } -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/communities.mss: -------------------------------------------------------------------------------- 1 | // Use for redlines 2 | #communities_polys { 3 | line-color: #FFF; 4 | line-width: 0; 5 | line-opacity: 1; 6 | polygon-smooth:0.4; 7 | polygon-opacity:0.9; 8 | polygon-comp-op:overlay; 9 | image-filters:agg-stack-blur(3,3); 10 | [largest_community_name='Total']{ polygon-fill: #ffffff; } 11 | [largest_community_name='White']{ polygon-fill: #333333; } 12 | [largest_community_name='African American']{ polygon-fill: #5A89A1; } 13 | [largest_community_name='American Indian']{ polygon-fill: #8b9cb3; } 14 | [largest_community_name='Asian']{ polygon-fill: #9297a7; } 15 | [largest_community_name='Hawaiian/Pacific Islander']{ polygon-fill: #999099; } 16 | [largest_community_name='Other race']{ polygon-fill: #9e8b8c; } 17 | [largest_community_name='More than one race']{ polygon-fill: #a3857f; } 18 | [largest_community_name='Hispanic/Latino']{ polygon-fill: #a67f72; } 19 | [largest_community_name='Indian']{ polygon-fill: #352B6C; } 20 | [largest_community_name='Bangladeshi']{ polygon-fill: #a97965; } 21 | [largest_community_name='Bhutanese']{ polygon-fill: #ab745a; } 22 | [largest_community_name='Burmese']{ polygon-fill: #ad6d4d; } 23 | [largest_community_name='Cambodian']{ polygon-fill: #ae6741; } 24 | [largest_community_name='Chinese']{ polygon-fill: #574752; } 25 | [largest_community_name='Filipino']{ polygon-fill: #B9A450; } 26 | [largest_community_name='Hmong']{ polygon-fill: #ad6237; } 27 | [largest_community_name='Indonesian']{ polygon-fill: #a4613f; } 28 | [largest_community_name='Japanese']{ polygon-fill: #9a6047; } 29 | [largest_community_name='Korean']{ polygon-fill: #E0C087; } 30 | [largest_community_name='Laotian']{ polygon-fill: #8f5e4f; } 31 | [largest_community_name='Malaysian']{ polygon-fill: #865d55; } 32 | [largest_community_name='Nepalese']{ polygon-fill: #7b5c5d; } 33 | [largest_community_name='Pakistani']{ polygon-fill: #6e5b64; } 34 | [largest_community_name='Sri Lankan']{ polygon-fill: #5f5a6c; } 35 | [largest_community_name='Taiwanese']{ polygon-fill: #525871; } 36 | [largest_community_name='Thai']{ polygon-fill: #3e5779; } 37 | [largest_community_name='Vietnamese']{ polygon-fill: #365F74; } 38 | [largest_community_name='Mexican']{ polygon-fill: #B87824; } 39 | [largest_community_name='Puerto Rican']{ polygon-fill: #363A3D; } 40 | [largest_community_name='Cuban']{ polygon-fill: #567b99; } 41 | [largest_community_name='Dominican']{ polygon-fill: #536f91; } 42 | [largest_community_name='Costa Rican']{ polygon-fill: #51648a; } 43 | [largest_community_name='Guatemalan']{ polygon-fill: #505c83; } 44 | [largest_community_name='Honduran']{ polygon-fill: #50567d; } 45 | [largest_community_name='Nicaraguan']{ polygon-fill: #515277; } 46 | [largest_community_name='Panamanian']{ polygon-fill: #534f72; } 47 | [largest_community_name='Salvadoran']{ polygon-fill: #564e6d; } 48 | [largest_community_name='Argentinean']{ polygon-fill: #5a4e69; } 49 | [largest_community_name='Bolivian']{ polygon-fill: #5f5065; } 50 | [largest_community_name='Chilean']{ polygon-fill: #645461; } 51 | [largest_community_name='Colombian']{ polygon-fill: #6b595e; } 52 | [largest_community_name='Ecuadorian']{ polygon-fill: #735f5c; } 53 | [largest_community_name='Paraguayan']{ polygon-fill: #7c675a; } 54 | [largest_community_name='Peruvian']{ polygon-fill: #867058; } 55 | [largest_community_name='Uruguayan']{ polygon-fill: #917b56; } 56 | [largest_community_name='Venezuelan']{ polygon-fill: #9d8754; } 57 | [largest_community_name='Spanish']{ polygon-fill: #aa9552; } 58 | [largest_community_name='Afghan']{ polygon-fill: #b9a450; } 59 | [largest_community_name='Albanian']{ polygon-fill: #e0c087; } 60 | [largest_community_name='Egyptian']{ polygon-fill: #dbb478; } 61 | [largest_community_name='Iraqi']{ polygon-fill: #d5a968; } 62 | [largest_community_name='Lebanese']{ polygon-fill: #cf9d59; } 63 | [largest_community_name='Moroccan']{ polygon-fill: #c8924a; } 64 | [largest_community_name='Palestinian']{ polygon-fill: #c1873a; } 65 | [largest_community_name='Syrian']{ polygon-fill: #ba7c2a; } 66 | [largest_community_name='Armenian']{ polygon-fill: #aa7129; } 67 | [largest_community_name='Austrian']{ polygon-fill: #96672f; } 68 | [largest_community_name='Brazilian']{ polygon-fill: #825d33; } 69 | [largest_community_name='Cajun']{ polygon-fill: #6e5337; } 70 | [largest_community_name='Croatian']{ polygon-fill: #5a4a3a; } 71 | [largest_community_name='Czech']{ polygon-fill: #45403c; } 72 | [largest_community_name='Danish']{ polygon-fill: #3f3f3e; } 73 | [largest_community_name='Dutch']{ polygon-fill: #584d3f; } 74 | [largest_community_name='English']{ polygon-fill: #725d3f; } 75 | [largest_community_name='Finnish']{ polygon-fill: #8b6c3f; } 76 | [largest_community_name='French']{ polygon-fill: #a47d3e; } 77 | [largest_community_name='French Canadian']{ polygon-fill: #be8d3c; } 78 | [largest_community_name='German']{ polygon-fill: #D99E39; } 79 | [largest_community_name='Greek']{ polygon-fill: #1F1C2D; } 80 | [largest_community_name='Guyanese']{ polygon-fill: #d99e39; } 81 | [largest_community_name='Hungarian']{ polygon-fill: #1f1c2d; } 82 | [largest_community_name='Iranian']{ polygon-fill: #232332; } 83 | [largest_community_name='Irish']{ polygon-fill: #405A56; } 84 | [largest_community_name='Israeli']{ polygon-fill: #272a37; } 85 | [largest_community_name='Italian']{ polygon-fill: #696935; } 86 | [largest_community_name='Lithuanian']{ polygon-fill: #2b323c; } 87 | [largest_community_name='Norwegian']{ polygon-fill: #303941; } 88 | [largest_community_name='Pennsylvania German']{ polygon-fill: #334145; } 89 | [largest_community_name='Polish']{ polygon-fill: #AB4C3C; } 90 | [largest_community_name='Portuguese']{ polygon-fill: #37494b; } 91 | [largest_community_name='Romanian']{ polygon-fill: #8B9CB3; } 92 | [largest_community_name='Russian']{ polygon-fill: #AF6235; } 93 | [largest_community_name='Scottish']{ polygon-fill: #3b5150; } 94 | [largest_community_name='Slovak']{ polygon-fill: #3f5955; } 95 | [largest_community_name='Cape Verdean']{ polygon-fill: #4f5e4c; } 96 | [largest_community_name='Ethiopian']{ polygon-fill: #60653e; } 97 | [largest_community_name='Ghanaian']{ polygon-fill: #ab4c3c; } 98 | [largest_community_name='Nigerian']{ polygon-fill: #7d6a53; } 99 | [largest_community_name='Somali']{ polygon-fill: #806c53; } 100 | [largest_community_name='Sudanese']{ polygon-fill: #846f53; } 101 | [largest_community_name='Swedish']{ polygon-fill: #877353; } 102 | [largest_community_name='Swiss']{ polygon-fill: #8b7753; } 103 | [largest_community_name='Turkish']{ polygon-fill: #8e7953; } 104 | [largest_community_name='Ukrainian']{ polygon-fill: #3E5779; } 105 | [largest_community_name='Welsh']{ polygon-fill: #927d53; } 106 | [largest_community_name='Haitian']{ polygon-fill: #958153; } 107 | [largest_community_name='Jamaican']{ polygon-fill: #695653; } 108 | ::labels [zoom>=15]{ 109 | //marker-width:20px; 110 | text-name: "[largest_community_name]"; 111 | text-transform: uppercase; 112 | text-face-name: @normal; 113 | text-wrap-width: 100; 114 | text-wrap-before: true; 115 | text-fill: #222; 116 | text-halo-fill:#777; 117 | text-halo-radius:1.8px; 118 | text-halo-rasterizer:fast; 119 | text-size: 24; 120 | text-avoid-edges: true; 121 | text-repeat-distance: 200px; 122 | text-margin:30px; 123 | text-comp-op:grain-extract; 124 | } 125 | } 126 | 127 | #communities_points { 128 | ::labels [zoom<15]{ 129 | //marker-width:20px; 130 | text-name: "[largest_community_name]"; 131 | text-transform: uppercase; 132 | text-face-name: @normal; 133 | text-wrap-width: 100; 134 | text-wrap-before: true; 135 | text-fill: #222; 136 | text-halo-fill:#777; 137 | text-halo-radius:1.8px; 138 | text-halo-rasterizer:fast; 139 | text-size: 24; 140 | text-avoid-edges: true; 141 | text-repeat-distance: 200px; 142 | text-margin:30px; 143 | text-comp-op:grain-extract; 144 | } 145 | } 146 | 147 | 148 | // Use for segregation 149 | /*#communities_tracts { 150 | line-width: 0; 151 | line-opacity: 1; 152 | polygon-smooth:0.1; 153 | polygon-opacity:0.9; 154 | polygon-fill: #e66101; 155 | [largest_group_proportion<0.1]{ polygon-opacity: 0 } 156 | [largest_group_proportion>=0.1][largest_group_proportion<0.2]{ polygon-opacity: 0.1 } 157 | [largest_group_proportion>=0.2][largest_group_proportion<0.3]{ polygon-opacity: 0.2 } 158 | [largest_group_proportion>=0.3][largest_group_proportion<0.4]{ polygon-opacity: 0.3 } 159 | [largest_group_proportion>=0.4][largest_group_proportion<0.5]{ polygon-opacity: 0.4 } 160 | [largest_group_proportion>=0.5][largest_group_proportion<0.6]{ polygon-opacity: 0.5 } 161 | [largest_group_proportion>=0.6][largest_group_proportion<0.7]{ polygon-opacity: 0.7 } 162 | [largest_group_proportion>=0.7][largest_group_proportion<0.8]{ polygon-opacity: 0.8 } 163 | [largest_group_proportion>=0.8][largest_group_proportion<0.9]{ polygon-opacity: 0.9 } 164 | [largest_group_proportion>=1]{ polygon-opacity: 1 } 165 | }*/ 166 | // Use for population density 167 | /*#communities_tracts { 168 | line-width: 0; 169 | line-opacity: 1; 170 | polygon-smooth:0.1; 171 | polygon-opacity:0.9; 172 | polygon-fill: #5e3c99; 173 | [population_density<50]{ polygon-opacity: 0 } 174 | [population_density>=50][population_density<100]{ polygon-opacity: 0.1 } 175 | [population_density>=100][population_density<250]{ polygon-opacity: 0.2 } 176 | [population_density>=250][population_density<500]{ polygon-opacity: 0.3 } 177 | [population_density>=500][population_density<1000]{ polygon-opacity: 0.4 } 178 | [population_density>=1000][population_density<2000]{ polygon-opacity: 0.5 } 179 | [population_density>=2000][population_density<3000]{ polygon-opacity: 0.7 } 180 | [population_density>=3000][population_density<5000]{ polygon-opacity: 0.8 } 181 | [population_density>=5000][population_density<7500]{ polygon-opacity: 0.9 } 182 | [population_density>=7500]{ polygon-opacity: 1 } 183 | } 184 | */ 185 | // use for redlines overlay 186 | /*#communities_polys { 187 | line-color: #333; 188 | line-width: 3; 189 | line-offset:2; 190 | line-opacity: 1; 191 | polygon-opacity: 0; 192 | } 193 | */ 194 | // mask for all configurations 195 | #communities_mask { 196 | polygon-opacity: 0; 197 | polygon-comp-op: src; 198 | line-width:8px; 199 | line-color:#F1EDE1; 200 | line-opacity: 0.2; 201 | line-smooth: 0.5; 202 | } -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/exports/bubbles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/exports/bubbles.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/exports/legend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/exports/legend.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/exports/los_angeles_communities_2014.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/exports/los_angeles_communities_2014.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/exports/tribes_06_037.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/exports/tribes_06_037.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/fonts/Linotte-SemiBold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/fonts/Linotte-SemiBold.otf -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/fonts/MAW.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/fonts/MAW.ttf -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/bubbles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/bubbles.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/dot_fill.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/dot_fill.jpg -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/dot_fill_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/dot_fill_2.jpg -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/hatch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/hatch.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/legend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/legend.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/line_dotted_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/line_dotted_10.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/line_dotted_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/line_dotted_12.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/line_dotted_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/line_dotted_4.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/line_dotted_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/line_dotted_6.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/line_dotted_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/line_dotted_8.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/line_double_14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/line_double_14.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/line_double_14_mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/line_double_14_mask.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/line_double_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/line_double_16.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/line_double_16_mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/line_double_16_mask.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/line_double_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/line_double_18.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/line_double_18_mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/line_double_18_mask.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/line_double_20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/line_double_20.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/line_double_20_mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/line_double_20_mask.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/line_shade_22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/line_shade_22.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/line_shade_22_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/line_shade_22_1.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/line_shade_22_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/line_shade_22_2.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/line_shade_22_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/line_shade_22_4.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/line_solid_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/line_solid_6.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/line_solid_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/line_solid_7.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/line_water_14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/line_water_14.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/linedpaper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/linedpaper.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/linedpaper_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/linedpaper_256.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/natural_paper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/natural_paper.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/shade_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/shade_dark.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/shade_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/shade_light.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/shade_medium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/shade_medium.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/shade_medium_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/shade_medium_2.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/shade_medium_seamless.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/shade_medium_seamless.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/texture.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/texture_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/texture_2.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/texture_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/texture_3.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/img/water.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/img/water.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/labels.mss: -------------------------------------------------------------------------------- 1 | @normal: 'MAW Medium'; 2 | 3 | #place_label [scalerank<3],[name_en='downtown'] { 4 | text-name: "[name_en]"; 5 | text-transform: uppercase; 6 | text-face-name: @normal; 7 | text-wrap-width: 20; 8 | text-wrap-before: true; 9 | text-avoid-edges: true; 10 | text-min-padding:50px; 11 | text-fill: #333; 12 | text-size: 14; 13 | //text-comp-op: grain-merge; 14 | } 15 | 16 | #poi_label[scalerank<2] { 17 | text-name: "[name]"; 18 | text-transform: uppercase; 19 | text-face-name: @normal; 20 | text-wrap-width: 20; 21 | text-wrap-before: true; 22 | //text-avoid-edges: true; 23 | text-margin: 10px; 24 | text-fill: #333; 25 | text-size: 16; 26 | //text-comp-op: grain-merge; 27 | } 28 | 29 | 30 | #road_label [class='main'] { 31 | text-name: "[name]"; 32 | text-transform: uppercase; 33 | text-face-name: @normal; 34 | text-placement: line; 35 | text-fill: #555; 36 | text-size: 10; 37 | //text-allow-overlap: true; 38 | text-avoid-edges: true; 39 | text-margin:50px; 40 | text-repeat-distance:500px; 41 | text-min-padding:50px; 42 | //text-comp-op:grain-merge; 43 | } -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/legend/MAW.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/legend/MAW.ttf -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/legend/community_legend.csv: -------------------------------------------------------------------------------- 1 | largest_community_name,code,avg_plurality,membership,map_color 2 | African American,P0030003,0.253448434101636,405575,#5A89A1 3 | English,B04006_036E,0.182521766917769,68219,#725d3f 4 | German,B04006_042E,0.186100924631211,63481,#D99E39 5 | Indian,PCT0050002,0.190228453542137,21976,#352B6C 6 | Irish,B04006_049E,0.151139190535567,56091,#405A56 7 | Mexican,PCT0110004,0.35717151478255,44125,#B87824 8 | -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/legend/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Bar Chart 6 | 7 | 23 | 24 | 25 |
26 | 27 | 120 | 121 | -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/legend/legend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/legend/legend.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/legend/rasterize.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var page = require('webpage').create(), 3 | system = require('system'), 4 | address, output, size; 5 | 6 | if (system.args.length < 3 || system.args.length > 5) { 7 | console.log('Usage: rasterize.js URL filename [paperwidth*paperheight|paperformat] [zoom]'); 8 | console.log(' paper (pdf output) examples: "5in*7.5in", "10cm*20cm", "A4", "Letter"'); 9 | console.log(' image (png/jpg output) examples: "1920px" entire page, window width 1920px'); 10 | console.log(' "800px*600px" window, clipped to 800x600'); 11 | phantom.exit(1); 12 | } else { 13 | address = system.args[1]; 14 | output = system.args[2]; 15 | page.viewportSize = { width: 600, height: 600 }; 16 | if (system.args.length > 3 && system.args[2].substr(-4) === ".pdf") { 17 | size = system.args[3].split('*'); 18 | page.paperSize = size.length === 2 ? { width: size[0], height: size[1], margin: '0px' } 19 | : { format: system.args[3], orientation: 'portrait', margin: '1cm' }; 20 | } else if (system.args.length > 3 && system.args[3].substr(-2) === "px") { 21 | size = system.args[3].split('*'); 22 | if (size.length === 2) { 23 | pageWidth = parseInt(size[0], 10); 24 | pageHeight = parseInt(size[1], 10); 25 | page.viewportSize = { width: pageWidth, height: pageHeight }; 26 | page.clipRect = { top: 0, left: 0, width: pageWidth, height: pageHeight }; 27 | } else { 28 | console.log("size:", system.args[3]); 29 | pageWidth = parseInt(system.args[3], 10); 30 | pageHeight = parseInt(pageWidth * 3/4, 10); // it's as good an assumption as any 31 | console.log ("pageHeight:",pageHeight); 32 | page.viewportSize = { width: pageWidth, height: pageHeight }; 33 | } 34 | } 35 | if (system.args.length > 4) { 36 | page.zoomFactor = system.args[4]; 37 | } 38 | page.open(address, function (status) { 39 | if (status !== 'success') { 40 | console.log('Unable to load the address!'); 41 | phantom.exit(1); 42 | } else { 43 | window.setTimeout(function () { 44 | page.render(output); 45 | phantom.exit(); 46 | }, 200); 47 | } 48 | }); 49 | } -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/legend/texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/legend/texture.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/pop_legend/MAW.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/pop_legend/MAW.ttf -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/pop_legend/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Continuous legend 6 | 7 | 23 | 24 | 25 |
26 | 27 | 59 | 60 | -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/pop_legend/rasterize.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var page = require('webpage').create(), 3 | system = require('system'), 4 | address, output, size; 5 | 6 | if (system.args.length < 3 || system.args.length > 5) { 7 | console.log('Usage: rasterize.js URL filename [paperwidth*paperheight|paperformat] [zoom]'); 8 | console.log(' paper (pdf output) examples: "5in*7.5in", "10cm*20cm", "A4", "Letter"'); 9 | console.log(' image (png/jpg output) examples: "1920px" entire page, window width 1920px'); 10 | console.log(' "800px*600px" window, clipped to 800x600'); 11 | phantom.exit(1); 12 | } else { 13 | address = system.args[1]; 14 | output = system.args[2]; 15 | page.viewportSize = { width: 600, height: 600 }; 16 | if (system.args.length > 3 && system.args[2].substr(-4) === ".pdf") { 17 | size = system.args[3].split('*'); 18 | page.paperSize = size.length === 2 ? { width: size[0], height: size[1], margin: '0px' } 19 | : { format: system.args[3], orientation: 'portrait', margin: '1cm' }; 20 | } else if (system.args.length > 3 && system.args[3].substr(-2) === "px") { 21 | size = system.args[3].split('*'); 22 | if (size.length === 2) { 23 | pageWidth = parseInt(size[0], 10); 24 | pageHeight = parseInt(size[1], 10); 25 | page.viewportSize = { width: pageWidth, height: pageHeight }; 26 | page.clipRect = { top: 0, left: 0, width: pageWidth, height: pageHeight }; 27 | } else { 28 | console.log("size:", system.args[3]); 29 | pageWidth = parseInt(system.args[3], 10); 30 | pageHeight = parseInt(pageWidth * 3/4, 10); // it's as good an assumption as any 31 | console.log ("pageHeight:",pageHeight); 32 | page.viewportSize = { width: pageWidth, height: pageHeight }; 33 | } 34 | } 35 | if (system.args.length > 4) { 36 | page.zoomFactor = system.args[4]; 37 | } 38 | page.open(address, function (status) { 39 | if (status !== 'success') { 40 | console.log('Unable to load the address!'); 41 | phantom.exit(1); 42 | } else { 43 | window.setTimeout(function () { 44 | page.render(output); 45 | phantom.exit(); 46 | }, 200); 47 | } 48 | }); 49 | } -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/pop_legend/texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/cartography/rl_ga_fulton_county.tm2/pop_legend/texture.png -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/project.yml: -------------------------------------------------------------------------------- 1 | _prefs: 2 | saveCenter: false 3 | _properties: {} 4 | attribution: "Terms & Feedback" 5 | bounds: 6 | - -180 7 | - -85.0511 8 | - 180 9 | - 85.0511 10 | center: 11 | - -84.4732648217507 12 | - 33.782087035568 13 | - 11 14 | description: A recreation of a 1950 community map of Chicago using census data 15 | format: "png8:m=h" 16 | interactivity_layer: '' 17 | layers: 18 | - landuse 19 | - waterway 20 | - water 21 | - aeroway 22 | - barrier_line 23 | - building 24 | - landuse_overlay 25 | - tunnel 26 | - road 27 | - bridge 28 | - admin 29 | - communities_tracts 30 | - communities_polys 31 | - communities_tracts 32 | - communities_points 33 | - country_label_line 34 | - country_label 35 | - marine_label 36 | - state_label 37 | - place_label 38 | - water_label 39 | - poi_label 40 | - road_label 41 | - waterway_label 42 | - housenum_label 43 | - communities_mask 44 | maxzoom: 21 45 | minzoom: 0 46 | name: Redlines 47 | source: "mapbox:///mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5,mapbox.mapbox-bathymetry-v1,landplanner.rl_ga_fulton_county,landplanner.rl_points_ga_fulton_county,landplanner.rl_mask_ga_fulton_county,landplanner.rl_tracts_ga_fulton_county" 48 | styles: 49 | - style.mss 50 | - road.mss 51 | - communities.mss 52 | - labels.mss 53 | template: '' 54 | -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/project.ymltmp2.bak: -------------------------------------------------------------------------------- 1 | _prefs: 2 | saveCenter: false 3 | _properties: {} 4 | attribution: "Terms & Feedback" 5 | bounds: 6 | - -180 7 | - -85.0511 8 | - 180 9 | - 85.0511 10 | center: 11 | - -118.2437 12 | - 34.0522 13 | - 11 14 | description: A recreation of a 1950 community map of Chicago using census data 15 | format: "png8:m=h" 16 | interactivity_layer: '' 17 | layers: 18 | - landuse 19 | - waterway 20 | - water 21 | - aeroway 22 | - barrier_line 23 | - building 24 | - landuse_overlay 25 | - tunnel 26 | - road 27 | - bridge 28 | - admin 29 | - communities_tracts 30 | - communities_polys 31 | - communities_tracts 32 | - communities_points 33 | - country_label_line 34 | - country_label 35 | - marine_label 36 | - state_label 37 | - place_label 38 | - water_label 39 | - poi_label 40 | - road_label 41 | - waterway_label 42 | - housenum_label 43 | - communities_mask 44 | maxzoom: 21 45 | minzoom: 0 46 | name: Redlines 47 | source: "mapbox:///mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5,mapbox.mapbox-bathymetry-v1,landplanner.0xsgug3g,landplanner.69rz84n1,landplanner.0ufuyubk,landplanner.placeholder" 48 | styles: 49 | - style.mss 50 | - road.mss 51 | - communities.mss 52 | - labels.mss 53 | template: '' 54 | -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/project.ymltmp3.bak: -------------------------------------------------------------------------------- 1 | _prefs: 2 | saveCenter: false 3 | _properties: {} 4 | attribution: "Terms & Feedback" 5 | bounds: 6 | - -180 7 | - -85.0511 8 | - 180 9 | - 85.0511 10 | center: 11 | - -118.2437 12 | - 34.0522 13 | - 11 14 | description: A recreation of a 1950 community map of Chicago using census data 15 | format: "png8:m=h" 16 | interactivity_layer: '' 17 | layers: 18 | - landuse 19 | - waterway 20 | - water 21 | - aeroway 22 | - barrier_line 23 | - building 24 | - landuse_overlay 25 | - tunnel 26 | - road 27 | - bridge 28 | - admin 29 | - communities_tracts 30 | - communities_polys 31 | - communities_tracts 32 | - communities_points 33 | - country_label_line 34 | - country_label 35 | - marine_label 36 | - state_label 37 | - place_label 38 | - water_label 39 | - poi_label 40 | - road_label 41 | - waterway_label 42 | - housenum_label 43 | - communities_mask 44 | maxzoom: 21 45 | minzoom: 0 46 | name: Redlines 47 | source: "mapbox:///mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5,mapbox.mapbox-bathymetry-v1,landplanner.rl_ga_fulton_county,landplanner.rl_points_ga_fulton_county,landplanner.rl_mask_ga_fulton_county,landplanner.placeholder" 48 | styles: 49 | - style.mss 50 | - road.mss 51 | - communities.mss 52 | - labels.mss 53 | template: '' 54 | -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/project.ymltmp4.bak: -------------------------------------------------------------------------------- 1 | _prefs: 2 | saveCenter: false 3 | _properties: {} 4 | attribution: "Terms & Feedback" 5 | bounds: 6 | - -180 7 | - -85.0511 8 | - 180 9 | - 85.0511 10 | center: 11 | - -118.2437 12 | - 34.0522 13 | - 11 14 | description: A recreation of a 1950 community map of Chicago using census data 15 | format: "png8:m=h" 16 | interactivity_layer: '' 17 | layers: 18 | - landuse 19 | - waterway 20 | - water 21 | - aeroway 22 | - barrier_line 23 | - building 24 | - landuse_overlay 25 | - tunnel 26 | - road 27 | - bridge 28 | - admin 29 | - communities_tracts 30 | - communities_polys 31 | - communities_tracts 32 | - communities_points 33 | - country_label_line 34 | - country_label 35 | - marine_label 36 | - state_label 37 | - place_label 38 | - water_label 39 | - poi_label 40 | - road_label 41 | - waterway_label 42 | - housenum_label 43 | - communities_mask 44 | maxzoom: 21 45 | minzoom: 0 46 | name: Redlines 47 | source: "mapbox:///mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5,mapbox.mapbox-bathymetry-v1,landplanner.rl_ga_fulton_county,landplanner.rl_points_ga_fulton_county,landplanner.rl_mask_ga_fulton_county,landplanner.rl_tracts_ga_fulton_county" 48 | styles: 49 | - style.mss 50 | - road.mss 51 | - communities.mss 52 | - labels.mss 53 | template: '' 54 | -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/project.ymltmp5.bak: -------------------------------------------------------------------------------- 1 | _prefs: 2 | saveCenter: false 3 | _properties: {} 4 | attribution: "Terms & Feedback" 5 | bounds: 6 | - -180 7 | - -85.0511 8 | - 180 9 | - 85.0511 10 | center: 11 | - -84.4732648217507 12 | - 34.0522 13 | - 11 14 | description: A recreation of a 1950 community map of Chicago using census data 15 | format: "png8:m=h" 16 | interactivity_layer: '' 17 | layers: 18 | - landuse 19 | - waterway 20 | - water 21 | - aeroway 22 | - barrier_line 23 | - building 24 | - landuse_overlay 25 | - tunnel 26 | - road 27 | - bridge 28 | - admin 29 | - communities_tracts 30 | - communities_polys 31 | - communities_tracts 32 | - communities_points 33 | - country_label_line 34 | - country_label 35 | - marine_label 36 | - state_label 37 | - place_label 38 | - water_label 39 | - poi_label 40 | - road_label 41 | - waterway_label 42 | - housenum_label 43 | - communities_mask 44 | maxzoom: 21 45 | minzoom: 0 46 | name: Redlines 47 | source: "mapbox:///mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5,mapbox.mapbox-bathymetry-v1,landplanner.rl_ga_fulton_county,landplanner.rl_points_ga_fulton_county,landplanner.rl_mask_ga_fulton_county,landplanner.rl_tracts_ga_fulton_county" 48 | styles: 49 | - style.mss 50 | - road.mss 51 | - communities.mss 52 | - labels.mss 53 | template: '' 54 | -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/road.mss: -------------------------------------------------------------------------------- 1 | #road['mapnik::geometry_type'=2]::line, 2 | #bridge['mapnik::geometry_type'=2]::line, 3 | #tunnel['mapnik::geometry_type'=2]::line { 4 | [class='motorway'] { 5 | [zoom>=7][zoom<=12] { 6 | a/line-width:0.6; 7 | a/line-opacity:0.2; 8 | a/line-dasharray:2,1; 9 | b/line-width:0.8; 10 | b/line-opacity:0.2; 11 | b/line-dasharray:12,1; 12 | [zoom>=9] { 13 | a/line-opacity:0.1; 14 | b/line-opacity:0.1; 15 | } 16 | [zoom>=8] { 17 | a/line-width:1; 18 | b/line-width:1.2; 19 | } 20 | [zoom>=10] { 21 | a/line-width:1.6; 22 | b/line-width:2.0; 23 | } 24 | } 25 | [zoom=12] { line-pattern-file:url(img/line_solid_7.png); } 26 | } 27 | [class='motorway_link'], 28 | [class='main'] { 29 | [zoom>=7][zoom<=12] { 30 | a/line-color: #222; 31 | a/line-opacity: 0.25; 32 | a/line-width: 0.8; 33 | [zoom=8] { a/line-width: 0.9; } 34 | [zoom=9] { a/line-width: 1; } 35 | [zoom=10] { a/line-width: 1.1; } 36 | [zoom=11] { a/line-width: 1.2; } 37 | } 38 | [zoom=12] { line-pattern-file:url(img/line_solid_6.png); } 39 | [zoom=13] { line-pattern-file:url(img/line_solid_7.png); } 40 | } 41 | [class='major_rail'][zoom>=14], 42 | [class='minor_rail'][zoom>=16] { 43 | ['mapnik::geometry_type'=2] { 44 | a/line-width:1; 45 | a/line-opacity:0.05; 46 | a/line-dasharray:2,1; 47 | b/line-width:1.5; 48 | b/line-opacity:0.05; 49 | b/line-dasharray:12,1; 50 | c/line-width:2; 51 | c/line-opacity:0.05; 52 | c/line-dasharray:20,3; 53 | } 54 | } 55 | } 56 | 57 | #road::case, 58 | #bridge::case, 59 | #tunnel::case { 60 | ['mapnik::geometry_type'=2][zoom>=12][zoom<=20] { 61 | [class='motorway'] { 62 | [zoom=12] { line-pattern-file:url(img/line_double_14.png); } 63 | [zoom=13] { line-pattern-file:url(img/line_double_16.png); } 64 | [zoom=14] { line-pattern-file:url(img/line_double_18.png); } 65 | [zoom>15] { line-pattern-file:url(img/line_double_20.png); } 66 | } 67 | } 68 | } 69 | 70 | #road::dot['mapnik::geometry_type'=1][class='turning_circle'][zoom>=15] { 71 | marker-width: 6; 72 | [zoom>=16] { marker-width: 9; } 73 | [zoom>=17] { marker-width: 12; } 74 | marker-fill: #e6e6e6; 75 | marker-line-color: #707070; 76 | marker-line-width: 1.5; 77 | } 78 | 79 | #road::fill, 80 | #bridge::fill { 81 | ['mapnik::geometry_type'=2][zoom>=12][zoom<=20] { 82 | [class='motorway'] { 83 | [zoom>=12] { line-pattern-file:url(img/line_double_14_mask.png); } 84 | [zoom=14] { line-pattern-file:url(img/line_double_16_mask.png); } 85 | [zoom=15] { line-pattern-file:url(img/line_double_18_mask.png); } 86 | [zoom>15] { line-pattern-file:url(img/line_double_20_mask.png); } 87 | } 88 | [class='motorway_link'], 89 | [class='main'] { 90 | [zoom=14] { line-pattern-file:url(img/line_double_14_mask.png); } 91 | [zoom=15] { line-pattern-file:url(img/line_double_16_mask.png); } 92 | [zoom>15] { line-pattern-file:url(img/line_double_20_mask.png); } 93 | } 94 | [class='street'], 95 | [class='street_limited'] { 96 | [zoom>=15] { line-pattern-file:url(img/line_double_14_mask.png); } 97 | [zoom>=16] { line-pattern-file:url(img/line_double_16_mask.png); } 98 | } 99 | } 100 | } 101 | 102 | #tunnel::case { opacity:0.25; } -------------------------------------------------------------------------------- /cartography/rl_ga_fulton_county.tm2/style.mss: -------------------------------------------------------------------------------- 1 | Map { 2 | //background-image:url(img/texture_3.png); 3 | font-directory: url('fonts'); 4 | buffer-size: 1024px; 5 | } 6 | 7 | #water { 8 | ::light14[zoom<=14], 9 | ::light15[zoom=15], 10 | ::light16[zoom=16], 11 | ::light17[zoom>=17] { 12 | polygon-fill: #ddd9ce; 13 | polygon-gamma: 0.3; 14 | polygon-opacity:0.6; 15 | image-filters: agg-stack-blur(8,8); 16 | image-filters-inflate: true; 17 | } 18 | ::light15[zoom=15] { image-filters: agg-stack-blur(16,16); } 19 | ::light16[zoom=16] { image-filters: agg-stack-blur(32,32); } 20 | ::light17[zoom<=17] { image-filters: agg-stack-blur(64,64); } 21 | // Pencil shading texture: 22 | ::texture { 23 | polygon-pattern-opacity:0.5; 24 | comp-op: multiply; 25 | polygon-pattern-alignment: global; 26 | polygon-pattern-file:url(img/hatch.png); 27 | } 28 | } 29 | 30 | #waterway [class!='river'] { 31 | line-color: #7E93AE; 32 | line-width:1px; 33 | line-smooth:1.8; 34 | line-opacity:0.2; 35 | line-cap:round; 36 | [class='canal'] { line-width:1.5px; } 37 | [class='river'] { line-width:3px; } 38 | } 39 | 40 | #aeroway['mapnik::geometry_type'=2][zoom>=12] { 41 | comp-op: multiply; 42 | opacity:0.5; 43 | [type='taxiway'] { 44 | [zoom=12] { line-pattern-file:url(img/line_solid_6.png); } 45 | [zoom=13] { line-pattern-file:url(img/line_solid_7.png); } 46 | [zoom=15] { line-pattern-file:url(img/line_shade_22_1.png); } 47 | [zoom=16] { line-pattern-file:url(img/line_shade_22_2.png); } 48 | [zoom>16] { line-pattern-file:url(img/line_shade_22_4.png); } 49 | } 50 | [type='runway'] { 51 | line-pattern-file:url(img/line_shade_22.png); 52 | [zoom>=15] { line-pattern-file:url(img/line_shade_22_2.png); } 53 | [zoom>=16] { line-pattern-file:url(img/line_shade_22_4.png); } 54 | } 55 | } -------------------------------------------------------------------------------- /data/census_community_fields.csv: -------------------------------------------------------------------------------- 1 | id,code,name,collection,map_color,group 2 | 1,P0010001,Total,sf1,#ffffff, 3 | 2,P0030002,White,sf1,#333333,European 4 | 3,P0030003,African American,sf1,#5A89A1,African 5 | 4,P0030004,American Indian,sf1,#8b9cb3,American Indian 6 | 5,P0030005,Asian,sf1,#9297a7,Asian 7 | 6,P0030006,Hawaiian/Pacific Islander,sf1,#999099,Hawaiian/Pacific Islander 8 | 7,P0030007,Other race,sf1,#9e8b8c,Other race 9 | 8,P0030008,More than one race,sf1,#a3857f,Other race 10 | 9,P0040003,Hispanic/Latino,sf1,#a67f72,Hispanic/Latino 11 | 10,PCT0050002,Indian,sf1,#352B6C,Asian 12 | 11,PCT0050003,Bangladeshi,sf1,#a97965,Asian 13 | 12,PCT0050004,Bhutanese,sf1,#ab745a,Asian 14 | 13,PCT0050005,Burmese,sf1,#ad6d4d,Asian 15 | 14,PCT0050006,Cambodian,sf1,#ae6741,Asian 16 | 15,PCT0050007,Chinese,sf1,#574752,Asian 17 | 16,PCT0050008,Filipino,sf1,#B9A450,Asian 18 | 17,PCT0050009,Hmong,sf1,#ad6237,Asian 19 | 18,PCT0050010,Indonesian,sf1,#a4613f,Asian 20 | 19,PCT0050011,Japanese,sf1,#9a6047,Asian 21 | 20,PCT0050012,Korean,sf1,#E0C087,Asian 22 | 21,PCT0050013,Laotian,sf1,#8f5e4f,Asian 23 | 22,PCT0050014,Malaysian,sf1,#865d55,Asian 24 | 23,PCT0050015,Nepalese,sf1,#7b5c5d,Asian 25 | 24,PCT0050016,Pakistani,sf1,#6e5b64,Asian 26 | 25,PCT0050017,Sri Lankan,sf1,#5f5a6c,Asian 27 | 26,PCT0050018,Taiwanese,sf1,#525871,Asian 28 | 27,PCT0050019,Thai,sf1,#3e5779,Asian 29 | 28,PCT0050020,Vietnamese,sf1,#365F74,Asian 30 | 29,PCT0110004,Mexican,sf1,#B87824,Hispanic/Latino 31 | 30,PCT0110005,Puerto Rican,sf1,#363A3D,Hispanic/Latino 32 | 31,PCT0110006,Cuban,sf1,#567b99,Hispanic/Latino 33 | 32,PCT0110007,Dominican,sf1,#536f91,Hispanic/Latino 34 | 33,PCT0110009,Costa Rican,sf1,#51648a,Hispanic/Latino 35 | 34,PCT0110010,Guatemalan,sf1,#505c83,Hispanic/Latino 36 | 35,PCT0110011,Honduran,sf1,#50567d,Hispanic/Latino 37 | 36,PCT0110012,Nicaraguan,sf1,#515277,Hispanic/Latino 38 | 37,PCT0110013,Panamanian,sf1,#534f72,Hispanic/Latino 39 | 38,PCT0110014,Salvadoran,sf1,#564e6d,Hispanic/Latino 40 | 39,PCT0110017,Argentinean,sf1,#5a4e69,Hispanic/Latino 41 | 40,PCT0110018,Bolivian,sf1,#5f5065,Hispanic/Latino 42 | 41,PCT0110019,Chilean,sf1,#645461,Hispanic/Latino 43 | 42,PCT0110020,Colombian,sf1,#6b595e,Hispanic/Latino 44 | 43,PCT0110021,Ecuadorian,sf1,#735f5c,Hispanic/Latino 45 | 44,PCT0110022,Paraguayan,sf1,#7c675a,Hispanic/Latino 46 | 45,PCT0110023,Peruvian,sf1,#867058,Hispanic/Latino 47 | 46,PCT0110024,Uruguayan,sf1,#917b56,Hispanic/Latino 48 | 47,PCT0110025,Venezuelan,sf1,#9d8754,Hispanic/Latino 49 | 48,PCT0110029,Spanish,sf1,#aa9552,European 50 | 49,B04006_002E,Afghan,acs5,#b9a450,Middle Eastern 51 | 50,B04006_003E,Albanian,acs5,#e0c087,European 52 | 51,B04006_007E,Egyptian,acs5,#dbb478,Middle Eastern 53 | 52,B04006_008E,Iraqi,acs5,#d5a968,Middle Eastern 54 | 53,B04006_010E,Lebanese,acs5,#cf9d59,Middle Eastern 55 | 54,B04006_011E,Moroccan,acs5,#c8924a,Middle Eastern 56 | 55,B04006_012E,Palestinian,acs5,#c1873a,Middle Eastern 57 | 56,B04006_013E,Syrian,acs5,#ba7c2a,Middle Eastern 58 | 57,B04006_016E,Armenian,acs5,#aa7129,Middle Eastern 59 | 58,B04006_019E,Austrian,acs5,#96672f,European 60 | 59,B04006_022E,Brazilian,acs5,#825d33,Hispanic/Latino 61 | 60,B04006_025E,Cajun,acs5,#6e5337,European 62 | 61,B04006_029E,Croatian,acs5,#5a4a3a,European 63 | 62,B04006_031E,Czech,acs5,#45403c,European 64 | 63,B04006_033E,Danish,acs5,#3f3f3e,European 65 | 64,B04006_034E,Dutch,acs5,#584d3f,European 66 | 65,B04006_036E,English,acs5,#725d3f,European 67 | 66,B04006_039E,Finnish,acs5,#8b6c3f,European 68 | 67,B04006_040E,French,acs5,#a47d3e,European 69 | 68,B04006_041E,French Canadian,acs5,#be8d3c,European 70 | 69,B04006_042E,German,acs5,#D99E39,European 71 | 70,B04006_044E,Greek,acs5,#1F1C2D,European 72 | 71,B04006_045E,Guyanese,acs5,#d99e39,Hispanic/Latino 73 | 72,B04006_046E,Hungarian,acs5,#1f1c2d,European 74 | 73,B04006_048E,Iranian,acs5,#232332,Middle Eastern 75 | 74,B04006_049E,Irish,acs5,#405A56,European 76 | 75,B04006_050E,Israeli,acs5,#272a37,Middle Eastern 77 | 76,B04006_051E,Italian,acs5,#696935,European 78 | 77,B04006_053E,Lithuanian,acs5,#2b323c,European 79 | 78,B04006_059E,Norwegian,acs5,#303941,European 80 | 79,B04006_060E,Pennsylvania German,acs5,#334145,European 81 | 80,B04006_061E,Polish,acs5,#AB4C3C,European 82 | 81,B04006_062E,Portuguese,acs5,#37494b,European 83 | 82,B04006_063E,Romanian,acs5,#8B9CB3,European 84 | 83,B04006_064E,Russian,acs5,#AF6235,European 85 | 84,B04006_067E,Scottish,acs5,#3b5150,European 86 | 85,B04006_070E,Slovak,acs5,#3f5955,European 87 | 86,B04006_074E,Cape Verdean,acs5,#4f5e4c,African 88 | 87,B04006_075E,Ethiopian,acs5,#60653e,African 89 | 88,B04006_076E,Ghanaian,acs5,#ab4c3c,African 90 | 89,B04006_079E,Nigerian,acs5,#7d6a53,African 91 | 90,B04006_082E,Somali,acs5,#806c53,African 92 | 91,B04006_084E,Sudanese,acs5,#846f53,African 93 | 92,B04006_089E,Swedish,acs5,#877353,European 94 | 93,B04006_090E,Swiss,acs5,#8b7753,European 95 | 94,B04006_091E,Turkish,acs5,#8e7953,Middle Eastern 96 | 95,B04006_092E,Ukrainian,acs5,#3E5779,European 97 | 96,B04006_093E,Welsh,acs5,#927d53,European 98 | 97,B04006_101E,Haitian,acs5,#958153,African 99 | 98,B04006_102E,Jamaican,acs5,#695653,African -------------------------------------------------------------------------------- /nyc_tribes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/nyc_tribes.png -------------------------------------------------------------------------------- /original.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wboykinm/redlines/5c5718fd998748965a696f0d61138369b4e1cea8/original.png -------------------------------------------------------------------------------- /processing/dissolve/index.js: -------------------------------------------------------------------------------- 1 | var turfMerge = require('turf-merge'); 2 | var turfFC = require('turf-featurecollection'); 3 | var turfOverlaps = require('turf-overlaps'); 4 | var turfE = require('turf-extent'); 5 | var rbush = require('rbush'); 6 | 7 | module.exports = function(featureCollection, propertyName){ 8 | var fcLength = featureCollection.features.length; 9 | var rtree = new rbush(); 10 | 11 | var treeItems = []; 12 | 13 | for (var fcIndex = 0; fcIndex < fcLength; fcIndex++) { 14 | var polyBeingChecked2 = featureCollection.features[fcIndex]; 15 | var inputFeatureBbox = turfE(polyBeingChecked2); 16 | inputFeatureBbox.push({oldPolyID: fcIndex}); 17 | treeItems.push(inputFeatureBbox); 18 | rtree.insert(inputFeatureBbox); 19 | } 20 | 21 | for (var polyIndex = 0; polyIndex < fcLength; polyIndex++) { 22 | 23 | var polyBeingChecked = featureCollection.features[polyIndex]; 24 | 25 | if(!polyBeingChecked || !polyBeingChecked.properties.hasOwnProperty(propertyName)){ 26 | continue; 27 | } 28 | 29 | var polyBoundingBox = turfE(polyBeingChecked); 30 | 31 | var result = rtree.search([polyBoundingBox[0], polyBoundingBox[1], polyBoundingBox[2], polyBoundingBox[3]]); 32 | 33 | var featureChanged = false; 34 | var loopLength = result.length; 35 | 36 | for (var secondPolyIndex = 0; secondPolyIndex < loopLength; secondPolyIndex++) { 37 | 38 | var otherPolyID = result[secondPolyIndex][4].oldPolyID; 39 | 40 | if(polyIndex === otherPolyID){ 41 | continue; 42 | } 43 | 44 | polyBeingChecked = featureCollection.features[polyIndex]; 45 | var otherPolyBeingChecked = featureCollection.features[otherPolyID]; 46 | 47 | if(!otherPolyBeingChecked || !otherPolyBeingChecked.properties.hasOwnProperty(propertyName) || polyBeingChecked.properties[propertyName] !== otherPolyBeingChecked.properties[propertyName]){ 48 | continue; 49 | } 50 | 51 | var overlapCheck = turfOverlaps(polyBeingChecked, otherPolyBeingChecked); 52 | 53 | if(overlapCheck === false){ 54 | continue; 55 | } 56 | 57 | var mergedFeature = turfMerge(turfFC([polyBeingChecked, otherPolyBeingChecked]) ); 58 | polyBeingChecked = mergedFeature; 59 | featureChanged = true; 60 | 61 | otherPolyBeingChecked = null; 62 | 63 | rtree.remove(treeItems[otherPolyID]); 64 | treeItems[otherPolyID] = [0, 0, 0, 0, {oldPolyID: polyIndex, relevant: "no"}]; 65 | rtree.insert(treeItems[otherPolyID]); 66 | } 67 | 68 | if(featureChanged === true){ 69 | var mergedFeatureBbox = turfE(polyBeingChecked); 70 | rtree.remove(treeItems[polyIndex]); 71 | treeItems[polyIndex] = [mergedFeatureBbox[0], mergedFeatureBbox[1], mergedFeatureBbox[2], mergedFeatureBbox[3], {oldPolyID: polyIndex}]; 72 | rtree.insert(treeItems[polyIndex]); 73 | 74 | polyIndex--; 75 | } 76 | } 77 | 78 | function cleanArray(actual) { 79 | var newArray = new Array(); 80 | for (var i = 0; i < actual.length; i++) { 81 | if (actual[i]) { 82 | newArray.push(actual[i]); 83 | } 84 | } 85 | return newArray; 86 | } 87 | 88 | featureCollection.features = cleanArray(featureCollection.features); 89 | 90 | return featureCollection; 91 | 92 | }; -------------------------------------------------------------------------------- /processing/dissolve/package.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "name": "turf-dissolve", 4 | "version": "0.1.0", 5 | "description": "Dissolves polygons based on an attribute", 6 | "main": "index.js", 7 | "keywords": [ 8 | "turf", 9 | "dissolve", 10 | "gis" 11 | ], 12 | "author": "Rowan Winsemius", 13 | "license": "MIT", 14 | "dependencies": { 15 | "rbush": "^1.4.2", 16 | "turf-extent": "^1.0.4", 17 | "turf-featurecollection": "^1.0.1", 18 | "turf-merge": "^1.0.2", 19 | "turf-overlaps": "^1.0.3" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /processing/form/form.sql: -------------------------------------------------------------------------------- 1 | -- special centroid-in-polygon function: http://postgis.17.x6.nabble.com/Centroid-Within-tp3518773p3518776.html 2 | CREATE OR REPLACE FUNCTION point_inside_geometry(param_geom geometry) 3 | RETURNS geometry AS 4 | $$ 5 | DECLARE 6 | var_cent geometry := ST_Centroid(param_geom); 7 | var_result geometry := var_cent; 8 | BEGIN 9 | -- If the centroid is outside the geometry then 10 | -- calculate a box around centroid that is guaranteed to intersect the geometry 11 | -- take the intersection of that and find point on surface of intersection 12 | IF NOT ST_Intersects(param_geom, var_cent) THEN 13 | var_result := ST_PointOnSurface( 14 | ST_Intersection( 15 | param_geom, 16 | ST_Expand( 17 | var_cent, 18 | ST_Distance( 19 | var_cent, 20 | param_geom 21 | )*2 22 | ) 23 | ) 24 | ); 25 | END IF; 26 | RETURN var_result; 27 | END; 28 | $$ 29 | LANGUAGE plpgsql IMMUTABLE STRICT 30 | COST 100; 31 | 32 | -- Lay the groundwork 33 | ALTER TABLE community_tracts ALTER COLUMN largest_group_count TYPE int USING (largest_group_count::int); 34 | ALTER TABLE community_tracts ALTER COLUMN largest_group_proportion TYPE double precision USING (largest_group_proportion::float); 35 | ALTER TABLE community_tracts RENAME COLUMN wkb_geometry TO the_geom; 36 | -- clear tracts with < 30 people (this specifically targets central park) 37 | DELETE FROM community_tracts WHERE total_population < 30; 38 | -- expand then erode block borders 39 | DROP TABLE IF EXISTS community_polys; 40 | CREATE TABLE community_polys AS ( 41 | WITH erosions AS ( 42 | SELECT 43 | largest_community_name, 44 | ST_Transform( 45 | ST_Buffer( 46 | ST_Union( 47 | ST_Buffer( 48 | ST_Transform( 49 | the_geom, 50 | 3857 51 | ), 52 | 50 53 | ) 54 | ), 55 | -150 56 | ), 57 | 4326 58 | ) AS the_geom 59 | FROM community_tracts 60 | GROUP BY largest_community_name 61 | ), 62 | 63 | explosions AS ( 64 | SELECT 65 | largest_community_name, 66 | (ST_Dump(the_geom)).geom AS the_geom 67 | FROM erosions 68 | ) 69 | 70 | SELECT 71 | e.largest_community_name, 72 | ST_Simplify(e.the_geom,0.0005) AS the_geom, 73 | avg(c.largest_group_proportion) AS largest_group_proportion, 74 | sum(c.largest_group_count) AS largest_group_count, 75 | sum(c.total_population) AS total_population 76 | FROM explosions e 77 | LEFT JOIN community_tracts c 78 | ON ST_Intersects(e.the_geom,ST_Centroid(c.the_geom)) 79 | GROUP BY e.largest_community_name,e.the_geom 80 | ORDER BY ST_Area(e.the_geom) ASC 81 | ); 82 | 83 | -- Create cartographic labeling layer 84 | DROP TABLE IF EXISTS community_centroids; 85 | CREATE TABLE community_centroids AS ( 86 | SELECT 87 | largest_community_name, 88 | point_inside_geometry(the_geom) AS the_geom, 89 | largest_group_proportion, 90 | largest_group_count, 91 | total_population 92 | FROM 93 | community_polys 94 | ); 95 | 96 | -- create mask for static compositions 97 | DROP TABLE IF EXISTS community_mask; 98 | CREATE TABLE community_mask AS ( 99 | SELECT 100 | ST_Transform( 101 | ST_Difference( 102 | (ST_Expand( 103 | ST_Transform( 104 | ST_Collect(the_geom), 105 | 3857 106 | ), 107 | 300000 108 | )), 109 | (ST_Buffer( 110 | ST_Transform( 111 | ST_Collect(the_geom), 112 | 3857 113 | ), 114 | 3000 115 | )) 116 | ), 117 | 4326 118 | ) AS the_geom 119 | FROM 120 | community_polys 121 | ); 122 | 123 | -- import raw counts by tract 124 | DROP TABLE IF EXISTS community_properties; 125 | CREATE TABLE community_properties ( 126 | state text, 127 | county text, 128 | tract text, 129 | P0010001 int, 130 | P0030002 int, 131 | P0030003 int, 132 | P0030004 int, 133 | P0030005 int, 134 | P0030006 int, 135 | P0030007 int, 136 | P0030008 int, 137 | P0040003 int, 138 | PCT0050002 int, 139 | PCT0050003 int, 140 | PCT0050004 int, 141 | PCT0050005 int, 142 | PCT0050006 int, 143 | PCT0050007 int, 144 | PCT0050008 int, 145 | PCT0050009 int, 146 | PCT0050010 int, 147 | PCT0050011 int, 148 | PCT0050012 int, 149 | PCT0050013 int, 150 | PCT0050014 int, 151 | PCT0050015 int, 152 | PCT0050016 int, 153 | PCT0050017 int, 154 | PCT0050018 int, 155 | PCT0050019 int, 156 | PCT0050020 int, 157 | PCT0110004 int, 158 | PCT0110005 int, 159 | PCT0110006 int, 160 | PCT0110007 int, 161 | PCT0110009 int, 162 | PCT0110010 int, 163 | PCT0110011 int, 164 | PCT0110012 int, 165 | PCT0110013 int, 166 | PCT0110014 int, 167 | PCT0110017 int, 168 | PCT0110018 int, 169 | PCT0110019 int, 170 | PCT0110020 int, 171 | PCT0110021 int, 172 | PCT0110022 int, 173 | PCT0110023 int, 174 | PCT0110024 int, 175 | PCT0110025 int, 176 | PCT0110029 int, 177 | B04006_002E int, 178 | B04006_003E int, 179 | B04006_007E int, 180 | B04006_008E int, 181 | B04006_010E int, 182 | B04006_011E int, 183 | B04006_012E int, 184 | B04006_013E int, 185 | B04006_016E int, 186 | B04006_019E int, 187 | B04006_022E int, 188 | B04006_025E int, 189 | B04006_029E int, 190 | B04006_031E int, 191 | B04006_033E int, 192 | B04006_034E int, 193 | B04006_036E int, 194 | B04006_039E int, 195 | B04006_040E int, 196 | B04006_041E int, 197 | B04006_042E int, 198 | B04006_044E int, 199 | B04006_045E int, 200 | B04006_046E int, 201 | B04006_048E int, 202 | B04006_049E int, 203 | B04006_050E int, 204 | B04006_051E int, 205 | B04006_053E int, 206 | B04006_059E int, 207 | B04006_060E int, 208 | B04006_061E int, 209 | B04006_062E int, 210 | B04006_063E int, 211 | B04006_064E int, 212 | B04006_067E int, 213 | B04006_070E int, 214 | B04006_074E int, 215 | B04006_075E int, 216 | B04006_076E int, 217 | B04006_079E int, 218 | B04006_082E int, 219 | B04006_084E int, 220 | B04006_089E int, 221 | B04006_090E int, 222 | B04006_091E int, 223 | B04006_092E int, 224 | B04006_093E int, 225 | B04006_101E int, 226 | B04006_102E int, 227 | largest_group text, 228 | largest_group_count int, 229 | largest_group_proportion double precision, 230 | id text, 231 | code text, 232 | name text, 233 | collection text, 234 | map_color text, 235 | groupname text 236 | ); 237 | 238 | \COPY community_properties FROM 'community_properties.csv' DELIMITER ',' CSV HEADER; 239 | DELETE FROM community_properties WHERE P0010001 < 1; 240 | 241 | -- create legend 242 | DROP TABLE IF EXISTS community_legend; 243 | CREATE TABLE community_legend AS ( 244 | WITH grouptotals AS ( 245 | SELECT 246 | sum(P0010001) AS P0010001, 247 | sum(P0030002) AS P0030002, 248 | sum(P0030003) AS P0030003, 249 | sum(P0030004) AS P0030004, 250 | sum(P0030005) AS P0030005, 251 | sum(P0030006) AS P0030006, 252 | sum(P0030007) AS P0030007, 253 | sum(P0030008) AS P0030008, 254 | sum(P0040003) AS P0040003, 255 | sum(PCT0050002) AS PCT0050002, 256 | sum(PCT0050003) AS PCT0050003, 257 | sum(PCT0050004) AS PCT0050004, 258 | sum(PCT0050005) AS PCT0050005, 259 | sum(PCT0050006) AS PCT0050006, 260 | sum(PCT0050007) AS PCT0050007, 261 | sum(PCT0050008) AS PCT0050008, 262 | sum(PCT0050009) AS PCT0050009, 263 | sum(PCT0050010) AS PCT0050010, 264 | sum(PCT0050011) AS PCT0050011, 265 | sum(PCT0050012) AS PCT0050012, 266 | sum(PCT0050013) AS PCT0050013, 267 | sum(PCT0050014) AS PCT0050014, 268 | sum(PCT0050015) AS PCT0050015, 269 | sum(PCT0050016) AS PCT0050016, 270 | sum(PCT0050017) AS PCT0050017, 271 | sum(PCT0050018) AS PCT0050018, 272 | sum(PCT0050019) AS PCT0050019, 273 | sum(PCT0050020) AS PCT0050020, 274 | sum(PCT0110004) AS PCT0110004, 275 | sum(PCT0110005) AS PCT0110005, 276 | sum(PCT0110006) AS PCT0110006, 277 | sum(PCT0110007) AS PCT0110007, 278 | sum(PCT0110009) AS PCT0110009, 279 | sum(PCT0110010) AS PCT0110010, 280 | sum(PCT0110011) AS PCT0110011, 281 | sum(PCT0110012) AS PCT0110012, 282 | sum(PCT0110013) AS PCT0110013, 283 | sum(PCT0110014) AS PCT0110014, 284 | sum(PCT0110017) AS PCT0110017, 285 | sum(PCT0110018) AS PCT0110018, 286 | sum(PCT0110019) AS PCT0110019, 287 | sum(PCT0110020) AS PCT0110020, 288 | sum(PCT0110021) AS PCT0110021, 289 | sum(PCT0110022) AS PCT0110022, 290 | sum(PCT0110023) AS PCT0110023, 291 | sum(PCT0110024) AS PCT0110024, 292 | sum(PCT0110025) AS PCT0110025, 293 | sum(PCT0110029) AS PCT0110029, 294 | sum(B04006_002E) AS B04006_002E, 295 | sum(B04006_003E) AS B04006_003E, 296 | sum(B04006_007E) AS B04006_007E, 297 | sum(B04006_008E) AS B04006_008E, 298 | sum(B04006_010E) AS B04006_010E, 299 | sum(B04006_011E) AS B04006_011E, 300 | sum(B04006_012E) AS B04006_012E, 301 | sum(B04006_013E) AS B04006_013E, 302 | sum(B04006_016E) AS B04006_016E, 303 | sum(B04006_019E) AS B04006_019E, 304 | sum(B04006_022E) AS B04006_022E, 305 | sum(B04006_025E) AS B04006_025E, 306 | sum(B04006_029E) AS B04006_029E, 307 | sum(B04006_031E) AS B04006_031E, 308 | sum(B04006_033E) AS B04006_033E, 309 | sum(B04006_034E) AS B04006_034E, 310 | sum(B04006_036E) AS B04006_036E, 311 | sum(B04006_039E) AS B04006_039E, 312 | sum(B04006_040E) AS B04006_040E, 313 | sum(B04006_041E) AS B04006_041E, 314 | sum(B04006_042E) AS B04006_042E, 315 | sum(B04006_044E) AS B04006_044E, 316 | sum(B04006_045E) AS B04006_045E, 317 | sum(B04006_046E) AS B04006_046E, 318 | sum(B04006_048E) AS B04006_048E, 319 | sum(B04006_049E) AS B04006_049E, 320 | sum(B04006_050E) AS B04006_050E, 321 | sum(B04006_051E) AS B04006_051E, 322 | sum(B04006_053E) AS B04006_053E, 323 | sum(B04006_059E) AS B04006_059E, 324 | sum(B04006_060E) AS B04006_060E, 325 | sum(B04006_061E) AS B04006_061E, 326 | sum(B04006_062E) AS B04006_062E, 327 | sum(B04006_063E) AS B04006_063E, 328 | sum(B04006_064E) AS B04006_064E, 329 | sum(B04006_067E) AS B04006_067E, 330 | sum(B04006_070E) AS B04006_070E, 331 | sum(B04006_074E) AS B04006_074E, 332 | sum(B04006_075E) AS B04006_075E, 333 | sum(B04006_076E) AS B04006_076E, 334 | sum(B04006_079E) AS B04006_079E, 335 | sum(B04006_082E) AS B04006_082E, 336 | sum(B04006_084E) AS B04006_084E, 337 | sum(B04006_089E) AS B04006_089E, 338 | sum(B04006_090E) AS B04006_090E, 339 | sum(B04006_091E) AS B04006_091E, 340 | sum(B04006_092E) AS B04006_092E, 341 | sum(B04006_093E) AS B04006_093E, 342 | sum(B04006_101E) AS B04006_101E, 343 | sum(B04006_102E) AS B04006_102E 344 | FROM community_properties 345 | ), 346 | 347 | grouptotals_transposed AS ( 348 | SELECT 349 | unnest(array['P0010001', 'P0030002', 'P0030003', 'P0030004', 'P0030005', 'P0030006', 'P0030007', 'P0030008', 'P0040003', 'PCT0050002', 'PCT0050003', 'PCT0050004', 'PCT0050005', 'PCT0050006', 'PCT0050007', 'PCT0050008', 'PCT0050009', 'PCT0050010', 'PCT0050011', 'PCT0050012', 'PCT0050013', 'PCT0050014', 'PCT0050015', 'PCT0050016', 'PCT0050017', 'PCT0050018', 'PCT0050019', 'PCT0050020', 'PCT0110004', 'PCT0110005', 'PCT0110006', 'PCT0110007', 'PCT0110009', 'PCT0110010', 'PCT0110011', 'PCT0110012', 'PCT0110013', 'PCT0110014', 'PCT0110017', 'PCT0110018', 'PCT0110019', 'PCT0110020', 'PCT0110021', 'PCT0110022', 'PCT0110023', 'PCT0110024', 'PCT0110025', 'PCT0110029', 'B04006_002E', 'B04006_003E', 'B04006_007E', 'B04006_008E', 'B04006_010E', 'B04006_011E', 'B04006_012E', 'B04006_013E', 'B04006_016E', 'B04006_019E', 'B04006_022E', 'B04006_025E', 'B04006_029E', 'B04006_031E', 'B04006_033E', 'B04006_034E', 'B04006_036E', 'B04006_039E', 'B04006_040E', 'B04006_041E', 'B04006_042E', 'B04006_044E', 'B04006_045E', 'B04006_046E', 'B04006_048E', 'B04006_049E', 'B04006_050E', 'B04006_051E', 'B04006_053E', 'B04006_059E', 'B04006_060E', 'B04006_061E', 'B04006_062E', 'B04006_063E', 'B04006_064E', 'B04006_067E', 'B04006_070E', 'B04006_074E', 'B04006_075E', 'B04006_076E', 'B04006_079E', 'B04006_082E', 'B04006_084E', 'B04006_089E', 'B04006_090E', 'B04006_091E', 'B04006_092E', 'B04006_093E', 'B04006_101E', 'B04006_102E']) AS type, 350 | unnest(array[P0010001, P0030002, P0030003, P0030004, P0030005, P0030006, P0030007, P0030008, P0040003, PCT0050002, PCT0050003, PCT0050004, PCT0050005, PCT0050006, PCT0050007, PCT0050008, PCT0050009, PCT0050010, PCT0050011, PCT0050012, PCT0050013, PCT0050014, PCT0050015, PCT0050016, PCT0050017, PCT0050018, PCT0050019, PCT0050020, PCT0110004, PCT0110005, PCT0110006, PCT0110007, PCT0110009, PCT0110010, PCT0110011, PCT0110012, PCT0110013, PCT0110014, PCT0110017, PCT0110018, PCT0110019, PCT0110020, PCT0110021, PCT0110022, PCT0110023, PCT0110024, PCT0110025, PCT0110029, B04006_002E, B04006_003E, B04006_007E, B04006_008E, B04006_010E, B04006_011E, B04006_012E, B04006_013E, B04006_016E, B04006_019E, B04006_022E, B04006_025E, B04006_029E, B04006_031E, B04006_033E, B04006_034E, B04006_036E, B04006_039E, B04006_040E, B04006_041E, B04006_042E, B04006_044E, B04006_045E, B04006_046E, B04006_048E, B04006_049E, B04006_050E, B04006_051E, B04006_053E, B04006_059E, B04006_060E, B04006_061E, B04006_062E, B04006_063E, B04006_064E, B04006_067E, B04006_070E, B04006_074E, B04006_075E, B04006_076E, B04006_079E, B04006_082E, B04006_084E, B04006_089E, B04006_090E, B04006_091E, B04006_092E, B04006_093E, B04006_101E, B04006_102E]) AS totals 351 | FROM grouptotals 352 | ORDER BY totals 353 | ), 354 | 355 | polygroups AS ( 356 | SELECT 357 | largest_community_name, 358 | avg(largest_group_proportion) AS avg_plurality 359 | FROM community_polys 360 | GROUP BY largest_community_name 361 | ) 362 | 363 | SELECT 364 | p.largest_community_name, 365 | max(t.code) AS code, 366 | max(p.avg_plurality) AS avg_plurality, 367 | max(g.totals) AS membership, 368 | max(t.map_color) AS map_color 369 | FROM polygroups p 370 | LEFT JOIN community_tracts t ON t.largest_community_name = p.largest_community_name 371 | LEFT JOIN grouptotals_transposed g ON g.type = t.code 372 | WHERE g.totals > 0 373 | AND p.avg_plurality > 0 374 | GROUP BY p.largest_community_name 375 | ORDER BY p.largest_community_name ASC 376 | ); 377 | -------------------------------------------------------------------------------- /processing/form/index.js: -------------------------------------------------------------------------------- 1 | var turf = require('turf'); 2 | var fs = require('fs'); 3 | var dissolve = require ('../dissolve/index.js') 4 | 5 | var basicTracts = fs.readFileSync(process.argv[2]); 6 | basicTracts = JSON.parse(basicTracts); 7 | 8 | // FIXME THIS WHOLE STRING IS A MEMORY FAIL, EVEN EACH OPERATION ON ITS OWN 9 | console.log('buffering out') 10 | var expandedTracts = turf.buffer(basicTracts, 250, 'meters'); 11 | console.log('dissolving by largest community') 12 | var dissolvedTracts = dissolve(expandedTracts, 'largest_community_name'); 13 | console.log('eroding boundaries') 14 | var erodedTracts = turf.buffer(dissolvedTracts, -275, 'meters'); 15 | fs.writeFileSync('./erodedTracts.geojson', JSON.stringify(erodedTracts)); 16 | 17 | console.log('done'); -------------------------------------------------------------------------------- /processing/form/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "form", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "turf": "^2.0.2" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /processing/join/index.js: -------------------------------------------------------------------------------- 1 | console.log('starting') 2 | var fs = require('fs'); 3 | var joiner = require('joiner'); 4 | var csv = require('fast-csv'); 5 | var outFile = '../../data/tmp_' + process.argv[4] + '_' + process.argv[5] + '/community_tracts_' + process.argv[5] + '.geojson'; 6 | var geo_key = 'TRACTCE'; 7 | var tab_key = 'tract'; 8 | console.log(process.argv[3]) 9 | var geo_data = JSON.parse(fs.readFileSync(process.argv[2])); 10 | var tab_data = []; 11 | var joined_data; 12 | 13 | csv 14 | .fromPath(process.argv[3], { 15 | objectMode: true, 16 | headers: true 17 | }) 18 | .on("data", function(data){ 19 | tab_data.push(data); 20 | }) 21 | .on("end", function(){ 22 | joined_data = joiner.geoJson(geo_data, geo_key, tab_data, tab_key); 23 | console.log(joined_data.data.features); 24 | fs.writeFile(outFile, JSON.stringify(joined_data.data) , 'utf-8'); 25 | }); -------------------------------------------------------------------------------- /processing/join/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "join", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "fast-csv": "^1.0.0", 13 | "joiner": "^0.4.2" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /processing/parse/index.js: -------------------------------------------------------------------------------- 1 | // USAGE: node index.js 2 | var fs = require('fs'); 3 | var csv = require('fast-csv'); 4 | var through2 = require('through2'); 5 | 6 | var inFile = process.argv[2]; 7 | var outFile = inFile + '.tmp' 8 | var outStream = fs.createWriteStream(outFile); 9 | 10 | var getMax = function(row, callback) { 11 | // Get just the flattened category values: 12 | var rowLength = Object.keys(row).length; 13 | var rowNew = JSON.parse(JSON.stringify(row)); 14 | var extraneous = Object.keys(row).sort().slice(rowLength - 3); 15 | // remove aggregate categories ("white", "hispanic", etc.) from calculation: 16 | extraneous.push('P0010001','P0030002','P0030005','P0030007','P0030008','P0040003'); 17 | var remove = function(e, i, a) { 18 | delete row[e]; 19 | }; 20 | extraneous.forEach(remove); 21 | 22 | // Find the maximum of those 23 | var maxKey = Object.keys(row).reduce(function(key,max){ 24 | return (parseInt(row[key]) > parseInt(row[max])) ? key : max; 25 | }); 26 | 27 | // Append to the row: 28 | rowNew['largest_group'] = maxKey; 29 | rowNew['largest_group_count'] = rowNew[maxKey]; 30 | rowNew['largest_group_proportion'] = (rowNew[maxKey] / rowNew.P0010001) || 0; 31 | callback(null, rowNew); 32 | }; 33 | 34 | csv 35 | .fromPath(inFile, {objectMode: true, headers: true}) 36 | .pipe(through2.obj( 37 | function (row, enc, callback) { 38 | getMax(row, callback); 39 | }) 40 | ) 41 | .pipe(csv.createWriteStream({headers: true})) 42 | .pipe(outStream); 43 | -------------------------------------------------------------------------------- /processing/parse/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "parse", 3 | "version": "1.0.0", 4 | "description": "get data for redline", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "bill@faraday.io", 10 | "license": "MIT", 11 | "dependencies": { 12 | "fast-csv": "^1.0.0", 13 | "through2": "^2.0.1" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /processing/pull/index.js: -------------------------------------------------------------------------------- 1 | // USAGE: node index.js 2 | var fs = require('fs'); 3 | var csv = require('fast-csv'); 4 | var request = require('request'); 5 | 6 | var collectionType = process.argv[2]; 7 | var urlBase = 'https://api.census.gov/data/2010/'; 8 | var censusKey = process.argv[3]; 9 | var stateFips = parseInt(process.argv[4]); 10 | var countyFips = parseInt(process.argv[5]); 11 | var stateAbbrv = process.argv[6]; 12 | var countyName = process.argv[7]; 13 | var fields = []; 14 | 15 | var outFile = fs.createWriteStream('../../data/tmp_' + stateAbbrv + '_' + countyName + '/' + collectionType + '.csv'); 16 | 17 | // get fields from key csv 18 | csv 19 | .fromPath('../../data/census_community_fields.csv', {headers : true}) 20 | .validate(function(data){ 21 | return data.collection == collectionType; 22 | }) 23 | .on("data", function(data){ 24 | fields.push(data.code); 25 | }) 26 | .on("end", function(){ 27 | fields = JSON.stringify(fields) 28 | .replace('[','') 29 | .replace(']','') 30 | .replace(/"/g,''); 31 | var url = urlBase + collectionType + '?key=' + censusKey + '&get=' + fields + '&for=tract:*&in=state:' + stateFips + '+county:' + countyFips; 32 | 33 | // grab data by tract, pipe to csv in data/tmp/ 34 | request(url, function (error, response, body) { 35 | if (error) { 36 | console.error('encountered error', error instanceof Error ? error.stack : error); 37 | } else if (response.statusCode === 429) { 38 | console.log('error 429') 39 | } else if (response.statusCode !== 200) { 40 | console.error('non-200 status code: ' + response.statusCode); 41 | } else { 42 | body = JSON.parse(body); 43 | csv.write(body, {headers: true}) 44 | .pipe(outFile); 45 | } 46 | }) 47 | }) -------------------------------------------------------------------------------- /processing/pull/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pull", 3 | "version": "1.0.0", 4 | "description": "get data for redline", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "bill@faraday.io", 10 | "license": "MIT", 11 | "dependencies": { 12 | "async": "^1.5.2", 13 | "fast-csv": "^1.0.0", 14 | "request": "^2.67.0" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /processing/roads/index.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var overpass = require('query-overpass'); 3 | var bBox = process.argv[2]; 4 | var fipsState = process.argv[3]; 5 | var fipsCounty = process.argv[4]; 6 | var outFile = process.argv[5]; 7 | 8 | overpass('[out:json];way[highway="motorway"]' + bBox + ';way[highway="primary"]' + bBox + ';(._;>;);out;', function(err, data) { 9 | if (err) { 10 | console.log('Unknown Error'); 11 | console.log(err); 12 | return; 13 | } 14 | fs.writeFile(outFile, JSON.stringify(data) , 'utf-8'); 15 | }, { 16 | flatProperties: true 17 | }); -------------------------------------------------------------------------------- /processing/roads/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "roads", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "query-overpass": "^1.1.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /processing/roads/roads.sql: -------------------------------------------------------------------------------- 1 | DELETE FROM overpass_roads WHERE LEFT(id,3) != 'way'; 2 | ALTER TABLE overpass_roads RENAME COLUMN wkb_geometry TO the_geom; 3 | DROP TABLE IF EXISTS ring_roads; 4 | CREATE TABLE ring_roads AS ( 5 | SELECT 6 | name, 7 | highway AS type, 8 | ST_Difference( 9 | the_geom, 10 | ( 11 | ST_Collect( 12 | ( 13 | SELECT 14 | ST_Transform( 15 | ST_Buffer( 16 | ST_Transform( 17 | ST_Collect( 18 | the_geom 19 | ), 20 | 3857 21 | ), 22 | 100 23 | ), 24 | 4326 25 | ) 26 | FROM community_polys 27 | ), 28 | ( 29 | SELECT 30 | the_geom 31 | FROM community_mask 32 | ) 33 | ) 34 | ) 35 | ) as the_geom 36 | FROM overpass_roads 37 | ); -------------------------------------------------------------------------------- /processing/water/bathwater.js: -------------------------------------------------------------------------------- 1 | var turf = require('turf'); 2 | var fs = require('fs'); 3 | 4 | var mainPolys = JSON.parse(fs.readFileSync(process.argv[2])); 5 | var polysValidated = {"type":"FeatureCollection","features":[]}; 6 | 7 | for (var p = 0; p < mainPolys.features.length; p++) { 8 | if (turf.kinks(mainPolys.features[p]).intersections.features.length > 0) { 9 | console.log('Self-intersecting polygon detected and removed. Intersection(s) at: '); 10 | console.log(JSON.stringify(turf.kinks(mainPolys.features[p]).intersections)); 11 | } 12 | else { 13 | polysValidated.features.push(mainPolys.features[p]); 14 | } 15 | } 16 | 17 | fs.writeFileSync(process.argv[2], JSON.stringify(polysValidated)); 18 | -------------------------------------------------------------------------------- /processing/water/bbox.js: -------------------------------------------------------------------------------- 1 | // return a bounding box array given a geojson file input 2 | 3 | var turf = require('turf') 4 | var fs = require('fs') 5 | 6 | var tractPolys = JSON.parse(fs.readFileSync(process.argv[2])); 7 | 8 | var bbox = turf.extent(tractPolys); 9 | 10 | console.log(bbox); -------------------------------------------------------------------------------- /processing/water/get.js: -------------------------------------------------------------------------------- 1 | // SPIT OUT A NAMED GEOJSON FILE FOR EACH INPUT TILE ADDRESS 2 | 3 | var fs = require('fs'); 4 | var request = require('request'); 5 | var turf = require('turf'); 6 | var Protobuf = require('pbf'); 7 | var VectorTile = require('vector-tile').VectorTile; 8 | 9 | var bigTile = process.argv[2]; 10 | var outDir = process.argv[3]; 11 | var mbToken = process.argv[4]; 12 | var mbUrlBase = 'http://a.tiles.mapbox.com/v4/mapbox.mapbox-streets-v7/'; 13 | var mbUrlSuffix = '.vector.pbf?access_token=' + mbToken; 14 | 15 | var x = JSON.parse(bigTile)[0]; 16 | var y = JSON.parse(bigTile)[1]; 17 | var z = JSON.parse(bigTile)[2]; 18 | 19 | var getTile = request({url: mbUrlBase + z + '/' + x + '/' + y + mbUrlSuffix, gzip: true, encoding: null}, function (error, response, body) { 20 | if (error) { 21 | console.error('encountered error', error instanceof Error ? error.stack : error); 22 | } else if (response.statusCode === 429) { 23 | console.log('error 429'); 24 | } else if (response.statusCode !== 200) { 25 | console.error('non-200 status code: ' + response.statusCode); 26 | } else { 27 | var buf = new Protobuf(body); 28 | var vt = new VectorTile(buf); 29 | var layer = vt.layers['water']; 30 | if (layer && layer.length > 0) { 31 | var waterSet = {"type":"FeatureCollection","features":[]}; 32 | for (var i = 0; i < layer.length; i++) { 33 | var feature = layer.feature(i).toGeoJSON(x,y,z); 34 | waterSet.features.push(feature); 35 | } 36 | fs.writeFile(outDir + 'osm_water_' + x + '_' + y + '_' + z + '.geojson', JSON.stringify(waterSet), 'utf-8'); 37 | console.log('got tile {' + z + '}/{' + x + '}/{' + y + '}'); 38 | } 39 | else { 40 | console.log('no water features at tile {' + z + '}/{' + x + '}/{' + y + '}') 41 | } 42 | } 43 | }); 44 | 45 | getTile; -------------------------------------------------------------------------------- /processing/water/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "water", 3 | "version": "2.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "vtcraghead@gmail.com", 10 | "license": "ISC", 11 | "dependencies": { 12 | "pbf": "^1.3.5", 13 | "request": "^2.69.0", 14 | "turf": "^2.0.2", 15 | "vector-tile": "^1.2.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /processing/water/piranha.sql: -------------------------------------------------------------------------------- 1 | -- fix what polygons can be fixed 2 | /*DROP TABLE IF EXISTS valid_water; 3 | CREATE TABLE valid_water AS ( 4 | SELECT 5 | ST_Makevalid(wkb_geometry) AS the_geom 6 | FROM water_tile 7 | ); 8 | 9 | DELETE FROM valid_water 10 | WHERE ST_Area( 11 | ST_Transform( 12 | the_geom, 13 | 3857 14 | ) 15 | ) < 500000; 16 | */ 17 | -- speed up the processing 18 | DROP INDEX IF EXISTS idx_tracts; 19 | DROP INDEX IF EXISTS idx_water; 20 | CREATE INDEX idx_tracts ON community_tracts USING GIST (wkb_geometry); 21 | CREATE INDEX idx_water ON valid_water USING GIST (the_geom); 22 | VACUUM ANALYZE; 23 | 24 | -- remove water from tracts geo 25 | DROP TABLE IF EXISTS community_tracts_eaten; 26 | CREATE TABLE community_tracts_eaten AS ( 27 | SELECT 28 | ogc_fid, 29 | ST_Difference( 30 | wkb_geometry,( 31 | SELECT 32 | ST_Union( 33 | ST_Buffer( 34 | the_geom, 35 | 0.0001 36 | ) 37 | ) 38 | FROM valid_water 39 | )) AS wkb_geometry, 40 | statefp, 41 | countyfp, 42 | tractce, 43 | geoid, 44 | name, 45 | namelsad, 46 | mtfcc, 47 | funcstat, 48 | aland, 49 | awater, 50 | intptlat, 51 | intptlon, 52 | state, 53 | county, 54 | p0010001, 55 | largest_group_count, 56 | largest_group_proportion, 57 | id, 58 | code, 59 | largest_community_name, 60 | collection, 61 | map_color 62 | FROM community_tracts 63 | ); 64 | 65 | -- clean house for the next tile 66 | DROP TABLE IF EXISTS water_tile; 67 | DROP TABLE IF EXISTS valid_water; 68 | DROP TABLE IF EXISTS community_tracts; 69 | ALTER TABLE community_tracts_eaten RENAME TO community_tracts; -------------------------------------------------------------------------------- /processing/water/roads.sql: -------------------------------------------------------------------------------- 1 | DELETE FROM overpass_roads WHERE LEFT(id,3) != 'way'; 2 | ALTER TABLE overpass_roads RENAME COLUMN wkb_geometry TO the_geom; 3 | DROP TABLE IF EXISTS ring_roads; 4 | CREATE TABLE ring_roads AS ( 5 | SELECT 6 | name, 7 | highway AS type, 8 | ST_Difference( 9 | the_geom, 10 | ( 11 | ST_Collect( 12 | ( 13 | SELECT 14 | ST_Transform( 15 | ST_Buffer( 16 | ST_Transform( 17 | ST_Collect( 18 | the_geom 19 | ), 20 | 3857 21 | ), 22 | 100 23 | ), 24 | 4326 25 | ) 26 | FROM community_polys 27 | ), 28 | ( 29 | SELECT 30 | the_geom 31 | FROM community_mask 32 | ) 33 | ) 34 | ) 35 | ) as the_geom 36 | FROM overpass_roads 37 | ); --------------------------------------------------------------------------------