Re: How to create a View of geometry type equals point? - Mailing list pgsql-novice

From Roxanne Reid-Bennett
Subject Re: How to create a View of geometry type equals point?
Date
Msg-id 010101901577d451-de668c7c-368a-42a8-b423-f41e080513d8-000000@us-west-2.amazonses.com
Whole thread Raw
In response to Re: How to create a View of geometry type equals point?  (Sándor Daku <daku.sandor@gmail.com>)
List pgsql-novice

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

Returns ST_Linestring, ST_Polygon, etc.

There is also GeometryType 

Roxanne

On Jun 13, 2024, at 9:36 PM, Sándor Daku <daku.sandor@gmail.com> 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

pgsql-novice by date:

Previous
From: Sándor Daku
Date:
Subject: Re: How to create a View of geometry type equals point?
Next
From: Simon Connah
Date:
Subject: Database migrations