AgentMaps/devdocs/global.html
noncomputable 728c3038fa Updates
2018-08-01 03:43:43 -04:00

4067 lines
49 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Global</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Global</h1>
<section>
<header>
<h2></h2>
</header>
<article>
<div class="container-overview">
<dl class="details">
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="agentmap"><span class="type-signature"></span>agentmap<span class="type-signature"></span></h4>
<div class="description">
Generates an agentmap for the given map.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="agentmap.js.html">agentmap.js</a>, <a href="agentmap.js.html#line222">line 222</a>
</li></ul></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="agentify"><span class="type-signature"></span>agentify<span class="signature">(count, agentFeatureMaker)</span><span class="type-signature"></span></h4>
<div class="description">
Generate some number of agents and place them on the map.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>count</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The desired number of agents.</td>
</tr>
<tr>
<td class="name"><code>agentFeatureMaker</code></td>
<td class="type">
<span class="param-type"><a href="global.html#agentFeatureMaker">agentFeatureMaker</a></span>
</td>
<td class="description last">A callback that determines an agent i's feature properties and geometry (always a Point).</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="agents.js.html">agents.js</a>, <a href="agents.js.html#line48">line 48</a>
</li></ul></dd>
</dl>
<h4 class="name" id="buildingify"><span class="type-signature"></span>buildingify<span class="signature">(bounding_box, OSM_data, OSM_data_URL)</span><span class="type-signature"></span></h4>
<div class="description">
Generate and setup the desired map features (e.g. streets, houses).
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>bounding_box</code></td>
<td class="type">
<span class="param-type">Array.&lt;Array.&lt;number>></span>
</td>
<td class="description last">The map's top-left and bottom-right coordinates.</td>
</tr>
<tr>
<td class="name"><code>OSM_data</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">A GeoJSON Feature Collection object containing the OSM features inside the bounding box.</td>
</tr>
<tr>
<td class="name"><code>OSM_data_URL</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">URL from which to download equivalent OSM_data.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line19">line 19</a>
</li></ul></dd>
</dl>
<h4 class="name" id="decodeCoordString"><span class="type-signature">(private) </span>decodeCoordString<span class="signature">(coord_string, place)</span><span class="type-signature"> &rarr; {<a href="global.html#LatLng">LatLng</a>}</span></h4>
<div class="description">
Turn a string containing coordinates (a graph node's ID) into a LatLng object.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>coord_string</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">A string containing coordinates in the format of "Latitude,Longitude".</td>
</tr>
<tr>
<td class="name"><code>place</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">An object specifying the place of the coordinate string.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="routing.js.html">routing.js</a>, <a href="routing.js.html#line176">line 176</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
- The coordinates encoded by the coord_string.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="global.html#LatLng">LatLng</a></span>
</dd>
</dl>
<h4 class="name" id="encodeLatLng"><span class="type-signature">(private) </span>encodeLatLng<span class="signature">(lat_lng)</span><span class="type-signature"> &rarr; {string}</span></h4>
<div class="description">
Turn a LatLng object into a string representing its coordinates (to act as a graph node's ID).
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>lat_lng</code></td>
<td class="type">
<span class="param-type"><a href="global.html#LatLng">LatLng</a></span>
</td>
<td class="description last">The coordinates to encode into a string.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="routing.js.html">routing.js</a>, <a href="routing.js.html#line164">line 164</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
- A string containing coordinates in the format of "Latitude,Longitude".
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id="generateUnitFeatures"><span class="type-signature">(private) </span>generateUnitFeatures<span class="signature">(unit_anchors, proposed_unit_features, street_feature_id)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="global.html#Feature">Feature</a>>}</span></h4>
<div class="description">
Given two anchors, find four nearby points on either side
of the street appropriate to build a unit(s) on.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>unit_anchors</code></td>
<td class="type">
<span class="param-type">Array.&lt;Array.&lt;<a href="global.html#Feature">Feature</a>>></span>
</td>
<td class="description last">array of pairs of points around which to anchor units along a street.</td>
</tr>
<tr>
<td class="name"><code>proposed_unit_features</code></td>
<td class="type">
<span class="param-type">Array.&lt;<a href="global.html#Feature">Feature</a>></span>
</td>
<td class="description last">array of features representing real estate units already proposed for construction.</td>
</tr>
<tr>
<td class="name"><code>street_feature_id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The Leaflet layer ID of the street feature along which the unit is being constructed..</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line179">line 179</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
unit_features - array of features representing real estate units.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array.&lt;<a href="global.html#Feature">Feature</a>></span>
</dd>
</dl>
<h4 class="name" id="getIntersections"><span class="type-signature"></span>getIntersections<span class="signature">(arr_a, arr_b, ids)</span><span class="type-signature"> &rarr; {Array.&lt;Array.&lt;(number|Object.&lt;number, number>)>>}</span></h4>
<div class="description">
Given two coordinate arrays, get their intersection.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>arr_a</code></td>
<td class="type">
<span class="param-type">array.&lt;array.&lt;number>></span>
</td>
<td class="description last">Array of coordinate pairs.</td>
</tr>
<tr>
<td class="name"><code>arr_b</code></td>
<td class="type">
<span class="param-type">array.&lt;array.&lt;number>></span>
</td>
<td class="description last">Array of coordinate pairs.</td>
</tr>
<tr>
<td class="name"><code>ids</code></td>
<td class="type">
<span class="param-type">array.&lt;number></span>
</td>
<td class="description last">2-element array whose elements are IDs for arr_a and arr_b respectively.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line84">line 84</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
- Array whose elements are the intersections' cooridinates if
ids is empty, or otherwise whose elements are arrays each of whose first element is an
intersection's coordinates and whose second element is an object mapping each array's ID (supplied by ids)
to the index of the intersecting coordinate-pair in that array.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array.&lt;Array.&lt;(number|Object.&lt;number, number>)>></span>
</dd>
</dl>
<h4 class="name" id="getPath"><span class="type-signature">(private) </span>getPath<span class="signature">(start_int_lat_lng, goal_int_lat_lng, start_lat_lng, goal_lat_lng, sparse<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;Array.&lt;number>>}</span></h4>
<div class="description">
Get a path between two points on a graph.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>start_int_lat_lng</code></td>
<td class="type">
<span class="param-type"><a href="global.html#LatLng">LatLng</a></span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last">The coordinates of the nearest intersection on the same street at the start_lat_lng.</td>
</tr>
<tr>
<td class="name"><code>goal_int_lat_lng</code></td>
<td class="type">
<span class="param-type"><a href="global.html#LatLng">LatLng</a></span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last">The coordinates of the nearest intersection on the same street as the goal_lat_lng.</td>
</tr>
<tr>
<td class="name"><code>start_lat_lng</code></td>
<td class="type">
<span class="param-type"><a href="global.html#LatLng">LatLng</a></span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last">The coordinates of the point on the street from which the agent will be traveling.</td>
</tr>
<tr>
<td class="name"><code>goal_lat_lng</code></td>
<td class="type">
<span class="param-type"><a href="global.html#LatLng">LatLng</a></span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last">The coordinates of the point on the street to which the agent should travel.</td>
</tr>
<tr>
<td class="name"><code>sparse</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last">Whether to exclude intersections between the first and last along a street-specific path (which are superfluous for extracting the necessary sub-street).</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="routing.js.html">routing.js</a>, <a href="routing.js.html#line103">line 103</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
- An array of points along the graph, leading from the start to the end.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array.&lt;Array.&lt;number>></span>
</dd>
</dl>
<h4 class="name" id="getPathFinder"><span class="type-signature">(private) </span>getPathFinder<span class="signature">(graph)</span><span class="type-signature"> &rarr; {object}</span></h4>
<div class="description">
Given an OSM street network (graph), return an A* pathfinder that can operate on it.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>graph</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">An ngraph graph representing an OSM street network.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="routing.js.html">routing.js</a>, <a href="routing.js.html#line84">line 84</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
- An A* pathfinder for the graph.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">object</span>
</dd>
</dl>
<h4 class="name" id="getStreetFeatures"><span class="type-signature">(private) </span>getStreetFeatures<span class="signature">(OSM_data)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="global.html#Feature">Feature</a>>}</span></h4>
<div class="description">
Get all streets from the GeoJSON data.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>OSM_data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">A GeoJSON Feature Collection object containing the OSM streets inside the bounding box.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line153">line 153</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
- array of street features.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array.&lt;<a href="global.html#Feature">Feature</a>></span>
</dd>
</dl>
<h4 class="name" id="getUnitAnchors"><span class="type-signature">(private) </span>getUnitAnchors<span class="signature">(street_feature)</span><span class="type-signature"> &rarr; {Array.&lt;Array.&lt;<a href="global.html#Feature">Feature</a>>>}</span></h4>
<div class="description">
Find anchors for potential units. chors are the pairs of start
and end points along the street from which units may be constructed.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>street_feature</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Feature">Feature</a></span>
</td>
<td class="description last">A GeoJSON feature object representing a street.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line273">line 273</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
- array of pairs of points around which to anchor units along a street.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array.&lt;Array.&lt;<a href="global.html#Feature">Feature</a>>></span>
</dd>
</dl>
<h4 class="name" id="getUnitFeatures"><span class="type-signature">(private) </span>getUnitFeatures<span class="signature">(OSM_data)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="global.html#Feature">Feature</a>>}</span></h4>
<div class="description">
Get all appropriate units within the desired bounding box.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>OSM_data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">A GeoJSON Feature Collection object containing the OSM features inside the bounding box.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line130">line 130</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
- array of features representing real estate units.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array.&lt;<a href="global.html#Feature">Feature</a>></span>
</dd>
</dl>
<h4 class="name" id="isPointCoordinates"><span class="type-signature"></span>isPointCoordinates<span class="signature">(array)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
<div class="description">
Given an array, check whether it can represent the coordinates of a point.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>array</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="description last">Array to check.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line36">line 36</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
- Whether the array can be the coordinates of a point.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
<h4 class="name" id="noOverlaps"><span class="type-signature">(private) </span>noOverlaps<span class="signature">(polygon_feature, polygon_feature_array)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
<div class="description">
Check whether a polygon overlaps with any member of an array of polygons.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>polygon_feature</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Feature">Feature</a></span>
</td>
<td class="description last">A geoJSON polygon feature.</td>
</tr>
<tr>
<td class="name"><code>polygon_feature_array</code></td>
<td class="type">
<span class="param-type">Array.&lt;<a href="global.html#Feature">Feature</a>></span>
</td>
<td class="description last">array of geoJSON polygon features.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line336">line 336</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
- Whether the polygon_feature overlaps with any one in the array.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
<h4 class="name" id="pointToCoordinateArray"><span class="type-signature"></span>pointToCoordinateArray<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;number>}</span></h4>
<div class="description">
Given either a GeoJSON feature, L.latLng, or coordinate array containing the coordinates of a point,
return an array of the coordinates.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line53">line 53</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
- Array of the point's coordinates. I.e.: [lng, lat].
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array.&lt;number></span>
</dd>
</dl>
<h4 class="name" id="reversedCoordinates"><span class="type-signature"></span>reversedCoordinates<span class="signature">(coordinates)</span><span class="type-signature"> &rarr; {Array.&lt;(number|Array.&lt;(number|Array.&lt;number>)>)>}</span></h4>
<div class="description">
Given a geoJSON geometry object's coordinates, return the object, but with
all the coordinates reversed. <br /point.geometry && point.geometry.coordinates && >
Why? GeoJSON coordinates are in lngLat format by default, while Leaflet uses latLng.
L.geoJSON will auto-reverse the order of a GeoJSON object's coordinates, as it
expects geoJSON coordinates to be lngLat. However, normal, non-GeoJSON-specific Leaflet
methods expect Leaflet's latLng pairs and won't auto-reverse, so we have to do that
manually if we're preprocessing the GeoJSON data before passing it to L.geoJSON.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>coordinates</code></td>
<td class="type">
<span class="param-type">Array.&lt;(number|Array.&lt;(number|Array.&lt;number>)>)></span>
</td>
<td class="description last">GeoJSON coordinates for a point, (multi-)line, or (multi-)polygon.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line16">line 16</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
- Reversed geoJSON coordinates for a point, (multi-)line, or (multi-)polygon.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array.&lt;(number|Array.&lt;(number|Array.&lt;number>)>)></span>
</dd>
</dl>
<h4 class="name" id="streetsToGraph"><span class="type-signature">(private) </span>streetsToGraph<span class="signature">(streets)</span><span class="type-signature"> &rarr; {Object}</span></h4>
<div class="description">
Convert a layerGroup of streets into a graph.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>streets</code></td>
<td class="type">
<span class="param-type">LayerGroup</span>
</td>
<td class="description last">A Leaflet layerGroup of streets, forming a street network.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="routing.js.html">routing.js</a>, <a href="routing.js.html#line16">line 16</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
- A graph representing the street network, operable by the ngraph pathfinder.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
<h4 class="name" id="unitsOutOfStreets"><span class="type-signature">(private) </span>unitsOutOfStreets<span class="signature">(unit_features, street_layers)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="global.html#Feature">Feature</a>>}</span></h4>
<div class="description">
Get an array of units excluding units that overlap with streets.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>unit_features</code></td>
<td class="type">
<span class="param-type">Array.&lt;<a href="global.html#Feature">Feature</a>></span>
</td>
<td class="description last">ray of features representing units.</td>
</tr>
<tr>
<td class="name"><code>street_layers</code></td>
<td class="type">
<span class="param-type">Array.&lt;Layer></span>
</td>
<td class="description last">ray of Leaflet layers representing streets.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line309">line 309</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
- unit_features, but with all units that intersect any streets removed.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array.&lt;<a href="global.html#Feature">Feature</a>></span>
</dd>
</dl>
<h3 class="subsection-title">Type Definitions</h3>
<h4 class="name" id="agentFeatureMaker"><span class="type-signature"></span>agentFeatureMaker<span class="signature">(i)</span><span class="type-signature"> &rarr; (nullable) {<a href="global.html#Point">Point</a>}</span></h4>
<div class="description">
User-defined callback that gives a feature with appropriate geometry and properties to represent an agent.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>i</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">A number used to determine the agent's coordinates and other properties.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="agents.js.html">agents.js</a>, <a href="agents.js.html#line12">line 12</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
- Either a GeoJSON Point feature with properties and coordinates for agent i, including
a "place" property that will define the agent's initial agent.place; or null, which will cause agentify
to immediately stop its work & terminate.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="global.html#Point">Point</a></span>
</dd>
</dl>
<h4 class="name" id="Feature">Feature</h4>
<div class="description">
A GeoJSON feature object.
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">object</span>
</li>
</ul>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Should be "Feature".</td>
</tr>
<tr>
<td class="name"><code>properties</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">Non-geometric properties of the feature.</td>
</tr>
<tr>
<td class="name"><code>geometry</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">Geometric properties of the feature (a GeoJSON spec of the feature's geometry).
<h6>Properties</h6>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The feature's GeoJSON geometry type.</td>
</tr>
<tr>
<td class="name"><code>coordinates</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="description last">The coordinates specifying the feature's geometry.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jsdocs.js.html">jsdocs.js</a>, <a href="jsdocs.js.html#line13">line 13</a>
</li></ul></dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li><a href="http://geojson.org/">http://geojson.org/</a></li>
</ul>
</dd>
</dl>
<h4 class="name" id="LatLng">LatLng</h4>
<div class="description">
Represents a latitude/longitude pair. Preferably an instance of L.LatLng:
<a href="https://leafletjs.com/reference-1.3.2.html#latlng">https://leafletjs.com/reference-1.3.2.html#latlng</a>.
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">object</span>
</li>
</ul>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>lat</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="description last">A decimal latitude.</td>
</tr>
<tr>
<td class="name"><code>lng</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="description last">A decimal longitude.</td>
</tr>
<tr>
<td class="name"><code>new_place</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Place">Place</a></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">A place (unit or street) associated with this LatLng.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jsdocs.js.html">jsdocs.js</a>, <a href="jsdocs.js.html#line3">line 3</a>
</li></ul></dd>
</dl>
<h4 class="name" id="Place">Place</h4>
<div class="description">
A place representing either a unit or a street.
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">object</span>
</li>
</ul>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>street</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">The ID of a street in the agentmap's street layer group.</td>
</tr>
<tr>
<td class="name"><code>unit</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">The ID of a unit in the agentmap's unit layer group.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jsdocs.js.html">jsdocs.js</a>, <a href="jsdocs.js.html#line32">line 32</a>
</li></ul></dd>
</dl>
<h4 class="name" id="Point">Point</h4>
<div class="description">
A GeoJSON <a href="global.html#Feature">Feature</a> specifically for individual points.
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><a href="global.html#Feature">Feature</a></span>
</li>
</ul>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>geometry.coordinates</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="description last">A single array with 2 elements: [longitude, latitude].</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jsdocs.js.html">jsdocs.js</a>, <a href="jsdocs.js.html#line25">line 25</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Global</h3><ul><li><a href="global.html#agentify">agentify</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#buildingify">buildingify</a></li><li><a href="global.html#decodeCoordString">decodeCoordString</a></li><li><a href="global.html#encodeLatLng">encodeLatLng</a></li><li><a href="global.html#generateUnitFeatures">generateUnitFeatures</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPath">getPath</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#getStreetFeatures">getStreetFeatures</a></li><li><a href="global.html#getUnitAnchors">getUnitAnchors</a></li><li><a href="global.html#getUnitFeatures">getUnitFeatures</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#noOverlaps">noOverlaps</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#unitsOutOfStreets">unitsOutOfStreets</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 01 2018 03:42:31 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>