[postgis-users] 'Measure' 3D points on Polygons?

cgnicholas at alamedanet.net cgnicholas at alamedanet.net
Tue Feb 12 15:17:48 PST 2008


Hmmm - this is interesting for providing one's own data directly in the
query, but I'm still unclear how to actually get the Z value from a table.

For example, I  am trying:

create table ingest.sfterrain (gid serial PRIMARY KEY);

select AddGeometryColumn('ingest', 'sfterrain', 'the_geom',
'32610','POLYGONM', 3);

insert into ingest.sfterrain (the_geom) values
(GeometryFromText('POLYGONM((552161.99 4181849.92 7.31689,552174.81
4181862.97 7.31689,552149.81 4181887.53 7.31689,552161.99 4181849.92
7.31689))',32610));


but when I select the row, I just get 2D points back, without the 'z':

p9test3=# SELECT AsText(the_geom), GeometryType(the_geom),
NDims(the_geom), ZMFlag(the_geom) FROM ingest.sfterrain limit 1;

                                             astext                       
                     |
geometrytype | ndims | zmflag
------------------------------------------------------------------------------------------------+--------------+-------+--------
 POLYGON((552161.99 4181849.92,552174.81 4181862.97,552149.81
4181887.53,552161.99 4181849.92)) | POLYGONM     |     3 |      1


Am I inserting or selecting them incorrectly ?

thanks in advance!
Chris

> Yes, it's supported.
>
> test=# SELECT GeometryType(geom), NDims(geom), ZMFlag(geom) FROM
>          (SELECT 'POLYGON((0 0 10 1, 0 1 10 2, 1 1 10 3, 1 0 10 4, 0 0
> 10 1))'::geometry AS geom) AS foo;
>           summary          | ndims | zmflag
> ---------------------------+-------+--------
>                            |     4 |      3
>  Polygon[ZMB] with 1 rings
>     ring 0 has 5 points
>
> (1 row)
>
> How are you retrieving the vertex data?
> -- Kevin
>
>
> cgnicholas at alamedanet.net wrote:
>> greetings - I'm wondering if the 'Measure' stuff works at all for
>> Polygons.  I'm trying to associate a Z value with each vertex of a
>> polygon
>> (restricted to triangles for the moment.
>>
>> I AddGeometryColumn with a dimension of '3', etc, and am able to insert
>> points that indeed have a Z. Things are GiST indexed properly, etc.
>>
>> But I don't seem to be able to retrieve the vertex data with the Z
>> value...is this supported for polygons?  I'm trying to cast things to
>> 'PolygonM', etc; still no luck...
>>
>> thanks!
>> Chris
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>





More information about the postgis-users mailing list