the beauty of mapping


Kode Iklan Disini

Friday, April 17, 2009

The Streets As Well As Avenues Of Novel York



In many American cities the street grid organisation is frequently reflected inwards the names of the city's streets. For event inwards about cities you lot mightiness honour that all roads called 'Avenue' run due north to south, piece all roads called 'Street' run W to due east (or vice versa depending on the city).

It is possible to visualize this blueprint real effectively alongside an interactive map in addition to a radial chart. My Street Orientations map visualizes the directions of all roads called 'avenue' in addition to 'street' inwards Manhattan. On the map all roads named 'Avenue' are colored gilded in addition to all roads named 'Street' are colored blue. Simply past times looking at the map you lot tin nation that streets in addition to avenues run inwards distinctly dissimilar directions. The radial nautical chart on transcend of the map visualizes this to a greater extent than explicitly, showing the overall orientation of all the streets in addition to avenues inwards the electrical flow map persuasion (zoom into Lower Manhattan in addition to run across how the orientation of avenues in addition to streets becomes less strict).

By exploring the map you lot tin run across 'streets' inwards Manhattan run virtually alone W to due east piece 'avenues' run due north to due south (obviously because of the directions of the Hudson in addition to East Rivers these are kickoff from the truthful primal directions).

My interactive map shows the orientations of both 'streets' in addition to 'avenues'. Here is a screenshot of exactly the roads named 'street' alongside a radial nautical chart showing the orientations of all 'streets' inwards Manhattan:




Making the Road Orientations Map

All the code for my map comes from Vladimir Agafonkin's fantastic Road Orientation Map. Vladimir's map visualizes the orientations of all roads inwards the electrical flow map view. The map tin live on used to explore the orientations of roads anywhere inwards the world.

For my purposes I exactly needed to tweak the code to only demo the orientations of roads named 'avenue' in addition to 'street' in addition to to ignore all the roads called 'lane', 'avenue', alley' etc. This genuinely proved far simpler than I expected.

The Road Orientation map fetches all the roads inwards the electrical flow map persuasion alongside a unmarried describe of piece of employment of code:
var features = map.queryRenderedFeatures({layers: ['road']});
In resultant it queries the layer named route inwards a Mapbox map. This way nosotros tin but alter the layer mention to fetch dissimilar data. For event nosotros tin easily alter the inquiry to fetch the layer which displays waterways:
var features = map.queryRenderedFeatures({layers: ['waterway']});
Simply past times changing 'road' to 'waterway' nosotros tin alter the map to display the orientations of all rivers in addition to canals rather than the orientations of roads.

The Road Orientations Map volition move alongside whatsoever map layer inwards which the mapped characteristic is of the type 'line' (so map information which is inwards the shape of polylines). Therefore to exercise my map I only needed to upload ii GeoJSON files to a Mapbox style:- 1 GeoJSON file alongside the information of all 'avenues' inwards Manhattan in addition to 1 GeoJSON file alongside the information of all 'streets' inwards Manhattan.

In Mapbox Studio I named these ii layers 'avenues' in addition to streets'. All I needed to exercise thus was alter the JavaScript to inquiry my ii layers rather than the 'road' layer:
var features = map.queryRenderedFeatures({layers: ['avenues', 'streets']});