> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# /visualize/isochrone

```
URL: http://<db.host>:<db.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
[Graphs and Solvers](../../graph_solver/network_graph_solver/) for more
information on graphs.

## Input Parameter Description

<ParamField body="graph_name" type="string">
  Name of the graph on which the isochrone is to be computed.
</ParamField>

<ParamField body="source_node" type="string">
  Starting vertex on the underlying graph from/to which the isochrones are created.
</ParamField>

<ParamField body="max_solution_radius" type="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.
</ParamField>

<ParamField body="weights_on_edges" type="array of strings">
  Additional weights to apply to the edges of an existing graph. Weights must be specified using [identifiers](../../graph_solver/network_graph_solver/#identifiers); identifiers are grouped as [combinations](../../graph_solver/network_graph_solver/#id-combos). 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 ( \[] ).
</ParamField>

<ParamField body="restrictions" type="array of strings">
  Additional restrictions to apply to the nodes/edges of an existing graph. Restrictions must be specified using [identifiers](../../graph_solver/network_graph_solver/#identifiers); identifiers are grouped as [combinations](../../graph_solver/network_graph_solver/#id-combos). 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 ( \[] ).
</ParamField>

<ParamField body="num_levels" type="int">
  Number of equally-separated isochrones to compute.

  The default value is 1.
</ParamField>

<ParamField body="generate_image" type="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
</ParamField>

<ParamField body="levels_table" type="string">
  Name of the table to output the isochrones to, in \[schema\_name.]table\_name format, using standard [name resolution rules](../../concepts/tables/#table-name-resolution) and meeting [table naming criteria](../../concepts/tables/#table-naming-criteria). The table will contain levels and their corresponding WKT geometry. If no value is provided, the table is not generated.

  The default value is ''.
</ParamField>

<ParamField body="style_options" type="map of string to strings">
  Various style related options of the isochrone image.

  <Expandable title="style_options">
    <ParamField body="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`.
    </ParamField>

    <ParamField body="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.

      The default value is `FF696969`.
    </ParamField>

    <ParamField body="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).

      The default value is `00000000`.
    </ParamField>

    <ParamField body="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).

      The default value is `FF000000`.
    </ParamField>

    <ParamField body="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
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="solve_options" type="map of string to strings">
  Solver specific parameters.

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

  <Expandable title="solve_options">
    <ParamField body="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
    </ParamField>

    <ParamField body="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.
    </ParamField>

    <ParamField body="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.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="contour_options" type="map of string to strings">
  Contour specific parameters.

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

  <Expandable title="contour_options">
    <ParamField body="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
    </ParamField>

    <ParamField body="width">
      When input parameter *generate\_image* is set to *true*, width of the generated image.

      The default value is `512`.
    </ParamField>

    <ParamField body="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`.
    </ParamField>

    <ParamField body="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`.
    </ParamField>

    <ParamField body="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`.
    </ParamField>

    <ParamField body="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
    </ParamField>

    <ParamField body="add_labels">
      If set to *true*, add labels to the isolines.

      The default value is `false`.

      The supported values are:

      * true
      * false
    </ParamField>

    <ParamField body="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`.
    </ParamField>

    <ParamField body="labels_font_family">
      When *add\_labels* is set to *true*, font name to be used when adding labels.

      The default value is `arial`.
    </ParamField>

    <ParamField body="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`.
    </ParamField>

    <ParamField body="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`.
    </ParamField>

    <ParamField body="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`.
    </ParamField>

    <ParamField body="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`.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="options" type="map of string to strings">
  Additional parameters.

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

  <Expandable title="options">
    <ParamField body="solve_table">
      Name of the table to host intermediate solve results, in \[schema\_name.]table\_name format, using standard [name resolution rules](../../concepts/tables/#table-name-resolution) and meeting [table naming criteria](../../concepts/tables/#table-naming-criteria). This table will contain 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 ''.
    </ParamField>

    <ParamField body="is_replicated">
      If set to *true*, replicate the *solve\_table*.

      The default value is `true`.

      The supported values are:

      * true
      * false
    </ParamField>

    <ParamField body="data_min_x">
      Lower bound for the x values. If not provided, it will be computed from the bounds of the input data.
    </ParamField>

    <ParamField body="data_max_x">
      Upper bound for the x values. If not provided, it will be computed from the bounds of the input data.
    </ParamField>

    <ParamField body="data_min_y">
      Lower bound for the y values. If not provided, it will be computed from the bounds of the input data.
    </ParamField>

    <ParamField body="data_max_y">
      Upper bound for the y values. If not provided, it will be computed from the bounds of the input data.
    </ParamField>

    <ParamField body="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`.
    </ParamField>

    <ParamField body="use_priority_queue_solvers">
      Sets the solver methods explicitly if true.

      The default value is `false`.

      * **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*.
    </ParamField>

    <ParamField body="solve_direction">
      Specify whether we are going to the source node, or starting from it.

      The default value is `from_source`.

      * **from\_source**: Shortest path to get to the source (inverse Dijkstra).
      * **to\_source**: Shortest path to source (Dijkstra).
    </ParamField>
  </Expandable>
</ParamField>

## Output Parameter Description

The Kinetica 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:

<ResponseField name="status" type="String">
  'OK' or 'ERROR'
</ResponseField>

<ResponseField name="message" type="String">
  Empty if success or an error message
</ResponseField>

<ResponseField name="data_type" type="String">
  'visualize\_isochrone\_response' or 'none' in case of an error
</ResponseField>

<ResponseField name="data" type="String">
  Empty string
</ResponseField>

<ResponseField name="data_str" type="JSON or String">
  This embedded JSON represents the result of the /visualize/isochrone endpoint:

  <Expandable title="data_str">
    <ResponseField name="width" type="int">
      Width of the image as provided in *width*.
    </ResponseField>

    <ResponseField name="height" type="int">
      Height of the image as provided in *height*.
    </ResponseField>

    <ResponseField name="bg_color" type="long">
      Background color of the image as provided in *bg\_color*.
    </ResponseField>

    <ResponseField name="image_data" type="bytes">
      Generated contour image data.
    </ResponseField>

    <ResponseField name="info" type="map of string to strings">
      Additional information.
    </ResponseField>

    <ResponseField name="solve_info" type="map of string to strings">
      Additional information.
    </ResponseField>

    <ResponseField name="contour_info" type="map of string to strings">
      Additional information.
    </ResponseField>
  </Expandable>

  Empty string in case of an error.
</ResponseField>
