[postgis-users] Casting a view

Nahum Castro nahumcastro at gmail.com
Fri May 25 12:42:54 PDT 2018

Hello all.

Can you help me on the next:

I can create a materialized view like this to extract data from other
tables within a polygon,

create materialized view vm_adoquin as
select adoquin.gid,adoquin.id,adoquin.control,st_intersection(adoquin.geom,
pol.geom) as geom
from  adoquin, municipio pol
where pol.municipio = 23
and adoquin.geom && pol.geom
and ST_IsEmpty(ST_Intersection(adoquin.geom, pol.geom)) != TRUE;

the resulting materialized view has geom type GEOMETRY but I need the geom

How I can cast the view if I know that
geometrytype(st_intersection(autopista.geom, pol.geom))=LINESTRING

but can't use

pol.geom)), 32614) to cast because can't use functions in type conversions.

Thanks in advance.

*Nahum Castro González*
Blvd. Perdigón 214, Brisas del Lago.
CP 37207
León, Guanajuato, México
Tel (477)1950304
Cel (477)1274694
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20180525/36cb5dc0/attachment.html>

More information about the postgis-users mailing list