First, thanks for the quick reply, which works like a champ!<div><br></div><div>I apologize for the RTFM-able question in the first place.  I was obviously confused, as the "mbr" column (which I now understand to be the minimum bounding rectangle) was the only geometry column for the topology faces.  I also assumed qgis (which I am using) was correct in showing the faces as quads.  Whoops.</div>
<div><br></div><div>So this brings me to my next question - is there some canonical, best-practices sort of way I can get a geometry column (as I currently have for for not only the topology nodes and faces, but for other GIS data in the database) that qgis and I will treat correctly?  Should I define some sort of view on the faces table and use (for both qgis and my own stuff) that layer instead?</div>
<div><br></div><div>Thanks again!</div><div><br></div><div>-jm<br><br><div class="gmail_quote">On Tue, Dec 4, 2012 at 5:12 AM, Sandro Santilli <span dir="ltr"><<a href="mailto:strk@keybit.net" target="_blank">strk@keybit.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If I've understood correctly you're complaining that the faces do not<br>
get the Z value ? But you're querying the minimum bounding rectangle,<br>
not the face geometry.<br>
<br>
Try this:<br>
<br>
=# select st_astext(st_getfacegeometry('ma_topo', face_id))<br>
   from ma_topo.face where face_id > 0;<br>
               st_astext<br>
---------------------------------------<br>
 POLYGON Z ((2 2 2,4 2 2,3 1 9,2 2 2))<br>
(1 row)<br>
<br>
--strk;<br>
<div><div class="h5"><br>
On Mon, Dec 03, 2012 at 02:39:06PM -0500, John Morrison wrote:<br>
> Hi;<br>
><br>
> Sorry if this is a dumb newbie question.  I am trying to build a topology<br>
> trimesh (in what to me is the obvious way) from an unreasonably large SRTM<br>
> raster.  I can get the nodes and edges into the database, but the<br>
> Polygonize function doesn't create the expected triangles (two per raster<br>
> pixel), but instead creates a single square.<br>
><br>
> I tried to produce an SQL file which highlights the behavior (which, for<br>
> all I know, is fully expected).  Please find attached two such files.  I<br>
> did read the source to the Polygonize function, and when I call<br>
> st_polygonize on the edge_data column (as it does), I get back the expected<br>
> triangle with Z value...<br>
><br>
> Here's test01.sql (in case it doesn't survive the MTAs), in which I<br>
> simplified away use of 3D coords and SRID:<br>
><br>
> SELECT CreateTopology('ma_topo'); -- No Z<br>
> SELECT AddEdge('ma_topo', ST_GeomFromText('LINESTRING(2 2, 4 2)'));<br>
> SELECT AddEdge('ma_topo', ST_GeomFromText('LINESTRING(4 2, 3 1)'));<br>
> SELECT AddEdge('ma_topo', ST_GeomFromText('LINESTRING(3 1, 2 2)'));<br>
> SELECT Polygonize('ma_topo');<br>
> -- Correctly shows a single triangle in the Topology<br>
> SELECT St_AsText(foo.geom) FROM (SELECT (st_dump(st_polygonize(geom))).geom<br>
> FROM ma_topo.edge_data) as foo;<br>
> SELECT ST_AsText(mbr) FROM ma_topo.face;<br>
><br>
> Here's test00.sql, which exhibits the same quad/tri behavior, but<br>
> additionally is missing the Z value...<br>
><br>
> SELECT CreateTopology('ma_topo', 4326, 0, true); -- Has Z<br>
> SELECT AddEdge('ma_topo', ST_GeomFromText('SRID=4326;LINESTRINGZ(2 2 2, 4 2<br>
> 2)'));<br>
> SELECT AddEdge('ma_topo', ST_GeomFromText('SRID=4326;LINESTRINGZ(4 2 2, 3 1<br>
> 9)'));<br>
> SELECT AddEdge('ma_topo', ST_GeomFromText('SRID=4326;LINESTRINGZ(3 1 9, 2 2<br>
> 2)'));<br>
> SELECT Polygonize('ma_topo');<br>
> -- Correctly shows a single triangle in the Topology<br>
> SELECT St_AsText(foo.geom) FROM (SELECT (st_dump(st_polygonize(geom))).geom<br>
> FROM ma_topo.edge_data) as foo;<br>
> SELECT ST_AsText(mbr) FROM ma_topo.face;<br>
><br>
><br>
> FYI I am using the latest PostGIS (from source control, rebuilt yesterday<br>
> in an attempt to ensure this was not simply a case of outdated software),<br>
> running under FC16 x86_64.  Again, sorry if this is a dumb question, but I<br>
> am new to SQL, PostGres, and PostGIS - yes, the trifecta.<br>
><br>
> Thanks for any help you can give me, including any advice as to approach...<br>
><br>
> -jm<br>
</div></div>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
</blockquote></div><br></div>