-
Notifications
You must be signed in to change notification settings - Fork 0
/
migration-comparison.html
136 lines (130 loc) · 7.32 KB
/
migration-comparison.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
---
layout: default
---
<script>
var cityCircle;
var map;
var infowindow = new google.maps.InfoWindow();
var MY_MAPTYPE_ID = 'custom_style';
function initialize() {
var customOps = [
{
"featureType": "landscape",
"elementType": "all",
"stylers": [
{"visibility": "simplified"},
{"hue": "#0066ff"},
{"saturation": 74},
{"lightness": 100}
]
},
{
"featureType": "poi",
"elementType": "all",
"stylers": [
{"visibility": "simplified"}
]
},
{
"featureType": "road",
"elementType": "all",
"stylers": [
{"visibility": "simplified"}
]
},{
"featureType": "water",
"elementType": "all",
"stylers": [
{"visibility": "simplified"},
{"color": "#5f94ff"},
{"lightness": 26},
{"gamma": 5.86}
]
}
];
var mapOptions = {
zoom: 4,
center: new google.maps.LatLng(38, -97),
mapTypeControlOptions: {
mapTypeId: [google.maps.MapTypeId.ROADMAP, MY_MAPTYPE_ID]
},
mapTypeId:MY_MAPTYPE_ID,
panControl: false,
streetViewControl: false,
// zoomControl:false
};
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
var styledMapOptions= {
name:'Custom Style'
};
var customMapType = new google.maps.StyledMapType(
customOps,styledMapOptions
);
map.mapTypes.set(MY_MAPTYPE_ID,customMapType);
map.data.loadGeoJson('https://raw.githubusercontent.com/katerabinowitz/DC-Demographics/master/migrationCompareACS/Output/citymigration.geojson');
map.data.setStyle(function(feature) {
var migrationscore = feature.getProperty('Migration');
return {
icon: getCircle(migrationscore)
};
});
function getCircle(migrationscore) {
var circle = {
path: google.maps.SymbolPath.CIRCLE,
fillColor: '#E62B2B',
fillOpacity: .2,
scale: migrationscore,
strokeColor: '#E62B2B',
strokeWeight: .5
};
map.data.addListener('click', function(event) {
var cityname = event.feature.getProperty("city");
var m2p = event.feature.getProperty("Migrant2Pop");
var distance = event.feature.getProperty("wmDistance");
infowindow.setContent("<div id='infowindow'>"+"<p>City: "+cityname +"<br> Migrants to city population: "+ m2p + "%<br> How far migrants travel: " + distance + " miles</p></div>");
infowindow.setPosition(event.feature.getGeometry().get());
infowindow.setOptions({pixelOffset: new google.maps.Size(0,-30)});
infowindow.open(map);
});
return circle;
}
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
<h2>DC: The East Coast's Most Migratory City</h2>
<hr id='top-line'>
<h3> Kate Rabinowitz // August 2, 2015</h3>
<p class='content'> When I moved to DC about five years ago, I did so with an onslaught of millennials in search of jobs and housing that was not their parents (along with a few others who may have had loftier aims). People would often ask 'where are you from?' because it was obviously not DC, and 'when did you move here?' because, inevitably, you just did.<br><br>And five years later these questions haven’t actually changed much. Of course, there are a number of people that have lived here for years, but DC is never short of transplants starting anew. The constant influx is one of the things I like about DC; it's a very migratory population. But, really, how migratory?</p>
<p class='graph-title'>How Migratory are Major U.S. Cities?</p>
<p class='graph-subtitle'> Circle size indicates migration score based on migration rate and migration distance traveled.<br>Click on a circle for more information</p>
<div id="map-canvas"></div>
<p class='graph-subtitle'> Source: Census American Community Survey (2008-2012 mobility estimates).</p>
<p class='content'> In fact, DC is the most migratory city east of the Mississippi and rounds out the top five for most migratory cities:</p>
<ul class='content ranking'>
<li>1. San Francisco</li>
<li>2. Seattle</li>
<li>3. Portland</li>
<li>4. Las Vegas</li>
<li>5. Washington DC</li>
<li>6. Denver</li>
<li>7. Phoenix</li>
<li>8. Austin</li>
<li>9. New York</li>
<li>10. Boston</li>
</ul>
<p class='content'> It appears "Go west, young (wo)man!" is far from dead.<br><br>This migration score is driven by two factors - how many people move to the city each year as a proportion of the city's population and how far people travel when they move to the city. Looking at these two drivers across these cities four distinct groups became clear - </p>
<p class='graph-title'>What does migration look like across cities?</p>
<p class='graph-subtitle'> Cities plotted based on migration rate and migration distance traveled.<br>The quadrants are drawn at the median of each axis.</p>
<a><img class="scatter" src="./Images/US Migration Matrix.png" alt="US Migratory Matrix" align='middle'></a>
<p class='graph-subtitle'> Source: Census American Community Survey (2008-2012 mobility estimates).</p>
<p class='content'> What we see above is:</p>
<ul class='content'>
<li><b>The Pilgrimage</b>. Not as many migrants come each year compared to city size but they come from far and wide. Whether it’s to make it in LA or New York or live out the rest of their days in Phoenix, these cities lay at the end of The Pilgrimage.</li>
<li><b>The Hub</b>. These cities have a large inflow of migrants annnually coming from across the U.S. These cities are not as large as the Pilgramage cities but have a distinct character or lifestyle, like Portland, or job market, like Seattle, that attracts people to The Hub.</li>
<li><b>The Swarm</b>. These cities attract a large number of closer migrants. These cities are often emblematic of their larger region whether it's Boston for New Englanders, Atlanta for Southerners or Denver for people of the Mountains.</li>
<li><b>Out of Gas</b>. Not too many people descend on these cities, and when they do it’s not from very far. Who’s to say why they come - maybe they ran out of gas on The Pilgrimage, maybe they came through town one night and just couldn’t turn away.</li>
</ul>
<p class='content'>And there sits DC in the Hub. But beyond being a government town what are the distinct characteristics and trends of the city? More on that to come...</p>
<hr id='end-line'>
<p class='content'><b>Technical notes:</b> Graphics and rankings are based on the Census American Community Survey (ACS) 2008-2012 mobility estimates. The data is at the county-level. In some instances, the county extends beyond the city but there was not sufficient difference to exclude or weight such cases. Average distance travel is calculated using an average weighted by the number of migrants. The quadrants in the scatterplot shown above are defined by the median of each measure. The migratory score used to calculate rankings and circle size is based on the weighted average distance traveled by migrants and the number of migrants proportional to city size. You can find complete code <a class='link'href="https://github.com/katerabinowitz">on my github page.</a>
<br><br>