ngraph.graph helper functions for weighted graph computation
Get graph data from the points which are walkable given an origin lat/long, radius, and distance between points for creation of a grid.
grid
Array<Point> A grid of Turf.js pointsapiKey
String (Optional) GoogleMaps API Key for the request. If none is provided, a process environment variable 'GMAPS_KEY' will be queried for the value. (optional, defaultprocess.env.GMAPS_KEY
)
Returns Promise<Array> A ngraph.graph object.
Get graph object representing the points which are walkable given an origin lat/long, radius, and distance between points for creation of a grid.
grid
Array<Point> A grid of Turf.js points containing 'properties' objects which contain the data needed (greenScore, parkScore, etc.) to compute the weighted graph.linkTolerance
Number The minimum distance between points to be considered a 'link'.
Returns Graph A ngraph.graph object.
Find the node in the graph which is nearest to the lat/long provided.
graph
Graph A ngraph.graph object with the nature-score data properties applied.lat
Number Latitude of start location.long
Number Longitude of start location.
Returns String The id of the nearest node.
Module for getting weather-specific data from a place.
Get graph data from the points which are walkable given an origin lat/long, radius, and distance between points for creation of a grid.
grid
Array<Point> A grid of Turf.js pointsapiKey
String (Optional) GoogleMaps API Key for the request. If none is provided, a process environment variable 'GMAPS_KEY' will be queried for the value. (optional, defaultprocess.env.GMAPS_KEY
)
Returns Promise<Array> A ngraph.graph object.
Get graph object representing the points which are walkable given an origin lat/long, radius, and distance between points for creation of a grid.
grid
Array<Point> A grid of Turf.js points containing 'properties' objects which contain the data needed (greenScore, parkScore, etc.) to compute the weighted graph.linkTolerance
Number The minimum distance between points to be considered a 'link'.
Returns Graph A ngraph.graph object.
Find the node in the graph which is nearest to the lat/long provided.
graph
Graph A ngraph.graph object with the nature-score data properties applied.lat
Number Latitude of start location.long
Number Longitude of start location.
Returns String The id of the nearest node.
Turf.js data and geometry helpers
Get a bounding box around a location with a given radius.
lat
Number Latitude of location.long
Number Longitude of location.radius
Number The radius of the bounding geometry from the given lat/long origin.
Returns BBox A Turf.js bounding box object.
Get a collection of random points which fall within a given bounding radius from an origin lat/long point.
lat
Number Latitude of location.long
Number Longitude of location.radius
Number The radius of the bounding geometry from the given lat/long origin.numPoints
Number How many points to return
Returns FeatureCollection<Point, any> A collection of Turf.JS points.
Get a collection of points in a gird which fall within a given bounding radius from an origin lat/long point.
lat
Number Latitude of location.long
Number Longitude of location.radius
Number The radius of the bounding geometry from the given lat/long origin.pointDist
Number How far apart the points should be in the point grid.
Returns Array<Point> A collection of Turf.JS points.
Module for getting Turf.js geometry and helpers.
Get a bounding box around a location with a given radius.
lat
Number Latitude of location.long
Number Longitude of location.radius
Number The radius of the bounding geometry from the given lat/long origin.
Returns BBox A Turf.js bounding box object.
Get a collection of random points which fall within a given bounding radius from an origin lat/long point.
lat
Number Latitude of location.long
Number Longitude of location.radius
Number The radius of the bounding geometry from the given lat/long origin.numPoints
Number How many points to return
Returns FeatureCollection<Point, any> A collection of Turf.JS points.
Get a collection of points in a gird which fall within a given bounding radius from an origin lat/long point.
lat
Number Latitude of location.long
Number Longitude of location.radius
Number The radius of the bounding geometry from the given lat/long origin.pointDist
Number How far apart the points should be in the point grid.
Returns Array<Point> A collection of Turf.JS points.
Weather-related data for analysis.
Get a vector representation of the sun's position at the given location and today's date.
Returns Object An object containing azimuth and sun angle properties.
Get a vector representation of the sun's position at the given location and date.
lat
Number Latitude of location.long
Number Longitude of location.date
Date Date to compute location at.
Returns Object An object containing azimuth and sun angle properties.
Module for getting weather-specific data from a place.
Get a vector representation of the sun's position at the given location and today's date.
Returns Object An object containing azimuth and sun angle properties.
Get a vector representation of the sun's position at the given location and date.
lat
Number Latitude of location.long
Number Longitude of location.date
Date Date to compute location at.
Returns Object An object containing azimuth and sun angle properties.
Yelp-related data for analysis.
Get a collection of public parks from Google Maps within the given radius from the origin lat/long point.
lat
Number Latitude of location.long
Number Longitude of location.radius
Number The radius of the bounding geometry from the given lat/long origin.apiKey
String (Optional) GoogleMaps API Key for the request. If none is provided, a process environment variable 'GMAPS_KEY' will be queried for the value. (optional, defaultprocess.env.GMAPS_KEY
)
Returns Promise<Array> A collection of nearby parks.
Module for getting nearby parks and other green public spaces.
Get a collection of public parks from Google Maps within the given radius from the origin lat/long point.
lat
Number Latitude of location.long
Number Longitude of location.radius
Number The radius of the bounding geometry from the given lat/long origin.apiKey
String (Optional) GoogleMaps API Key for the request. If none is provided, a process environment variable 'GMAPS_KEY' will be queried for the value. (optional, defaultprocess.env.GMAPS_KEY
)
Returns Promise<Array> A collection of nearby parks.
Field of view analysis for nature/greenery.
Build a url request for a google street view image.
lat
String Latitude of location.long
String Longitude of location.heading
String Direction of google street view image (between 0 to 360).apiKey
String (Optional) GoogleMaps API Key for the request. If none is provided, a process environment variable 'GMAPS_KEY' will be queried for the value. (optional, defaultprocess.env.GMAPS_KEY
)
Returns String A url for google maps.
Get the color palette of the image from google street view at the given lat, long, and orientation.
lat
String Latitude of location.long
String Longitude of location.heading
number Direction of google street view image (between 0 to 360).apiKey
String (Optional) GoogleMaps API Key for the request. If none is provided, a process environment variable 'GMAPS_KEY' will be queried for the value. (optional, defaultprocess.env.GMAPS_KEY
)
Returns Object A collection of Objects containing color palette data.
Get the color palette of a location as names of primary colors from google street view at the given lat, long, and orientation. Views will be taken at 0, 90 and 180 degrees around the central point.
lat
String Latitude of location.long
String Longitude of location.apiKey
String (Optional) GoogleMaps API Key for the request. If none is provided, a process environment variable 'GMAPS_KEY' will be queried for the value. (optional, defaultprocess.env.GMAPS_KEY
)
Returns Object A collection of Objects containing color palette data.
Get a percentage of "greenery" visible (dominant in the image color palette) in a 360 panorama taken at the given latitude/longitude.
lat
String Latitude of location.long
String Longitude of location.apiKey
String (Optional) GoogleMaps API Key for the request. If none is provided, a process environment variable 'GMAPS_KEY' will be queried for the value. (optional, defaultprocess.env.GMAPS_KEY
)
Returns Promise<Number> A decimal percentage of the prevalence of green in the field of view.
Get the closest color hue name to the input color in hex format.
hex
String Hex code of color to parse.
Returns string A color name.
Get the closest color name to the input color in hex format.
hex
String Hex code of color to parse.
Returns string A color name.
Module for getting color/color palette-specific data from points.
Build a url request for a google street view image.
lat
String Latitude of location.long
String Longitude of location.heading
String Direction of google street view image (between 0 to 360).apiKey
String (Optional) GoogleMaps API Key for the request. If none is provided, a process environment variable 'GMAPS_KEY' will be queried for the value. (optional, defaultprocess.env.GMAPS_KEY
)
Returns String A url for google maps.
Get the color palette of the image from google street view at the given lat, long, and orientation.
lat
String Latitude of location.long
String Longitude of location.heading
number Direction of google street view image (between 0 to 360).apiKey
String (Optional) GoogleMaps API Key for the request. If none is provided, a process environment variable 'GMAPS_KEY' will be queried for the value. (optional, defaultprocess.env.GMAPS_KEY
)
Returns Object A collection of Objects containing color palette data.
Get the color palette of a location as names of primary colors from google street view at the given lat, long, and orientation. Views will be taken at 0, 90 and 180 degrees around the central point.
lat
String Latitude of location.long
String Longitude of location.apiKey
String (Optional) GoogleMaps API Key for the request. If none is provided, a process environment variable 'GMAPS_KEY' will be queried for the value. (optional, defaultprocess.env.GMAPS_KEY
)
Returns Object A collection of Objects containing color palette data.
Get a percentage of "greenery" visible (dominant in the image color palette) in a 360 panorama taken at the given latitude/longitude.
lat
String Latitude of location.long
String Longitude of location.apiKey
String (Optional) GoogleMaps API Key for the request. If none is provided, a process environment variable 'GMAPS_KEY' will be queried for the value. (optional, defaultprocess.env.GMAPS_KEY
)
Returns Promise<Number> A decimal percentage of the prevalence of green in the field of view.
Get the closest color hue name to the input color in hex format.
hex
String Hex code of color to parse.
Returns string A color name.
Get the closest color name to the input color in hex format.
hex
String Hex code of color to parse.
Returns string A color name.
Route-related data for analysis.
Find a path between two nodes on the graph, weighted by the 'Green Score' weight of the nodes along the potential path.
graph
Graph A ngraph.graph object with the nature-score data properties applied.idA
String Node ID of start point.idB
String Node ID of end point.
Returns Object A ngraph.path object.
Compute all possible paths within the graph.
graph
Graph A ngraph.graph object with the nature-score data properties applied.
Returns Promise<Array> An array of all possible paths;
Compute all possible paths within the graph which start from the given start point.
graph
Graph A ngraph.graph object with the nature-score data properties applied.lat
Number Latitude of start location.long
Number Longitude of start location.
Returns Promise<Array> An array of all possible paths;
Compute all possible looping paths within the graph which start and end at the given lat/long.
graph
Graph A ngraph.graph object with the nature-score data properties applied.lat
Number Latitude of start location.long
Number Longitude of start location.
Returns Promise<Array> An array of all possible paths;
Get graph data from the points which are walkable given an origin lat/long, radius, and distance between points for creation of a grid. Sort with the top nature walks first.
json
Object The raw path output of PathsAll().apiKey
String (Optional) GoogleMaps API Key for the request. If none is provided, a process environment variable 'GMAPS_KEY' will be queried for the value. (optional, defaultprocess.env.GMAPS_KEY
)
Returns Promise<Array> A list of paths, sorted from most exposed to nature to least.
Module for computing the actual routes.
Find a path between two nodes on the graph, weighted by the 'Green Score' weight of the nodes along the potential path.
graph
Graph A ngraph.graph object with the nature-score data properties applied.idA
String Node ID of start point.idB
String Node ID of end point.
Returns Object A ngraph.path object.
Compute all possible paths within the graph.
graph
Graph A ngraph.graph object with the nature-score data properties applied.
Returns Promise<Array> An array of all possible paths;
Compute all possible paths within the graph which start from the given start point.
graph
Graph A ngraph.graph object with the nature-score data properties applied.lat
Number Latitude of start location.long
Number Longitude of start location.
Returns Promise<Array> An array of all possible paths;
Compute all possible looping paths within the graph which start and end at the given lat/long.
graph
Graph A ngraph.graph object with the nature-score data properties applied.lat
Number Latitude of start location.long
Number Longitude of start location.
Returns Promise<Array> An array of all possible paths;
Get graph data from the points which are walkable given an origin lat/long, radius, and distance between points for creation of a grid. Sort with the top nature walks first.
json
Object The raw path output of PathsAll().apiKey
String (Optional) GoogleMaps API Key for the request. If none is provided, a process environment variable 'GMAPS_KEY' will be queried for the value. (optional, defaultprocess.env.GMAPS_KEY
)
Returns Promise<Array> A list of paths, sorted from most exposed to nature to least.