public inbox for [email protected]  
help / color / mirror / Atom feed
From: Roxanne Reid-Bennett <[email protected]>
To: [email protected] <[email protected]>
Subject: Re: How to create a View of geometry type equals point?
Date: Fri, 14 Jun 2024 06:38:13 +0000
Message-ID: <010101901577d451-de668c7c-368a-42a8-b423-f41e080513d8-000000@us-west-2.amazonses.com> (raw)
In-Reply-To: <CAKyoTgYyrrDCUL=G5DoiWByS9cO3uCBVHZa6CvotwYhvHq_BVQ@mail.gmail.com>
References: <CAKyoTgYyrrDCUL=G5DoiWByS9cO3uCBVHZa6CvotwYhvHq_BVQ@mail.gmail.com>
	<[email protected]>

Create view polys as
Select * from <table> where ST_GeometryType(<geom>) = ‘ST_Polygon’;

Returns ST_Linestring, ST_Polygon, etc.

ST_GeometryType
postgis.net
	

There is also GeometryType 
GeometryType
postgis.net
	


Roxanne

On Jun 13, 2024, at 9:36 PM, Sándor Daku <[email protected]> wrote:


Hello Nicholas,
I want to create a View within PostGIS that filters only those records that have Geometry type equal to Point

(and also another view of geometry type equal to Polygon)

What SELECT statement achieves this?


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: ...where ST_Dimension(geometry_field) = 0


Regards,

Sándor



view thread (3+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: How to create a View of geometry type equals point?
  In-Reply-To: <010101901577d451-de668c7c-368a-42a8-b423-f41e080513d8-000000@us-west-2.amazonses.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox