[postgis-users] SFCGAL X3D viewer

Myron Ramkisoen M.G.W.Ramkisoen at student.tudelft.nl
Wed Jul 15 02:51:27 PDT 2015


Dear Sir/Madam,



I have some trouble with the SFCGAL web viewer made by Regina. When I enter the following query :



ST_Scale(ST_GeomFromText('POLYHEDRALSURFACE Z( ((0 0 0, 0 0 1, 0 1 1, 0 1 0, 0 0 0)),
  ((0 0 0, 0 1 0, 1 1 0, 1 0 0, 0 0 0)), ((0 0 0, 1 0 0, 1 0 1, 0 0 1, 0 0 0)),
  ((1 1 0, 1 1 1, 1 0 1, 1 0 0, 1 1 0)),
  ((0 1 0, 0 1 1, 1 1 1, 1 1 0, 0 1 0)), ((0 0 1, 1 0 1, 1 1 1, 0 1 1, 0 0 1)) )'),20,20,20)



I get the following result:



255 ? 1 : $v/255.0));'); /**x3d colors are in rgb where intensity is on scale of 0 to 1 **/ array_walk($_GET[$k], $fn); break; case 'spatial_type': $_GET[$k] = strtolower($_GET[$k]); if (!in_array($_GET[$k], array('raw', 'geometry'))) $_GET[$k] = 'geometry'; break; } } // assemble connection string $conn_str = array(); foreach ($conn as $k => $v) { if (!strlen(trim($v))) continue; $conn_str[] = $k . '=' . trim($v); } $conn_str = implode(' ', $conn_str); $dbconn = pg_connect($conn_str); if ($dbconn === false) return; // do query if ($_GET['spatial_type'] != 'raw') $sql = "SELECT postgis_viewer_x3d('" . pg_escape_string($dbconn, $_GET['sql']) . "', 'geometry', ARRAY[" . implode(',', $_GET['bvals']) . "])"; else $sql = "SELECT postgis_viewer_x3d('" . pg_escape_string($dbconn, $_GET['sql']) . "', 'raw')"; $result = pg_query($sql); if ($result === false) return; $row = pg_fetch_row($result); pg_free_result($result); if ($row === false) return; echo $row[0]; ?>



I have installed the WAPP stack of Bitnami, and I have a web server running (Apache) and I am connected via phpPgAdmin to my server. I have also filled the credentials, as mentioned in the READme file. Could someone help me with getting this viewer working?



Kind Regard,

Myron.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20150715/c29bfe68/attachment.html>


More information about the postgis-users mailing list