Using elevation contour lines is one of several ways to visualize density from vector point data. I recently used this approach to map “stop and frisks” - the practice of a police officer stopping an individual for reasonable suspicion of criminal activity - in New York City. This practice is often criticized as happening more often in neighborhoods with higher numbers of minority residents, so showing the density of such stops is critical to the story behind this data. If you would like to know more about Stop and Frisk, check out the research conducted by the Center for Constitutional Rights and the New York Civil Liberties Union.
From the larger Stop and Frisk database, which contains more than 4.2 million records, I selected only stops that occurred in 2008 where the person stopped was either “Black”, “Latino,” or “Black Latino”, and which contained coordinates for the stop.
ogr2ogr -f SQLite /path/to/outfile/sf-race-geo.sqlite PG:"dbname='' host='localhost' port='5432'" -sql "SELECT distinct ogc_fid, lat_lon, year, race, pct FROM public."new_all" where year = '2008' AND xcoord <> '' AND (race = 'B' OR race = 'Q' OR race = 'P')"
However, in this case I wanted to really draw attention to the neighborhoods where stop and frisks happened most frequently. To better achieve this, I created elevation contours based off of vector points to show the density of the stops. Here’s how I did that.
Use the map layer as a layer itself, or as part of a mash up. Here are the contour lines – which show concentrations of stops of Black, Latino, and Black Latino persons in 2008 – on top of all of the points from all stops in 2008. To add geographical context, I used a MapBox Streets base layer.