Version:

/visualize/isochrone

URL: http://GPUDB_IP_ADDRESS:GPUDB_PORT/visualize/isochrone

Generate an image containing isolines for travel results using an existing graph. Isolines represent curves of equal cost, with cost typically referring to the time or distance assigned as the weights of the underlying graph. See Network Graphs & Solvers for more information on graphs. .

Input Parameter Description

Name Type Description
graph_name string Name of the graph on which the isochrone is to be computed.
source_node string Starting vertex on the underlying graph from/to which the isochrones are created.
max_solution_radius double Extent of the search radius around input parameter source_node. Set to '-1.0' for unrestricted search radius. The default value is -1.0.
weights_on_edges array of strings Additional weights to apply to the edges of an existing graph. Weights must be specified using identifiers; identifiers are grouped as combinations. Identifiers can be used with existing column names, e.g., 'table.column AS WEIGHTS_EDGE_ID', or expressions, e.g., 'ST_LENGTH(wkt) AS WEIGHTS_VALUESPECIFIED'. Any provided weights will be added (in the case of 'WEIGHTS_VALUESPECIFIED') to or multiplied with (in the case of 'WEIGHTS_FACTORSPECIFIED') the existing weight(s). The default value is an empty array ( [] ).
restrictions array of strings Additional restrictions to apply to the nodes/edges of an existing graph. Restrictions must be specified using identifiers; identifiers are grouped as combinations. Identifiers can be used with existing column names, e.g., 'table.column AS RESTRICTIONS_EDGE_ID', or expressions, e.g., 'column/2 AS RESTRICTIONS_VALUECOMPARED'. If remove_previous_restrictions is set to true, any provided restrictions will replace the existing restrictions. If remove_previous_restrictions is set to false, any provided restrictions will be added (in the case of 'RESTRICTIONS_VALUECOMPARED') to or replaced (in the case of 'RESTRICTIONS_ONOFFCOMPARED'). The default value is an empty array ( [] ).
num_levels int Number of equally-separated isochrones to compute. The default value is 1.
generate_image boolean

If set to true, generates a PNG image of the isochrones in the response. The default value is true. The supported values are:

  • true
  • false
levels_table string Name of the table to output the isochrones, containing levels and their corresponding WKT geometry. If no value is provided, the table is not generated. The default value is ''.
style_options map of string to strings

Various style related options of the isochrone image.

Supported Parameters (keys) Parameter Description
line_size The width of the contour lines in pixels. The default value is '3'.The minimum allowed value is 0. The maximum allowed value is 20.
color Color of generated isolines. All color values must be in the format RRGGBB or AARRGGBB (to specify the alpha value). If alpha is specified and flooded contours are enabled, it will be used for as the transparency of the latter.This parameter is parsed by GPUdb as long. The default value is 'FF696969'.
bg_color When input parameter generate_image is set to true, background color of the generated image. All color values must be in the format RRGGBB or AARRGGBB (to specify the alpha value)This parameter is parsed by GPUdb as long. The default value is '00000000'.
text_color When add_labels is set to true, color for the labels. All color values must be in the format RRGGBB or AARRGGBB (to specify the alpha value)This parameter is parsed by GPUdb as long. The default value is 'FF000000'.
colormap

Colormap for contours or fill-in regions when applicable. All color values must be in the format RRGGBB or AARRGGBB (to specify the alpha value) The default value is jet. The supported values are:

  • jet
  • accent
  • afmhot
  • autumn
  • binary
  • blues
  • bone
  • brbg
  • brg
  • bugn
  • bupu
  • bwr
  • cmrmap
  • cool
  • coolwarm
  • copper
  • cubehelix
  • dark2
  • flag
  • gist_earth
  • gist_gray
  • gist_heat
  • gist_ncar
  • gist_rainbow
  • gist_stern
  • gist_yarg
  • gnbu
  • gnuplot2
  • gnuplot
  • gray
  • greens
  • greys
  • hot
  • hsv
  • inferno
  • magma
  • nipy_spectral
  • ocean
  • oranges
  • orrd
  • paired
  • pastel1
  • pastel2
  • pink
  • piyg
  • plasma
  • prgn
  • prism
  • pubu
  • pubugn
  • puor
  • purd
  • purples
  • rainbow
  • rdbu
  • rdgy
  • rdpu
  • rdylbu
  • rdylgn
  • reds
  • seismic
  • set1
  • set2
  • set3
  • spectral
  • spring
  • summer
  • terrain
  • viridis
  • winter
  • wistia
  • ylgn
  • ylgnbu
  • ylorbr
  • ylorrd
solve_options map of string to strings

Solver specific parameters. The default value is an empty map ( {} ).

Supported Parameters (keys) Parameter Description
remove_previous_restrictions

Ignore the restrictions applied to the graph during the creation stage and only use the restrictions specified in this request if set to true. The default value is false. The supported values are:

  • true
  • false
restriction_threshold_value Value-based restriction comparison. Any node or edge with a 'RESTRICTIONS_VALUECOMPARED' value greater than the restriction_threshold_value will not be included in the solution.
uniform_weights When specified, assigns the given value to all the edges in the graph. Note that weights provided in input parameter weights_on_edges will override this value.
contour_options map of string to strings

Solver specific parameters. The default value is an empty map ( {} ).

Supported Parameters (keys) Parameter Description
projection

Spatial Reference System (i.e. EPSG Code). The default value is PLATE_CARREE. The supported values are:

  • 3857
  • 102100
  • 900913
  • EPSG:4326
  • PLATE_CARREE
  • EPSG:900913
  • EPSG:102100
  • EPSG:3857
  • WEB_MERCATOR
width When input parameter generate_image is set to true, width of the generated image. The default value is '512'.
height When input parameter generate_image is set to true, height of the generated image. If the default value is used, the height is set to the value resulting from multiplying the aspect ratio by the width. The default value is '-1'.
search_radius When interpolating the graph solution to generate the isochrone, neighborhood of influence of sample data (in percent of the image/grid). The default value is '20'.
grid_size When interpolating the graph solution to generate the isochrone, number of subdivisions along the x axis when building the grid (the y is computed using the aspect ratio of the output image). The default value is '100'.
color_isolines

Color each isoline according to the colormap; otherwise, use the foreground color. The default value is true. The supported values are:

  • true
  • false
add_labels

If set to true, add labels to the isolines. The default value is false. The supported values are:

  • true
  • false
labels_font_size When add_labels is set to true, size of the font (in pixels) to use for labels. The default value is '12'.
labels_font_family When add_labels is set to true, font name to be used when adding labels. The default value is 'arial'.
labels_search_window When add_labels is set to true, a search window is used to rate the local quality of each isoline. Smooth, continuous, long stretches with relatively flat angles are favored. The provided value is multiplied by the labels_font_size to calculate the final window size. The default value is '4'.
labels_intralevel_separation When add_labels is set to true, this value determines the distance (in multiples of the labels_font_size) to use when separating labels of different values. The default value is '4'.
labels_interlevel_separation When add_labels is set to true, this value determines the distance (in percent of the total window size) to use when separating labels of the same value. The default value is '20'.
labels_max_angle When add_labels is set to true, maximum angle (in degrees) from the vertical to use when adding labels. The default value is '60'.
options map of string to strings

Additional parameters. The default value is an empty map ( {} ).

Supported Parameters (keys) Parameter Description
solve_table Name of the table to host intermediate solve results containing the position and cost for each vertex in the graph. If the default value is used, a temporary table is created and deleted once the solution is calculated. The default value is ''.
is_replicated

If set to true, replicate the solve_table. The default value is true. The supported values are:

  • true
  • false
data_min_x Lower bound for the x values. If not provided, it will be computed from the bounds of the input data.
data_max_x Upper bound for the x values. If not provided, it will be computed from the bounds of the input data.
data_min_y Lower bound for the y values. If not provided, it will be computed from the bounds of the input data.
data_max_y Upper bound for the y values. If not provided, it will be computed from the bounds of the input data.
concavity_level Factor to qualify the concavity of the isochrone curves. The lower the value, the more convex (with '0' being completely convex and '1' being the most concave). The default value is '0.5'.The minimum allowed value is 0. The maximum allowed value is 1.
use_priority_queue_solvers

sets the solver methods explicitly if true The default value is false.

Supported Values Description
true uses the solvers scheduled for 'shortest_path' and 'inverse_shortest_path' based on solve_direction
false uses the solvers 'priority_queue' and 'inverse_priority_queue' based on solve_direction
solve_direction

Specify whether we are going to the source node, or starting from it. The default value is from_source.

Supported Values Description
from_source Shortest path to get to the source (inverse Dijkstra)
to_source Shortest path to source (Dijkstra)

Output Parameter Description

The GPUdb server embeds the endpoint response inside a standard response structure which contains status information and the actual response to the query. Here is a description of the various fields of the wrapper:

Name Type Description
status String 'OK' or 'ERROR'
message String Empty if success or an error message
data_type String 'visualize_isochrone_request' or 'none' in case of an error
data String Empty string
data_str JSON or String

This embedded JSON represents the result of the /visualize/isochrone endpoint:

Name Type Description
width int Width of the image as provided in width.
height int Height of the image as provided in height.
bg_color long Background color of the image as provided in bg_color.
image_data bytes Generated contour image data.
info map of string to strings Additional information.
solve_info map of string to strings Additional information.
contour_info map of string to strings Additional information.

Empty string in case of an error.