liquid_feedback_core

diff pgLatLon/README.html @ 529:96ee2db56bec

New PostgreSQL extension "pgLatLon" for geospatial operations and indexing in LiquidFeedback
author jbe
date Thu Aug 18 20:19:58 2016 +0200 (2016-08-18)
parents
children 6bc81898fd3b
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/pgLatLon/README.html	Thu Aug 18 20:19:58 2016 +0200
     1.3 @@ -0,0 +1,450 @@
     1.4 +<html><head><title>pgLatLon v0.1 documentation</title></head><body>
     1.5 +<h1>pgLatLon v0.1 documentation</h1>
     1.6 +
     1.7 +<p>pgLatLon is a spatial database extension for the PostgreSQL object-relational
     1.8 +database management system providing geographic data types and spatial indexing
     1.9 +for the WGS-84 spheroid.</p>
    1.10 +
    1.11 +<p>While many other spatial databases still use imprecise bounding boxes for many
    1.12 +operations, pgLatLon supports more precise geometric calculations for all
    1.13 +implemented operators. Efficient indexing of geometric objects is provided
    1.14 +using fractal indicies. Optimizations on bit level (including logarithmic
    1.15 +compression) allow for a highly memory-efficient non-overlapping index suitable
    1.16 +for huge datasets.</p>
    1.17 +
    1.18 +<p>Unlike competing spatial extensions for PostgreSQL, pgLatLon is available under
    1.19 +the permissive MIT/X11 license to avoid problems with viral licenses like the
    1.20 +GPLv2/v3.</p>
    1.21 +
    1.22 +<h2>Installation</h2>
    1.23 +
    1.24 +<h3>Automatic installation</h3>
    1.25 +
    1.26 +<p>Prerequisites:</p>
    1.27 +
    1.28 +<ul>
    1.29 +<li>Ensure that the <code>pg_config</code> binary is in your path (shipped with PostgreSQL).</li>
    1.30 +<li>Ensure that GNU Make is available (either as <code>make</code> or <code>gmake</code>).</li>
    1.31 +</ul>
    1.32 +
    1.33 +<p>Then simply type:</p>
    1.34 +
    1.35 +<pre><code>make install
    1.36 +</code></pre>
    1.37 +
    1.38 +<h3>Manual installation</h3>
    1.39 +
    1.40 +<p>It is also possible to compile and install the extension without GNU Make as
    1.41 +follows:</p>
    1.42 +
    1.43 +<pre><code>cc -Wall -O2 -fPIC -shared -I `pg_config --includedir-server` -o latlon-v0001.so latlon-v0001.c
    1.44 +cp latlon-v0001.so `pg_config --pkglibdir`
    1.45 +cp latlon.control `pg_config --sharedir`/extension/
    1.46 +cp latlon--0.1.sql `pg_config --sharedir`/extension/
    1.47 +</code></pre>
    1.48 +
    1.49 +<h3>Loading the extension</h3>
    1.50 +
    1.51 +<p>After installation, you can create a database and load the extension as
    1.52 +follows:</p>
    1.53 +
    1.54 +<pre><code>% createdb test_database
    1.55 +% psql test_database
    1.56 +psql (9.5.4)
    1.57 +Type "help" for help.
    1.58 +
    1.59 +test_database=# CREATE EXTENSION latlon;
    1.60 +</code></pre>
    1.61 +
    1.62 +<h2>Reference</h2>
    1.63 +
    1.64 +<h3>1. Types</h3>
    1.65 +
    1.66 +<p>pgLatLon provides four geographic types: <code>epoint</code>, <code>ebox</code>, <code>ecircle</code>, and
    1.67 +<code>ecluster</code>.</p>
    1.68 +
    1.69 +<h4><code>epoint</code></h4>
    1.70 +
    1.71 +<p>A point on the earth spheroid (WGS-84).</p>
    1.72 +
    1.73 +<p>The text input format is <code>'[N|S]&lt;float&gt; [E|W]&lt;float&gt;'</code>, where each float is in
    1.74 +degrees. Note the required white space between the latitude and longitude
    1.75 +components.  Each floating point number may have a sign, in which case <code>N</code>/<code>S</code>
    1.76 +or <code>E</code>/<code>W</code> are switched respectively (e.g. <code>E-5</code> is the same as <code>W5</code>).</p>
    1.77 +
    1.78 +<p>An <code>epoint</code> may also be created from two floating point numbers by calling
    1.79 +<code>epoint(latitude, longitude)</code>, where positive latitudes are used for the
    1.80 +northern hemisphere, negative latitudes are used for the southern hemisphere,
    1.81 +positive longitudes indicate positions east of the prime meridian, and negative
    1.82 +longitudes indicate positions west of the prime meridian.</p>
    1.83 +
    1.84 +<p>Latitudes exceeding -90 or +90 degrees are truncated to -90 or +90
    1.85 +respectively, in which case a warning will be issued. Longitudes exceeding -180
    1.86 +or +180 degrees will be converted to values between -180 and +180 (both
    1.87 +inclusive) by adding or substracting a multiple of 360 degrees, in which case a
    1.88 +notice will be issued.</p>
    1.89 +
    1.90 +<p>If the latitude is -90 or +90 (south pole or north pole), a longitude value is
    1.91 +still stored in the datum, and if a point is on the prime meridian or the
    1.92 +180th meridian, the east/west bit is also stored in the datum. In case of the
    1.93 +prime meridian, this is done by storing a floating point value of -0 for
    1.94 +0 degrees west and a value of +0 for 0 degrees east. In case of the
    1.95 +180th meridian, this is done by storing -180 or +180 respectively. The equality
    1.96 +operator, however, returns true when the same points on earth are described,
    1.97 +i.e. the longitude is ignored for the poles, and 180 degrees west is considered
    1.98 +to be equal to 180 degrees east.</p>
    1.99 +
   1.100 +<h4><code>ebox</code></h4>
   1.101 +
   1.102 +<p>An area on earth demarcated by a southern and northern latitude, and a western
   1.103 +and eastern longitude (all given in WGS-84).</p>
   1.104 +
   1.105 +<p>The text input format is
   1.106 +<code>'{N|S}&lt;float&gt; {E|W}&lt;float&gt; {N|S}&lt;float&gt; {E|W}&lt;float&gt;'</code>, where each float is in
   1.107 +degrees. The ordering of the four white-space separated blocks is not
   1.108 +significant. To include the 180th meridian, one longitude boundary must be
   1.109 +equal to or exceed <code>W180</code> or <code>E180</code>, e.g. <code>'N10 N20 E170 E190'</code>.</p>
   1.110 +
   1.111 +<p>A special value is the empty area, denoted by the text represenation <code>'empty'</code>.
   1.112 +Such an <code>ebox</code> does not contain any point.</p>
   1.113 +
   1.114 +<p>An <code>ebox</code> may also be created from four floating point numbers by calling
   1.115 +<code>ebox(min_latitude, max_latitude, min_longitude, max_longitude)</code>, where
   1.116 +positive values are used for north and east, and negative values are used for
   1.117 +south and west. If <code>min_latitude</code> is strictly greater than <code>max_latitude</code>, an
   1.118 +empty <code>ebox</code> is created. If <code>min_longitude</code> is greater than <code>max_longitude</code> and
   1.119 +if both longitudes are between -180 and +180 degrees, then the area oriented in
   1.120 +such way that the 180th meridian is included.</p>
   1.121 +
   1.122 +<p>If the longitude span is less than 120 degrees, an <code>ebox</code> may be alternatively
   1.123 +created from two <code>epoints</code> in the following way: <code>ebox(epoint(lat1, lon1),
   1.124 +epoint(lat2, lon2))</code>. In this case <code>lat1</code> and <code>lat2</code> as well as <code>lon1</code> and
   1.125 +<code>lon2</code> can be swapped without any impact.</p>
   1.126 +
   1.127 +<h4><code>ecircle</code></h4>
   1.128 +
   1.129 +<p>An area containing all points not farther away from a given center point
   1.130 +(WGS-84) than a given radius.</p>
   1.131 +
   1.132 +<p>The text input format is <code>'{N|S}&lt;float&gt; {E|W}&lt;float&gt; &lt;float&gt;'</code>, where the first
   1.133 +two floats denote the center point in degrees and the third float denotes the
   1.134 +radius in meters. A radius equal to minus infinity denotes an empty circle
   1.135 +which contains no point at all (despite having a center), while a radius equal
   1.136 +to zero denotes a circle that includes a single point.</p>
   1.137 +
   1.138 +<p>An <code>ecircle</code> may also be created by calling <code>ecircle(epoint(...), radius)</code> or
   1.139 +from three floating point numbers by calling <code>ecircle(latitude, longitude,
   1.140 +radius)</code>.</p>
   1.141 +
   1.142 +<h4><code>ecluster</code></h4>
   1.143 +
   1.144 +<p>A collection of points, paths, polygons, and outlines on the WGS-84 spheroid.
   1.145 +Each path, polygon, or outline must cover a longitude range of less than
   1.146 +180 degrees to avoid ambiguities.</p>
   1.147 +
   1.148 +<p>The text input format is a white-space separated list of the following items:</p>
   1.149 +
   1.150 +<ul>
   1.151 +<li><code>point   ({N|S}&lt;float&gt; {E|W}&lt;float&gt;)</code></li>
   1.152 +<li><code>path    ({N|S}&lt;float&gt; {E|W}&lt;float&gt; {N|S}&lt;float&gt; {E|W}&lt;float&gt; ...)</code></li>
   1.153 +<li><code>outline ({N|S}&lt;float&gt; {E|W}&lt;float&gt; {N|S}&lt;float&gt; {E|W}&lt;float&gt; {N|S}&lt;float&gt; {E|W}&lt;float&gt; ...)</code></li>
   1.154 +<li><code>polygon ({N|S}&lt;float&gt; {E|W}&lt;float&gt; {N|S}&lt;float&gt; {E|W}&lt;float&gt; {N|S}&lt;float&gt; {E|W}&lt;float&gt; ...)</code></li>
   1.155 +</ul>
   1.156 +
   1.157 +<p>Paths are open by default (i.e. there is no connection from the last point in
   1.158 +the list to the first point in the list). Outlines and polygons, in contrast,
   1.159 +are automatically closed (i.e. there is a line segment from the last point in
   1.160 +the list to the first point in the list) which means the first point should not
   1.161 +be repeated as last point in the list. Polygons are filled, outlines are not.</p>
   1.162 +
   1.163 +<h3>2. Indices</h3>
   1.164 +
   1.165 +<p>Two kinds of indices are supported: B-tree and GiST indices.</p>
   1.166 +
   1.167 +<h4>B-tree indicies</h4>
   1.168 +
   1.169 +<p>A B-tree index can be used for simple equality searches and is supported by the
   1.170 +<code>epoint</code>, <code>ebox</code>, and <code>ecircle</code> data types. B-tree indices can not be used for
   1.171 +geographic searches.</p>
   1.172 +
   1.173 +<h4>GiST indicies</h4>
   1.174 +
   1.175 +<p>For geographic searches, GiST indices must be used. The <code>epoint</code>, <code>ecircle</code>,
   1.176 +and <code>ecluster</code> data types support GiST indexing. A GiST index for geographic
   1.177 +searches can be created as follows:</p>
   1.178 +
   1.179 +<pre><code>CREATE TABLE tbl (
   1.180 +        id              serial4         PRIMARY KEY,
   1.181 +        loc             epoint          NOT NULL );
   1.182 +
   1.183 +CREATE INDEX name_of_index ON tbl USING gist (loc);
   1.184 +</code></pre>
   1.185 +
   1.186 +<p>GiST indicies also support nearest neighbor searches when using the distance
   1.187 +operator (<code>&lt;-&gt;</code>) in the ORDER BY clause.</p>
   1.188 +
   1.189 +<h4>Indicies on other data types (e.g. GeoJSON)</h4>
   1.190 +
   1.191 +<p>Note that further types can be indexed by using an index on an expression with
   1.192 +a conversion function. One conversion function provided by pgLatLon is the
   1.193 +<code>GeoJSON_to_ecluster(float8, float8, text)</code> function:</p>
   1.194 +
   1.195 +<pre><code>CREATE TABLE tbl (
   1.196 +        id              serial4         PRIMARY KEY,
   1.197 +        loc             jsonb           NOT NULL );
   1.198 +
   1.199 +CREATE INDEX name_of_index ON tbl USING gist((GeoJSON_to_ecluster("loc")));
   1.200 +</code></pre>
   1.201 +
   1.202 +<p>When using the conversion function in an expression, the index will be used
   1.203 +automatically:</p>
   1.204 +
   1.205 +<pre><code>SELECT * FROM tbl WHERE GeoJSON_to_ecluster("loc") &amp;&amp; 'N50 E10 10000'::ecircle;
   1.206 +</code></pre>
   1.207 +
   1.208 +<h3>3. Operators</h3>
   1.209 +
   1.210 +<h4>Equality operator <code>=</code></h4>
   1.211 +
   1.212 +<p>Tests if two geographic objects are equal.</p>
   1.213 +
   1.214 +<p>The longitude is ignored for the poles, and 180 degrees west is considered to
   1.215 +be equal to 180 degrees east.</p>
   1.216 +
   1.217 +<p>For boxes and circles, two empty objects are considered equal. (Note that a
   1.218 +circle is not empty if the radius is zero but only if it is negative infinity,
   1.219 +i.e. smaller than zero.) Two circles with a positive infinite radius are also
   1.220 +considered equal.</p>
   1.221 +
   1.222 +<p>Implemented for:</p>
   1.223 +
   1.224 +<ul>
   1.225 +<li><code>epoint = epoint</code></li>
   1.226 +<li><code>ebox = ebox</code></li>
   1.227 +<li><code>ecircle = ecircle</code></li>
   1.228 +</ul>
   1.229 +
   1.230 +<p>The negation is the inequality operator (<code>&lt;&gt;</code> or <code>!=</code>).</p>
   1.231 +
   1.232 +<h4>Linear ordering operators <code>&lt;&lt;&lt;</code>, <code>&lt;&lt;&lt;=</code>, <code>&gt;&gt;&gt;=</code>, <code>&gt;&gt;&gt;</code></h4>
   1.233 +
   1.234 +<p>These operators create an arbitrary (but well-defined) linear ordering of
   1.235 +geographic objects, which is used internally for B-tree indexing and merge
   1.236 +joins. These operators will usually not be used by an application programmer.</p>
   1.237 +
   1.238 +<h4>Overlap operator <code>&amp;&amp;</code></h4>
   1.239 +
   1.240 +<p>Tests if two geographic objects have at least one point in common. Currently
   1.241 +implemented for:</p>
   1.242 +
   1.243 +<ul>
   1.244 +<li><code>epoint &amp;&amp; ebox</code></li>
   1.245 +<li><code>epoint &amp;&amp; ecircle</code></li>
   1.246 +<li><code>epoint &amp;&amp; ecluster</code></li>
   1.247 +<li><code>ebox &amp;&amp; ebox</code></li>
   1.248 +<li><code>ecircle &amp;&amp; ecircle</code></li>
   1.249 +<li><code>ecircle &amp;&amp; ecluster</code></li>
   1.250 +</ul>
   1.251 +
   1.252 +<p>The <code>&amp;&amp;</code> operator is commutative, i.e. <code>a &amp;&amp; b</code> is the same as <code>b &amp;&amp; a</code>. Each
   1.253 +commutation is supported as well.</p>
   1.254 +
   1.255 +<h4>Distance operator <code>&lt;-&gt;</code></h4>
   1.256 +
   1.257 +<p>Calculates the shortest distance between two geographic objects in meters (zero
   1.258 +if the objects are overlapping). Currently implemented for:</p>
   1.259 +
   1.260 +<ul>
   1.261 +<li><code>epoint &lt;-&gt; epoint</code></li>
   1.262 +<li><code>epoint &lt;-&gt; ecircle</code></li>
   1.263 +<li><code>epoint &lt;-&gt; ecluster</code></li>
   1.264 +<li><code>ecircle &lt;-&gt; ecircle</code></li>
   1.265 +<li><code>ecircle &lt;-&gt; ecluster</code></li>
   1.266 +</ul>
   1.267 +
   1.268 +<p>The <code>&lt;-&gt;</code> operator is commutative, i.e. <code>a &lt;-&gt; b</code> is the same as <code>b &lt;-&gt; a</code>.
   1.269 +Each commutation is supported as well.</p>
   1.270 +
   1.271 +<p>For short distances, the result is very accurate (i.e. respects the dimensions
   1.272 +of the WGS-84 spheroid). For longer distances in the order of magnitude of
   1.273 +earth's radius or greater, the value is only approximate (but the error is
   1.274 +still less than 0.2% as long as no polygons with very long edges are involved).</p>
   1.275 +
   1.276 +<p>The functions <code>distance(epoint, epoint)</code> and <code>distance(ecluster, epoint)</code> can
   1.277 +be used as an alias for this operator.</p>
   1.278 +
   1.279 +<p>Note: In case of radial searches with a fixed radius, this operator should
   1.280 +not be used. Instead, an <code>ecircle</code> should be created and used in combination
   1.281 +with the overlap operator (<code>&amp;&amp;</code>). Alternatively, the functions
   1.282 +<code>distance_within(epoint, epoint, float8)</code> or <code>distance_within(ecluster, epoint,
   1.283 +float8)</code> can be used for fixed-radius searches.</p>
   1.284 +
   1.285 +<h3>4. Functions</h3>
   1.286 +
   1.287 +<h4><code>center(circle)</code></h4>
   1.288 +
   1.289 +<p>Returns the center of an <code>ecircle</code> as an <code>epoint</code>.</p>
   1.290 +
   1.291 +<h4><code>distance(epoint, epoint)</code></h4>
   1.292 +
   1.293 +<p>Calculates the distance between two <code>epoint</code> datums in meters. This function is
   1.294 +an alias for the distance operator <code>&lt;-&gt;</code>.</p>
   1.295 +
   1.296 +<p>Note: In case of radial searches with a fixed radius, this function should not be
   1.297 +used. Use <code>distance_within(epoint, epoint, float8)</code> instead.</p>
   1.298 +
   1.299 +<h4><code>distance(ecluster, epoint)</code></h4>
   1.300 +
   1.301 +<p>Calculates the distance from an <code>ecluster</code> to an <code>epoint</code> in meters. This
   1.302 +function is an alias for the distance operator <code>&lt;-&gt;</code>.</p>
   1.303 +
   1.304 +<p>Note: In case of radial searches with a fixed radius, this function should not be
   1.305 +used. Use <code>distance_within(epoint, epoint, float8)</code> instead.</p>
   1.306 +
   1.307 +<h4><code>distance_within(</code>variable <code>epoint,</code> fixed <code>epoint,</code> radius <code>float8)</code></h4>
   1.308 +
   1.309 +<p>Checks if the distance between two <code>epoint</code> datums is not greater than a given
   1.310 +value (search radius).</p>
   1.311 +
   1.312 +<p>Note: In case of radial searches with a fixed radius, the first argument must
   1.313 +be used for the table column, while the second argument must be used for the
   1.314 +search center. Otherwise an existing index cannot be used.</p>
   1.315 +
   1.316 +<h4><code>distance_within(</code>variable <code>ecluster,</code> fixed <code>epoint,</code> radius <code>float8)</code></h4>
   1.317 +
   1.318 +<p>Checks if the distance from an <code>ecluster</code> to an <code>epoint</code> is not greater than a
   1.319 +given value (search radius).</p>
   1.320 +
   1.321 +<h4><code>ebox(</code>latmin <code>float8,</code> latmax <code>float8,</code> lonmin <code>float8,</code> lonmax <code>float8)</code></h4>
   1.322 +
   1.323 +<p>Creates a new <code>ebox</code> with the given boundaries.
   1.324 +See "1. Types", subsection <code>ebox</code> for details.</p>
   1.325 +
   1.326 +<h4><code>ebox(epoint, epoint)</code></h4>
   1.327 +
   1.328 +<p>Creates a new <code>ebox</code>. This function may only be used if the longitude
   1.329 +difference is less than or equal to 120 degrees.
   1.330 +See "1. Types", subsection <code>ebox</code> for details.</p>
   1.331 +
   1.332 +<h4><code>ecircle(epoint, float8)</code></h4>
   1.333 +
   1.334 +<p>Creates an <code>ecircle</code> with the given center point and radius.</p>
   1.335 +
   1.336 +<h4><code>ecircle(</code>latitude <code>float8,</code> longitude <code>float8,</code> radius <code>float8)</code></h4>
   1.337 +
   1.338 +<p>Creates an <code>ecircle</code> with the given center point and radius.</p>
   1.339 +
   1.340 +<h4><code>ecluster_concat(ecluster, ecluster)</code></h4>
   1.341 +
   1.342 +<p>Combines two clusters to form a new <code>ecluster</code> by uniting all entries of both
   1.343 +clusters. Note that two overlapping areas of polygons annihilate each other
   1.344 +(which may be used to create polygons with holes).</p>
   1.345 +
   1.346 +<h4><code>ecluster_concat(ecluster[])</code></h4>
   1.347 +
   1.348 +<p>Creates a new <code>ecluster</code> that unites all entries of all clusters in the passed
   1.349 +array. Note that two overlapping areas of polygons annihilate each other (which
   1.350 +may be used to create polygons with holes).</p>
   1.351 +
   1.352 +<h4><code>ecluster_create_multipoint(epoint[])</code></h4>
   1.353 +
   1.354 +<p>Creates a new <code>ecluster</code> which contains multiple points.</p>
   1.355 +
   1.356 +<h4><code>ecluster_create_outline(epoint[])</code></h4>
   1.357 +
   1.358 +<p>Creates a new <code>ecluster</code> that is an outline given by the passed points.</p>
   1.359 +
   1.360 +<h4><code>ecluster_create_path(epoint[])</code></h4>
   1.361 +
   1.362 +<p>Creates a new <code>ecluster</code> that is a path given by the passed points.</p>
   1.363 +
   1.364 +<h4><code>ecluster_create_polygon(epoint[])</code></h4>
   1.365 +
   1.366 +<p>Creates a new <code>ecluster</code> that is a polygon given by the passed points.</p>
   1.367 +
   1.368 +<h4><code>ecluster_extract_outlines(ecluster)</code></h4>
   1.369 +
   1.370 +<p>Set-returning function that returns the outlines of an <code>ecluster</code> as <code>epoint[]</code>
   1.371 +rows.</p>
   1.372 +
   1.373 +<h4><code>ecluster_extract_paths(ecluster)</code></h4>
   1.374 +
   1.375 +<p>Set-returning function that returns the paths of an <code>ecluster</code> as <code>epoint[]</code>
   1.376 +rows.</p>
   1.377 +
   1.378 +<h4><code>ecluster_extract_points(ecluster)</code></h4>
   1.379 +
   1.380 +<p>Set-returning function that returns the points of an <code>ecluster</code> as <code>epoint</code>
   1.381 +rows.</p>
   1.382 +
   1.383 +<h4><code>ecluster_extract_polygons(ecluster)</code></h4>
   1.384 +
   1.385 +<p>Set-returning function that returns the polygons of an <code>ecluster</code> as <code>epoint[]</code>
   1.386 +rows.</p>
   1.387 +
   1.388 +<h4><code>empty_ebox</code>()</h4>
   1.389 +
   1.390 +<p>Returns the empty <code>ebox</code>.
   1.391 +See "1. Types", subsection <code>ebox</code> for details.</p>
   1.392 +
   1.393 +<h4><code>epoint(</code>latitude <code>float8,</code> longitude <code>float8)</code></h4>
   1.394 +
   1.395 +<p>Returns an <code>epoint</code> with the given latitude and longitude.</p>
   1.396 +
   1.397 +<h4><code>epoint_latlon(</code>latitude <code>float8,</code> longitude <code>float8)</code></h4>
   1.398 +
   1.399 +<p>Alias for <code>epoint(float8, float8)</code>.</p>
   1.400 +
   1.401 +<h4><code>epoint_lonlat(</code>longitude <code>float8,</code> latitude <code>float8)</code></h4>
   1.402 +
   1.403 +<p>Same as <code>epoint(float8, float8)</code> but with arguments reversed.</p>
   1.404 +
   1.405 +<h4><code>GeoJSON_to_epoint(jsonb, text)</code></h4>
   1.406 +
   1.407 +<p>Maps a GeoJSON object of type "Point" or "Feature" (which contains a
   1.408 +"Point") to an <code>epoint</code> datum. For any other JSON objects, NULL is returned.</p>
   1.409 +
   1.410 +<p>The second parameter (which defaults to <code>epoint_lonlat</code>) may be set to a name
   1.411 +of a conversion function that transforms two coordinates (two <code>float8</code>
   1.412 +parameters) to an <code>epoint</code>.</p>
   1.413 +
   1.414 +<h4><code>GeoJSON_to_ecluster(jsonb, text)</code></h4>
   1.415 +
   1.416 +<p>Maps a (valid) GeoJSON object to an <code>ecluster</code>. Note that this function
   1.417 +does not check whether the JSONB object is a valid GeoJSON object.</p>
   1.418 +
   1.419 +<p>The second parameter (which defaults to <code>epoint_lonlat</code>) may be set to a name
   1.420 +of a conversion function that transforms two coordinates (two <code>float8</code>
   1.421 +parameters) to an <code>epoint</code>.</p>
   1.422 +
   1.423 +<h4><code>max_latitude(ebox)</code></h4>
   1.424 +
   1.425 +<p>Returns the northern boundary of a given <code>ebox</code> in degrees between -90 and +90.</p>
   1.426 +
   1.427 +<h4><code>max_longitude(ebox)</code></h4>
   1.428 +
   1.429 +<p>Returns the eastern boundary of a given <code>ebox</code> in degrees between -180 and +180
   1.430 +(both inclusive).</p>
   1.431 +
   1.432 +<h4><code>min_latitude(ebox)</code></h4>
   1.433 +
   1.434 +<p>Returns the southern boundary of a given <code>ebox</code> in degrees between -90 and +90.</p>
   1.435 +
   1.436 +<h4><code>min_longitude(ebox)</code></h4>
   1.437 +
   1.438 +<p>Returns the western boundary of a given <code>ebox</code> in degrees between -180 and +180
   1.439 +(both inclusive).</p>
   1.440 +
   1.441 +<h4><code>latitude(epoint)</code></h4>
   1.442 +
   1.443 +<p>Returns the latitude value of an <code>epoint</code> in degrees between -90 and +90.</p>
   1.444 +
   1.445 +<h4><code>longitude(epoint)</code></h4>
   1.446 +
   1.447 +<p>Returns the longitude value of an <code>epoint</code> in degrees between -180 and +180
   1.448 +(both inclusive).</p>
   1.449 +
   1.450 +<h4><code>radius(ecircle)</code></h4>
   1.451 +
   1.452 +<p>Returns the radius of an <code>ecircle</code> in meters.</p>
   1.453 +</body></html>

Impressum / About Us