Categories:

Geospatial functions

ST_INTERPOLATE

Given an input GEOGRAPHY object, returns an interpolated object that is within a specified tolerance.

You can call this function when you need to see how GEOGRAPHY objects look like in the planar coordinate system (for example, when using visualization tools for geospatial data).

Syntax

ST_INTERPOLATE( <geography_expression> [ , <tolerance> ] )
Copy

Arguments

Required:

geography_expression

The GEOGRAPHY object to interpolate.

Optional:

tolerance

The maximum Hausdorff distance (link removed) in meters between the original object and its planar (Mercator) projection (link removed).

Default: 10 meters

Returns

The function returns a value of type GEOGRAPHY.

Examples

The following statements return an interpolated object within tolerance of 1000 meters. The statement returns output in WKT format.

ALTER SESSION SET GEOGRAPHY_OUTPUT_FORMAT = 'WKT';

SELECT TO_GEOGRAPHY(
  'POLYGON((2.365837 48.862456,-76.992874 39.009046,-16.091194 18.013997,2.365837 48.862456))')
    AS input_object,
  ST_INTERPOLATE(
    TO_GEOGRAPHY(
      'POLYGON((2.365837 48.862456,-76.992874 39.009046,-16.091194 18.013997,2.365837 48.862456))'
    ),
    1000
  ) AS interpolated_object;
Copy
+--------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| INPUT_OBJECT                                                                               | INTERPOLATED_OBJECT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|--------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| POLYGON((2.365837 48.862456,-76.992874 39.009046,-16.091194 18.013997,2.365837 48.862456)) | POLYGON((2.365837 48.862456,0.2362767764 49.398305615,-1.996262883 49.906689161,-4.332160104 50.382437182,-6.770456901 50.820131017,-9.308629958 51.214188609,-11.942383026 51.558974127,-13.293232976 51.711146148,-14.665482532 51.848930511,-16.058033739 51.971669906,-17.469660151 52.078731821,-18.899009042 52.169513959,-20.344605456 52.243449667,-21.804858156 52.300013293,-23.278067492 52.338725392,-24.762435158 52.359157656,-26.256075742 52.3609375,-27.757029917 52.343752197,-29.263279078 52.307352477,-30.772761157 52.251555506,-32.283387321 52.176247197,-33.793059226 52.081383774,-35.299686463 51.966992581,-36.801203842 51.833172099,-38.295588157 51.680091182,-39.780874093 51.507987534,-41.25516898 51.317165449,-42.716666126 51.107992889,-44.16365652 50.880897942,-45.594538759 50.636364763,-47.007827085 50.374929055,-48.402157513 50.097173201,-49.776292048 49.803721135,-51.129121057 49.495233035,-52.459663914 49.172399933,-53.767068032 48.835938324,-55.050606468 48.486584847,-57.543783773 47.752218706,-59.935729311 46.975406135,-62.224659081 46.162267318,-64.410251688 45.318811613,-66.493415436 44.450833283,-68.47605821 43.563829764,-70.360871429 42.662941503,-72.151135223 41.752911448,-73.850548486 40.838061719,-75.463084888 39.922284722,-76.992874 39.009046,-75.054371602 38.900776338,-73.070188895 38.756302935,-71.04361197 38.573354324,-68.978491512 38.349817237,-66.879224949 38.083791708,-64.750721339 37.773647264,-62.598348624 37.418078058,-60.427863866 37.016154514,-58.24532822 36.567368929,-56.057009424 36.07167252,-53.86927558 35.52950163,-51.688484598 34.941791231,-49.5208741 34.309974475,-47.372456469 33.635967742,-45.248923381 32.922141467,-43.155563394 32.171277799,-41.097195205 31.386516865,-39.078118124 30.57129403,-37.102080178 29.729270906,-35.172263312 28.864263107,-33.291284269 27.980167693,-31.461209158 27.080893062,-29.683579328 26.170293681,-27.959446009 25.252111561,-26.289411197 24.329925855,-24.673672456 23.407111409,-23.112069576 22.486806569,-21.604131345 21.571890097,-18.746079719 19.768360293,-16.091194 18.013997,-14.452640773 21.830752143,-12.663169134 25.760435024,-11.706340645 27.75379918,-10.704942742 29.757834797,-9.656443607 31.765812338,-8.558194149 33.770740816,-7.407434508 35.765476568,-6.20130448 37.742837326,-4.936858776 39.695716684,-3.61108818 41.617194045,-2.2209478 43.500635601,-0.7633937119 45.339782667,0.7645706485 47.128824761,2.365837 48.862456)) |
+--------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

The following images visualize the original and interpolated GEOGRAPHY objects from the example above in the Mercator projection (EPSG:3857 (https://epsg.io/3857)).

Original

Interpolated

Input object passed to ST_INTERPOLATE Output object returned by ST_INTERPOLATE
Language: English