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.
gridArray<Point> A grid of Turf.js pointsapiKeyString (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.
gridArray<Point> A grid of Turf.js points containing 'properties' objects which contain the data needed (greenScore, parkScore, etc.) to compute the weighted graph.linkToleranceNumber 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.
graphGraph A ngraph.graph object with the nature-score data properties applied.latNumber Latitude of start location.longNumber 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.
gridArray<Point> A grid of Turf.js pointsapiKeyString (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.
gridArray<Point> A grid of Turf.js points containing 'properties' objects which contain the data needed (greenScore, parkScore, etc.) to compute the weighted graph.linkToleranceNumber 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.
graphGraph A ngraph.graph object with the nature-score data properties applied.latNumber Latitude of start location.longNumber 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.
latNumber Latitude of location.longNumber Longitude of location.radiusNumber 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.
latNumber Latitude of location.longNumber Longitude of location.radiusNumber The radius of the bounding geometry from the given lat/long origin.numPointsNumber 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.
latNumber Latitude of location.longNumber Longitude of location.radiusNumber The radius of the bounding geometry from the given lat/long origin.pointDistNumber 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.
latNumber Latitude of location.longNumber Longitude of location.radiusNumber 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.
latNumber Latitude of location.longNumber Longitude of location.radiusNumber The radius of the bounding geometry from the given lat/long origin.numPointsNumber 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.
latNumber Latitude of location.longNumber Longitude of location.radiusNumber The radius of the bounding geometry from the given lat/long origin.pointDistNumber 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.
latNumber Latitude of location.longNumber Longitude of location.dateDate 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.
latNumber Latitude of location.longNumber Longitude of location.dateDate 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.
latNumber Latitude of location.longNumber Longitude of location.radiusNumber The radius of the bounding geometry from the given lat/long origin.apiKeyString (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.
latNumber Latitude of location.longNumber Longitude of location.radiusNumber The radius of the bounding geometry from the given lat/long origin.apiKeyString (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.
latString Latitude of location.longString Longitude of location.headingString Direction of google street view image (between 0 to 360).apiKeyString (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.
latString Latitude of location.longString Longitude of location.headingnumber Direction of google street view image (between 0 to 360).apiKeyString (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.
latString Latitude of location.longString Longitude of location.apiKeyString (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.
latString Latitude of location.longString Longitude of location.apiKeyString (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.
hexString Hex code of color to parse.
Returns string A color name.
Get the closest color name to the input color in hex format.
hexString 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.
latString Latitude of location.longString Longitude of location.headingString Direction of google street view image (between 0 to 360).apiKeyString (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.
latString Latitude of location.longString Longitude of location.headingnumber Direction of google street view image (between 0 to 360).apiKeyString (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.
latString Latitude of location.longString Longitude of location.apiKeyString (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.
latString Latitude of location.longString Longitude of location.apiKeyString (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.
hexString Hex code of color to parse.
Returns string A color name.
Get the closest color name to the input color in hex format.
hexString 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.
graphGraph A ngraph.graph object with the nature-score data properties applied.idAString Node ID of start point.idBString Node ID of end point.
Returns Object A ngraph.path object.
Compute all possible paths within the graph.
graphGraph 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.
graphGraph A ngraph.graph object with the nature-score data properties applied.latNumber Latitude of start location.longNumber 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.
graphGraph A ngraph.graph object with the nature-score data properties applied.latNumber Latitude of start location.longNumber 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.
jsonObject The raw path output of PathsAll().apiKeyString (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.
graphGraph A ngraph.graph object with the nature-score data properties applied.idAString Node ID of start point.idBString Node ID of end point.
Returns Object A ngraph.path object.
Compute all possible paths within the graph.
graphGraph 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.
graphGraph A ngraph.graph object with the nature-score data properties applied.latNumber Latitude of start location.longNumber 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.
graphGraph A ngraph.graph object with the nature-score data properties applied.latNumber Latitude of start location.longNumber 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.
jsonObject The raw path output of PathsAll().apiKeyString (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.