[postgis-tickets] [PostGIS] #3705: ST_AsX3D needs improvement
PostGIS
trac at osgeo.org
Thu Feb 9 20:36:07 PST 2017
#3705: ST_AsX3D needs improvement
------------------------+---------------------------
Reporter: Mike Toews | Owner: pramsey
Type: defect | Status: new
Priority: medium | Milestone: PostGIS 2.3.3
Component: postgis | Version: 2.3.x
Keywords: |
------------------------+---------------------------
Testing ST_AsX3D on various geometries gives varied and interesting
results with PostGIS 2.3 on Windows. These are non-critical outputs,
separated from critical outputs in #3704
Some are documented not to be implemented, however they still run without
raising a "'X' geometry type not implemented" error. The documentation
should also mention that M-coordinates (where present) are dropped.
`SELECT ST_AsX3D('POLYGON EMPTY');`:: returns invalid XML:
`<IndexedFaceSet convex='false' coordIndex=''>' />`
`SELECT ST_AsX3D('POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))');`::
returns invalid XML: `<IndexedFaceSet convex='false' coordIndex='0 1 2
3'>30 10 40 40 20 40 10 20 ' />`, and similar for empty and non-empty
MULTIPOLYGON
`SELECT ST_AsX3D('MULTILINESTRING ((2 3, 4 5))');`:: returns invalid XML:
`<IndexedLineSet coordIndex='0 1'>2 3 4 5 ' />`
With the following, valid XML is returned (I can't confirm if these are
valid X3D):
* `POINT(1 2)` : `1 2`
* `LINESTRING(1 2, 3 4)` : `<LineSet vertexCount='2'><Coordinate
point='1 2 3 4' /></LineSet>`
* `MULTIPOINT EMPTY` : `<Polypoint2D point='' />`
* `TRIANGLE((0 0 0,0 1 0,1 1 0,0 0 0))` : `0 0 0 0 1 0 1 1 0`
* `TIN (((0 0 0, 0 0 1, 0 1 0, 0 0 0)), ((0 0 0, 0 1 0, 1 1 0, 0 0 0)))`
: `<IndexedTriangleSet index='0 1 2 3 4 5'><Coordinate point='0 0 0 0 0 1
0 1 0 0 0 0 0 1 0 1 1 0'/></IndexedTriangleSet>`
* `POLYHEDRALSURFACE Z (((0 0 0, 0 1 0, 1 1 0, 1 0 0, 0 0 0)),((0 0 0, 0
1 0, 0 1 1, 0 0 1, 0 0 0)),((0 0 0, 1 0 0, 1 0 1, 0 0 1, 0 0 0)),((1 1 1,
1 0 1, 0 0 1, 0 1 1, 1 1 1)),((1 1 1, 1 0 1, 1 0 0, 1 1 0, 1 1 1)),((1 1
1, 1 1 0, 0 1 0, 0 1 1, 1 1 1)))` : ` <IndexedFaceSet convex='false'
coordIndex='0 1 2 3 -1 4 5 6 7 -1 8 9 10 11 -1 12 13 14 15 -1 16 17 18 19
-1 20 21 22 23'><Coordinate point='0 0 0 0 1 0 1 1 0 1 0 0 0 0 0 0 1 0 0 1
1 0 0 1 0 0 0 1 0 0 1 0 1 0 0 1 1 1 1 1 0 1 0 0 1 0 1 1 1 1 1 1 0 1 1 0 0
1 1 0 1 1 1 1 1 0 0 1 0 0 1 1' /></IndexedFaceSet>`
However some of these don't work within a `GEOMETRYCOLLECTION` (the
documentation does not indicate the support level of this geometry type):
`SELECT ST_AsX3D('GEOMETRYCOLLECTION(POINT(1 2),LINESTRING(1 2, 3
4))');`:: returns invalid XML: `<Shape>1 2<Shape><LineSet
vertexCount='2'><Coordinate point='1 2 3 4' /></LineSet>`
or
`SELECT ST_AsX3D('GEOMETRYCOLLECTION(POINT(1 2),POINT(3 4))');`:: returns
invalid XML: `<Shape>1 2<Shape>3 4`
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3705>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list