Use AsEWKT(), astext() only supports 2D<br><br><div class="gmail_quote">On Feb 12, 2008 5:17 PM,  &lt;<a href="mailto:cgnicholas@alamedanet.net">cgnicholas@alamedanet.net</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hmmm - this is interesting for providing one&#39;s own data directly in the<br>query, but I&#39;m still unclear how to actually get the Z value from a table.<br><br>For example, I &nbsp;am trying:<br><br>create table ingest.sfterrain (gid serial PRIMARY KEY);<br>
<br>select AddGeometryColumn(&#39;ingest&#39;, &#39;sfterrain&#39;, &#39;the_geom&#39;,<br>&#39;32610&#39;,&#39;POLYGONM&#39;, 3);<br><br>insert into ingest.sfterrain (the_geom) values<br>(GeometryFromText(&#39;POLYGONM((552161.99 4181849.92 7.31689,552174.81<br>
4181862.97 7.31689,552149.81 4181887.53 7.31689,552161.99 4181849.92<br>7.31689))&#39;,32610));<br><br><br>but when I select the row, I just get 2D points back, without the &#39;z&#39;:<br><br>p9test3=# SELECT AsText(the_geom), GeometryType(the_geom),<br>
NDims(the_geom), ZMFlag(the_geom) FROM ingest.sfterrain limit 1;<br><br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; astext<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br>geometrytype | ndims | zmflag<br>------------------------------------------------------------------------------------------------+--------------+-------+--------<br>
&nbsp;POLYGON((552161.99 4181849.92,552174.81 4181862.97,552149.81<br>4181887.53,552161.99 4181849.92)) | POLYGONM &nbsp; &nbsp; | &nbsp; &nbsp; 3 | &nbsp; &nbsp; &nbsp;1<br><br><br>Am I inserting or selecting them incorrectly ?<br><br>thanks in advance!<br>Chris<br>
<div><div></div><div class="Wj3C7c"><br>&gt; Yes, it&#39;s supported.<br>&gt;<br>&gt; test=# SELECT GeometryType(geom), NDims(geom), ZMFlag(geom) FROM<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(SELECT &#39;POLYGON((0 0 10 1, 0 1 10 2, 1 1 10 3, 1 0 10 4, 0 0<br>
&gt; 10 1))&#39;::geometry AS geom) AS foo;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; summary &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| ndims | zmflag<br>&gt; ---------------------------+-------+--------<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp; 4 | &nbsp; &nbsp; &nbsp;3<br>&gt; &nbsp;Polygon[ZMB] with 1 rings<br>
&gt; &nbsp; &nbsp; ring 0 has 5 points<br>&gt;<br>&gt; (1 row)<br>&gt;<br>&gt; How are you retrieving the vertex data?<br>&gt; -- Kevin<br>&gt;<br>&gt;<br>&gt; <a href="mailto:cgnicholas@alamedanet.net">cgnicholas@alamedanet.net</a> wrote:<br>
&gt;&gt; greetings - I&#39;m wondering if the &#39;Measure&#39; stuff works at all for<br>&gt;&gt; Polygons. &nbsp;I&#39;m trying to associate a Z value with each vertex of a<br>&gt;&gt; polygon<br>&gt;&gt; (restricted to triangles for the moment.<br>
&gt;&gt;<br>&gt;&gt; I AddGeometryColumn with a dimension of &#39;3&#39;, etc, and am able to insert<br>&gt;&gt; points that indeed have a Z. Things are GiST indexed properly, etc.<br>&gt;&gt;<br>&gt;&gt; But I don&#39;t seem to be able to retrieve the vertex data with the Z<br>
&gt;&gt; value...is this supported for polygons? &nbsp;I&#39;m trying to cast things to<br>&gt;&gt; &#39;PolygonM&#39;, etc; still no luck...<br>&gt;&gt;<br>&gt;&gt; thanks!<br>&gt;&gt; Chris<br>&gt;&gt;<br>&gt;&gt; _______________________________________________<br>
&gt;&gt; postgis-users mailing list<br>&gt;&gt; <a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>&gt;&gt; <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
&gt;&gt;<br>&gt; _______________________________________________<br>&gt; postgis-users mailing list<br>&gt; <a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>&gt; <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
&gt;<br><br><br>_______________________________________________<br>postgis-users mailing list<br><a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br><a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>************************************<br>David William Bitner