{
int type = geom->type;
+ /* Empty string for empties */
+ if( lwgeom_is_empty(geom) )
+ {
+ char *ret = NULL;
+ ret = lwalloc(1);
+ ret[0] = '\0';
+ return ret;
+ }
+
switch (type)
{
case POINTTYPE:
size_t defidlen = strlen(defid);
size = pointArray_X3Dsize(line->points, precision)*2;
-
+
if ( X3D_USE_GEOCOORDS(opts) ) {
size += (
sizeof("<LineSet vertexCount=''><GeoCoordinate geoSystem='\"GD\" \"WE\" \"longitude_first\"' point='' /></LineSet>") + defidlen
size = sizeof("<PointSet><GeoCoordinate geoSystem='\"GD\" \"WE\" \"longitude_first\"' point='' /></PointSet>");
else
size = sizeof("<PointSet><Coordinate point='' /></PointSet>") + defidlen;
-
+
/* if ( srs ) size += strlen(srs) + sizeof(" srsName=.."); */
if ( X3D_USE_GEOCOORDS(opts) ) size = sizeof("<IndexedFaceSet convex='false' coordIndex=''><GeoCoordinate geoSystem='\"GD\" \"WE\" \"longitude_first\"' point='' />") + defidlen;
else size = sizeof("<IndexedFaceSet convex='false' coordIndex=''><Coordinate point='' />") + defidlen;
-
+
for (i=0; i<psur->ngeoms; i++)
{
if ( X3D_USE_GEOCOORDS(opts) ) ptr += sprintf(ptr, "'><GeoCoordinate geoSystem='\"GD\" \"WE\" \"%s\"' point='", ( (opts & LW_X3D_FLIP_XY) ? "latitude_first" : "longitude_first") );
else ptr += sprintf(ptr, "'><Coordinate point='");
-
+
for (i=0; i<tin->ngeoms; i++)
{
ptr += asx3d3_triangle_buf(tin->geoms[i], 0, ptr, precision,
else if ( subgeom->type == TINTYPE )
{
ptr += asx3d3_tin_buf((LWTIN*)subgeom, srs, ptr, precision, opts, defid);
-
+
}
else if ( subgeom->type == POLYHEDRALSURFACETYPE )
{
ptr += asx3d3_psurface_buf((LWPSURFACE*)subgeom, srs, ptr, precision, opts, defid);
-
+
}
else if ( lwgeom_is_collection(subgeom) )
{
if ( i )
ptr += sprintf(ptr, " ");
-
+
if ( ( opts & LW_X3D_FLIP_XY) )
ptr += sprintf(ptr, "%s %s", y, x);
else
SELECT '#11', ST_Distance (a.g, ST_Intersection(b.g, a.g)) AS distance
FROM (SELECT '01020000000200000050E8303FC2E85141B017CFC05A825541000000E0C0E85141000000205C825541'::geometry AS g) a,
(SELECT 'LINESTRING(4694792.35840419 5638508.89950758,4694793.20840419 5638506.34950758)'::geometry AS g) b;
-
+
-- #21 --
SELECT '#21', ST_AsEWKT(ST_Locate_Along_Measure(g, 4566)) FROM
( VALUES
As pca,
ST_Covers(geometry(geography(poly.the_geom)),
geometry(geography(pt.the_geom))) As gm_to_gg_gm_pca
-
+
FROM (SELECT ST_GeomFromEWKT('SRID=4326;POLYGON((-119.5434 34.9438,-119.5437 34.9445,-119.5452 34.9442,-119.5434 34.9438))') As the_geom)
As poly
CROSS JOIN
SELECT '#3627a', ST_AsEncodedPolyline('SRID=4326;LINESTRING(-0.250691 49.283048,-0.250633 49.283376,-0.250502 49.283972,-0.251245 49.284028,-0.251938 49.284232,-0.251938 49.2842)', 6);
SELECT '#3627b', ST_Equals(geom, ST_LineFromEncodedPolyline(ST_AsEncodedPolyline(geom, 7), 7)) FROM (VALUES ('SRID=4326;LINESTRING (0 0, 1 1)')) AS v (geom);
+-- #3704
+SELECT '#3704', ST_AsX3D('LINESTRING EMPTY') = '';
+
-- Clean up
DELETE FROM spatial_ref_sys;