Use AsEWKT(), astext() only supports 2D<br><br><div class="gmail_quote">On Feb 12, 2008 5:17 PM,  <<a href="mailto:cgnicholas@alamedanet.net">cgnicholas@alamedanet.net</a>> 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's own data directly in the<br>query, but I'm still unclear how to actually get the Z value from a table.<br><br>For example, I  am trying:<br><br>create table ingest.sfterrain (gid serial PRIMARY KEY);<br>
<br>select AddGeometryColumn('ingest', 'sfterrain', 'the_geom',<br>'32610','POLYGONM', 3);<br><br>insert into ingest.sfterrain (the_geom) values<br>(GeometryFromText('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))',32610));<br><br><br>but when I select the row, I just get 2D points back, without the 'z':<br><br>p9test3=# SELECT AsText(the_geom), GeometryType(the_geom),<br>
NDims(the_geom), ZMFlag(the_geom) FROM ingest.sfterrain limit 1;<br><br>                                             astext<br>                     |<br>geometrytype | ndims | zmflag<br>------------------------------------------------------------------------------------------------+--------------+-------+--------<br>
 POLYGON((552161.99 4181849.92,552174.81 4181862.97,552149.81<br>4181887.53,552161.99 4181849.92)) | POLYGONM     |     3 |      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>> Yes, it's supported.<br>><br>> test=# SELECT GeometryType(geom), NDims(geom), ZMFlag(geom) FROM<br>>          (SELECT 'POLYGON((0 0 10 1, 0 1 10 2, 1 1 10 3, 1 0 10 4, 0 0<br>
> 10 1))'::geometry AS geom) AS foo;<br>>           summary          | ndims | zmflag<br>> ---------------------------+-------+--------<br>>                            |     4 |      3<br>>  Polygon[ZMB] with 1 rings<br>
>     ring 0 has 5 points<br>><br>> (1 row)<br>><br>> How are you retrieving the vertex data?<br>> -- Kevin<br>><br>><br>> <a href="mailto:cgnicholas@alamedanet.net">cgnicholas@alamedanet.net</a> wrote:<br>
>> greetings - I'm wondering if the 'Measure' stuff works at all for<br>>> Polygons.  I'm trying to associate a Z value with each vertex of a<br>>> polygon<br>>> (restricted to triangles for the moment.<br>
>><br>>> I AddGeometryColumn with a dimension of '3', etc, and am able to insert<br>>> points that indeed have a Z. Things are GiST indexed properly, etc.<br>>><br>>> But I don't seem to be able to retrieve the vertex data with the Z<br>
>> value...is this supported for polygons?  I'm trying to cast things to<br>>> 'PolygonM', etc; still no luck...<br>>><br>>> thanks!<br>>> Chris<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>
>><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>
><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