Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sI0Zp-00C9M0-6U for pgsql-novice@arkaria.postgresql.org; Fri, 14 Jun 2024 06:38:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sI0Zm-00E6a3-L3 for pgsql-novice@arkaria.postgresql.org; Fri, 14 Jun 2024 06:38:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <010101901577d451-de668c7c-368a-42a8-b423-f41e080513d8-000000@us-west-2.amazonses.com>) id 1sI0Zm-00E6Zu-5N for pgsql-novice@lists.postgresql.org; Fri, 14 Jun 2024 06:38:19 +0000 Received: from a27-231.smtp-out.us-west-2.amazonses.com ([54.240.27.231]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (Exim 4.94.2) (envelope-from <010101901577d451-de668c7c-368a-42a8-b423-f41e080513d8-000000@us-west-2.amazonses.com>) id 1sI0Zj-001ad1-Jt for pgsql-novice@lists.postgresql.org; Fri, 14 Jun 2024 06:38:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=v3x46bqtum57lepjufrjnqnkbmdty2le; d=tara-lu.com; t=1718347093; h=Subject:From:To:Date:Mime-Version:Content-Type:In-Reply-To:References:Message-Id; bh=F8jnJsX+athWu93MMe2z3iAzfVatRSIgNf/CWsk1q+I=; b=F1aOrZ3vOhJuPeNEoC3G60FA4u9Fs1HkMjzpwh9lpRaHRWxIiFVFtMQfYMNZAh+e RU4i52aNPdFctmkhfkK0jiI1L9OupJnGF6+pfzUGZFyZTpf659uJdf+o4gRMrryUSax 8GI4+qxzOgj3kuAII3HZQqnYAZF+Z95MYhzoReQw= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=7v7vs6w47njt4pimodk5mmttbegzsi6n; d=amazonses.com; t=1718347093; h=Subject:From:To:Date:Mime-Version:Content-Type:In-Reply-To:References:Message-Id:Feedback-ID; bh=F8jnJsX+athWu93MMe2z3iAzfVatRSIgNf/CWsk1q+I=; b=rEiYgL5VX5riAUpCBE2ZDRP8OaHUK33e7gb+H0qD/ypTirlFMPMv6SM//8akwl62 kYt8Dtk7rC0zpKvK1L/g8aYulqJowbaSshHQcFYPq6p/oeZGzRqt8CtcYWmcXj39A+F wns9vswGcfVnA5eVHHjmSyC1PGaiwbuR2RJp7Up0= Subject: Re: How to create a View of geometry type equals point? From: =?UTF-8?Q?Roxanne_Reid-Bennett?= To: =?UTF-8?Q?pgsql-novice=40lists=2Epostgresql=2Eorg?= Date: Fri, 14 Jun 2024 06:38:13 +0000 Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=_kl-qBMaDA4rWZ9brcOyelJFgPB-U5QTY4ddBslxK4I4QsefX" In-Reply-To: References: <9981CB47-9829-4B9C-9F97-B625568CA988@tara-lu.com> X-Mailer: Amazon WorkMail Thread-Index: Adq+Dc1lJlUV6naKTkGZVqoxlUsgW7lgjjFTuWCwEIY= Thread-Topic: How to create a View of geometry type equals point? X-Original-Mailer: iPhone Mail (21F90) X-Wm-Sent-Timestamp: 1718347092 Message-ID: <010101901577d451-de668c7c-368a-42a8-b423-f41e080513d8-000000@us-west-2.amazonses.com> Feedback-ID: ::1.us-west-2.An468LAV0jCjQDrDLvlZjeAthld7qrhZr+vow8irkvU=:AmazonSES X-SES-Outgoing: 2024.06.14-54.240.27.231 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. Your mail reader does not understand MIME message format. --=_kl-qBMaDA4rWZ9brcOyelJFgPB-U5QTY4ddBslxK4I4QsefX Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Create view polys as Select * from where ST_GeometryType() =3D =E2=80=98ST_Polyg= on=E2=80=99; Returns ST_Linestring, ST_Polygon, etc. ST_GeometryType postgis.net =09 There is also GeometryType=C2=A0 GeometryType postgis.net =09 Roxanne On Jun 13, 2024, at 9:36=E2=80=AFPM, S=C3=A1ndor Daku wrote: =EF=BB=BF Hello Nicholas, I want to create a View within PostGIS that filters only those records th= at have Geometry type equal to Point (and also another view of geometry type equal to Polygon) What SELECT statement achieves this=3F I'm not familiar with PostGIS, but based on a quick glance at the docs I = think the ST_Dimension function is what you need. Something like: ...wher= e ST_Dimension(geometry_field) =3D 0 Regards, S=C3=A1ndor --=_kl-qBMaDA4rWZ9brcOyelJFgPB-U5QTY4ddBslxK4I4QsefX Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

Create view pol= ys as
Select * from <table> where ST_GeometryType(<geom>= ) =3D =E2=80=98ST_Polygon=E2=80=99;

Returns ST_Linestr= ing, ST_Polygon, etc.

<= /table>
There is also GeometryType 
=

Roxann= e

On Jun 13, 2024, at 9:36=E2=80=AFPM, S=C3=A1ndor Daku &= lt;daku.sandor@gmail.com> wrote:

=EF=BB=BF
Hello Nicholas= ,

I want to create a View within PostGIS that filter= s only those records that have Geometry type equal to Point=

(and also another view of geometry type equal to P= olygon)

What SELECT statement achieves this=3F


I'm = not familiar with PostGIS, but based on a quick glance at the docs I thin= k the ST_Dimension function is what you need. Something like: ...where ST= _Dimension(geometry_field) =3D 0


Regards,
S=C3=A1ndor

<= div>
--=_kl-qBMaDA4rWZ9brcOyelJFgPB-U5QTY4ddBslxK4I4QsefX--