<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="MSHTML 11.00.9600.17842">
<style id="owaParaStyle">P {
MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px
}
</style>
</head>
<body fPStyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<p>Dear Sir/Madam,</p>
<p> </p>
<p>I have some trouble with the SFCGAL web viewer made by Regina. When I enter the following query :</p>
<p> </p>
<p>ST_Scale(ST_GeomFromText('POLYHEDRALSURFACE Z( ((0 0 0, 0 0 1, 0 1 1, 0 1 0, 0 0 0)),
<br>
((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)), <br>
((1 1 0, 1 1 1, 1 0 1, 1 0 0, 1 1 0)), <br>
((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)</p>
<p> </p>
<p>I get the following result:</p>
<p> </p>
<p>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]; ?>
</p>
<p> </p>
<p>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?</p>
<p> </p>
<p>Kind Regard,</p>
<p>Myron.</p>
</div>
</body>
</html>