<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3157" name=GENERATOR></HEAD>
<BODY><!-- Converted from text/plain format -->
<P><FONT size=2>Hi all, I have added a projection to the map object (see 
attached php script).&nbsp; I have also attached the postgis table 
describe.&nbsp; The postgis describe shows&nbsp;that the table "parcels" has a 
constraint check on the_geom (column) that the srid&nbsp;is 27200 (NZ Mapping 
Grid).&nbsp; Does this mean that the database has the correct projection?&nbsp; 
I have added in the mapscript the line "<FONT 
color=#0000ff>$map-&gt;setProjection('init=epsg:27200');</FONT>", my 
understanding is that this sets the correct projection for the&nbsp;map 
object?&nbsp; Do I need to set the projection for the layer object too?&nbsp; Im 
still getting a blank image.&nbsp; I thought it might have something to do with 
the extents if my projections are correct?&nbsp; Still reasearching 
though.&nbsp; Thanks in advance.&nbsp;<BR><BR>&lt;postgis-start&gt;<BR><FONT 
color=#0000ff>Indexes:<BR>&nbsp;&nbsp;&nbsp; "parcels_pkey" PRIMARY KEY, btree 
(gid)<BR>&nbsp;&nbsp;&nbsp; "gist_index" gist (the_geom)<BR>Check 
constraints:<BR>&nbsp;&nbsp;&nbsp; "enforce_dims_the_geom" CHECK 
(ndims(the_geom) = 2)<BR>&nbsp;&nbsp;&nbsp; "enforce_geotype_the_geom" CHECK 
(geometrytype(the_geom) = 'MULTIPOLYGON'::text OR the_geom IS 
NULL)<BR>&nbsp;&nbsp;&nbsp; "enforce_srid_the_geom" CHECK (srid(the_geom) = 
27200)</FONT><BR>&lt;/postgis-end&gt;</FONT></P>
<DIV><FONT size=2>&lt;php_mapscript-start&gt;<BR><FONT color=#0000ff>$map = 
ms_newMapObj("");<BR>//$map-&gt;set("debug", MS_TRUE);<BR>$map-&gt;setSize(600, 
300);<BR>$map-&gt;setExtent(-180, -90, 180, 90);</FONT></DIV>
<DIV><FONT color=#0000ff></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff>//define path where to creat 
image<BR>$map-&gt;web-&gt;set("imagepath", 
"./data/");<BR>$map-&gt;web-&gt;set("imageurl", 
"./data/");<BR>$map-&gt;web-&gt;set("log", 
"./data/logfile.txt");<BR>$map-&gt;setProjection('init=epsg:27200');</FONT></DIV>
<DIV><FONT color=#0000ff></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff>//crate parcel layer, associate it withthe 
map<BR>$parcelLayer = 
ms_newLayerObj($map);<BR>$parcelLayer-&gt;set("connectiontype", 
MS_POSTGIS);<BR>$parcelLayer-&gt;set("name", "parcels layer");</FONT></DIV>
<DIV><FONT color=#0000ff></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff>$connector = "user=user dbname=dbname 
host=localhost";<BR>$parcelLayer-&gt;set("connection", $connector);</FONT></DIV>
<DIV><FONT color=#0000ff></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff>$sql = "the_geom from 
parcels";<BR>$parcelLayer-&gt;set("data", $sql);</FONT></DIV>
<DIV><FONT color=#0000ff></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff>$parcelLayer-&gt;set("status", 
MS_DEFAULT);<BR>$parcelLayer-&gt;set("type", 
MS_LAYER_POLYGON);<BR>//$parcelLayer-&gt;set("debug", MS_ON);</FONT></DIV>
<DIV><FONT color=#0000ff></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff>$parcelClass = 
ms_newClassObj($parcelLayer);<BR>$parcelClass-&gt;set("name", "parcels 
class");</FONT></DIV>
<DIV><FONT color=#0000ff></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000><FONT color=#0000ff>$parcelStyle = 
ms_newStyleObj($parcelClass);<BR>$parcelStyle-&gt;color-&gt;setRGB( 250, 0, 
0);<BR>$parcelStyle-&gt;outlinecolor-&gt;setRGB( 255, 255, 
255);<BR>//$parcelStyle-&gt;set("symbol", 
7);<BR>$parcelStyle-&gt;set("symbolname", 
"circle");<BR>//$parcelStyle-&gt;set("size", 6);<BR>$parcelStyle-&gt;set("size", 
10);</FONT><BR></FONT>&lt;/php_mapscript-end&gt;</DIV>
<DIV><FONT face=Arial color=#0000ff></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff>bm</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff></FONT>&nbsp;</DIV>
<P><FONT face=Arial color=#0000ff></FONT><FONT face=Arial 
color=#0000ff></FONT><FONT face=Arial color=#0000ff></FONT><FONT face=Arial 
color=#0000ff></FONT><FONT face=Arial color=#0000ff></FONT><FONT face=Arial 
color=#0000ff></FONT><BR></FONT><FONT size=2>-----Original Message-----<BR>From: 
UMN MapServer Users List [</FONT><A 
href="mailto:MAPSERVER-USERS@LISTS.UMN.EDU"><FONT 
size=2>mailto:MAPSERVER-USERS@LISTS.UMN.EDU</FONT></A><FONT size=2>] On Behalf 
Of Gregor Mosheh<BR>Sent: Wednesday, 5 September 2007 12:02 p.m.<BR>To: 
MAPSERVER-USERS@LISTS.UMN.EDU<BR>Subject: Re: [UMN_MAPSERVER-USERS] blank 
image<BR><BR>Terence Maru wrote:<BR>&gt; Hi everyone, I have a problem 
generating an image from my postgis<BR>&gt; database&nbsp; I have attached my 
php script.&nbsp; No errors are returned when<BR>&gt; the script is run, just a 
blank image is returned.&nbsp; Can anyone see<BR>&gt; whats wrong with my 
script?&nbsp; Cheers<BR><BR>This exact same question came up two days ago. 90% 
of the time, the issue is projections. Ensure that all layers and the output map 
are in the same projection, or else set projection blocks. 90% of the time, that 
fixes it.<BR><BR><BR>--<BR>Gregor Mosheh / Greg Allensworth<BR>System 
Administrator, HostGIS cartographic development &amp; hosting services </FONT><A 
href="http://www.HostGIS.com/"><FONT 
size=2>http://www.HostGIS.com/</FONT></A><BR><BR><FONT size=2>"Remember that no 
one cares if you can back up,<BR>&nbsp; only if you can restore." - 
AMANDA<BR></P></FONT>
<FONT face=Arial size=2>
<HR>
This e-mail message has been scanned for viruses by&nbsp;<FONT 
color=#ff8000><STRONG><FONT color=#400080>McAfee</FONT> </STRONG></FONT>and the 
content has been cleared by <STRONG><FONT color=#400080>MailMarshal</FONT> 
</STRONG>
<HR>
</FONT>
</BODY></HTML>