<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Looking for some insight into why this is happening (2 examples
below).<br>
</p>
<p>For Postgresql 10:<br>
</p>
<blockquote>
<p><font size="4" face="monospace">psql gsw<br>
psql (14.6 (Ubuntu 14.6-1.pgdg20.04+1), server 10.23 (Ubuntu
10.23-1.pgdg20.04+1))<br>
Type "help" for help.<br>
<br>
gsw=# \dx<br>
List of installed
extensions<br>
Name | Version | Schema
|
Description <br>
------------------+---------+------------+---------------------------------------------------------------------<br>
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural
language<br>
postgis | 3.2.1 | public | PostGIS geometry,
geography, and raster spatial types and functions<br>
postgis_raster | 3.2.1 | public | PostGIS raster
types and functions<br>
postgis_topology | 3.2.1 | topology | PostGIS topology
spatial types and functions<br>
postgres_fdw | 1.0 | public | foreign-data
wrapper for remote PostgreSQL servers<br>
tablefunc | 1.0 | public | functions that
manipulate whole tables, including crosstab<br>
uuid-ossp | 1.0 | public | generate
universally unique identifiers (UUIDs)<br>
(7 rows)<br>
<br>
gsw=# \d Phenomena_v<br>
View "public.phenomena_v"<br>
Column | Type | Collation |
Nullable | Default <br>
----------------------+--------------------------+-----------+----------+---------<br>
id_pk | bigint |
| | <br>
meta_data_fk | bigint |
| | <br>
station_id | character varying(256) |
| | <br>
sensor_id | character varying(256) |
| | <br>
acquisition_time | timestamp with time zone |
| | <br>
acquisition_duration | bigint |
| | <br>
acquisition_period | bigint |
| | <br>
point | geometry(Point,4326) |
| | <br>
latitude | double precision |
| | <br>
longitude | double precision |
| | <br>
altitude | double precision |
| | <br>
dimension_id | character varying(256) |
| | <br>
quantity | character varying(255) |
| | <br>
units_id | character varying(256) |
| | <br>
created | timestamp with time zone |
| | <br>
modified | timestamp with time zone |
| | <br>
<br>
gsw=# SELECT P.latitude, P.longitude, P.altitude,
ST_AsText(P.point) FROM Phenomena_v AS P<br>
gsw-# WHERE<br>
gsw-# P.acquisition_time >=
'2023-01-08T20:14:43-0700'<br>
gsw-# AND P.acquisition_time <=
'2023-01-09T20:14:43-0700'<br>
gsw-# AND ST_Within(ST_Transform(P.Point, 4326),
ST_GeomFromText('POLYGON((34.67010 -119.53618,<br>
gsw'#
34.67010 -116.02055,<br>
gsw'#
32.72798 -116.02055,<br>
gsw'#
32.72798 -119.53618,<br>
gsw'#
34.67010 -119.53618))',4326))<br>
gsw-#
= '1';<br>
ERROR: Unknown geometry type: 1025 - Point<br>
CONTEXT: parallel worker<br>
gsw=#</font><font size="4"> </font></p>
</blockquote>
<p>Postgres 14 (There are points inside the polygon):</p>
<blockquote><font size="4" face="monospace">psql gsw</font><br>
<font size="4" face="monospace">psql (14.6 (Ubuntu
14.6-1.pgdg22.04+1))</font><br>
<font size="4" face="monospace">Type "help" for help.</font><br>
<br>
<font size="4" face="monospace">gsw=# \dx</font><br>
<font size="4" face="monospace">
List of installed extensions</font><br>
<font size="4" face="monospace"> Name | Version |
Schema |
Description </font><br>
<font size="4" face="monospace">------------------+---------+------------+---------------------------------------------------------------------</font><br>
<font size="4" face="monospace"> adminpack | 2.1 |
pg_catalog | administrative functions for PostgreSQL</font><br>
<font size="4" face="monospace"> pg_freespacemap | 1.2 |
public | examine the free space map (FSM)</font><br>
<font size="4" face="monospace"> pgstattuple | 1.5 |
public | show tuple-level statistics</font><br>
<font size="4" face="monospace"> plpgsql | 1.0 |
pg_catalog | PL/pgSQL procedural language</font><br>
<font size="4" face="monospace"> postgis | 3.2.1 |
public | PostGIS geometry, geography, and raster spatial
types and functions</font><br>
<font size="4" face="monospace"> postgis_raster | 3.2.1 |
public | PostGIS raster types and functions</font><br>
<font size="4" face="monospace"> postgis_topology | 3.2.1 |
topology | PostGIS topology spatial types and functions</font><br>
<font size="4" face="monospace"> postgres_fdw | 1.1 |
public | foreign-data wrapper for remote PostgreSQL servers</font><br>
<font size="4" face="monospace">(8 rows)</font><br>
<br>
<font size="4" face="monospace">gsw=# \d Phenomena_v</font><br>
<font size="4" face="monospace"> View
"public.phenomena_v"</font><br>
<font size="4" face="monospace"> Column |
Type | Collation | Nullable | Default </font><br>
<font size="4" face="monospace">----------------------+--------------------------+-----------+----------+---------</font><br>
<font size="4" face="monospace"> id_pk |
bigint | | | </font><br>
<font size="4" face="monospace"> meta_data_fk |
bigint | | | </font><br>
<font size="4" face="monospace"> station_id | character
varying(256) | | | </font><br>
<font size="4" face="monospace"> sensor_id | character
varying(256) | | | </font><br>
<font size="4" face="monospace"> acquisition_time | timestamp
with time zone | | | </font><br>
<font size="4" face="monospace"> acquisition_duration |
bigint | | | </font><br>
<font size="4" face="monospace"> acquisition_period |
bigint | | | </font><br>
<font size="4" face="monospace"> point |
geometry(Point,4326) | | | </font><br>
<font size="4" face="monospace"> latitude | double
precision | | | </font><br>
<font size="4" face="monospace"> longitude | double
precision | | | </font><br>
<font size="4" face="monospace"> altitude | double
precision | | | </font><br>
<font size="4" face="monospace"> dimension_id | character
varying(256) | | | </font><br>
<font size="4" face="monospace"> quantity | character
varying(255) | | | </font><br>
<font size="4" face="monospace"> units_id | character
varying(256) | | | </font><br>
<font size="4" face="monospace"> created | timestamp
with time zone | | | </font><br>
<font size="4" face="monospace"> modified | timestamp
with time zone | | | </font><br>
<br>
<font size="4" face="monospace">gsw=# SELECT P.latitude,
P.longitude, P.altitude, ST_AsText(P.point) FROM Phenomena_v AS
P</font><br>
<font size="4" face="monospace">WHERE</font><br>
<font size="4" face="monospace"> P.acquisition_time >=
'2023-01-08T20:14:43-0700'</font><br>
<font size="4" face="monospace"> AND P.acquisition_time
<= '2023-01-09T20:14:43-0700'</font><br>
<font size="4" face="monospace"> AND
ST_Within(ST_Transform(P.Point, 4326),
ST_GeomFromText('POLYGON((34.67010 -119.53618,</font><br>
<font size="4" face="monospace">
34.67010 -116.02055,</font><br>
<font size="4" face="monospace">
32.72798 -116.02055,</font><br>
<font size="4" face="monospace">
32.72798 -119.53618,</font><br>
<font size="4" face="monospace">
34.67010 -119.53618))',4326))</font><br>
<font size="4" face="monospace">
= '1';</font><br>
<font size="4" face="monospace"> latitude | longitude | altitude |
st_astext </font><br>
<font size="4" face="monospace">----------+-----------+----------+-----------</font><br>
<font size="4" face="monospace">(0 rows)</font><br>
<br>
<font size="4" face="monospace">gsw=# </font></blockquote>
<p>Thanks in advance.</p>
<p>--J</p>
<p><br>
</p>
</body>
</html>