<!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). I have also attached the postgis table
describe. The postgis describe shows that the table "parcels" has a
constraint check on the_geom (column) that the srid is 27200 (NZ Mapping
Grid). Does this mean that the database has the correct projection?
I have added in the mapscript the line "<FONT
color=#0000ff>$map->setProjection('init=epsg:27200');</FONT>", my
understanding is that this sets the correct projection for the map
object? Do I need to set the projection for the layer object too? Im
still getting a blank image. I thought it might have something to do with
the extents if my projections are correct? Still reasearching
though. Thanks in advance. <BR><BR><postgis-start><BR><FONT
color=#0000ff>Indexes:<BR> "parcels_pkey" PRIMARY KEY, btree
(gid)<BR> "gist_index" gist (the_geom)<BR>Check
constraints:<BR> "enforce_dims_the_geom" CHECK
(ndims(the_geom) = 2)<BR> "enforce_geotype_the_geom" CHECK
(geometrytype(the_geom) = 'MULTIPOLYGON'::text OR the_geom IS
NULL)<BR> "enforce_srid_the_geom" CHECK (srid(the_geom) =
27200)</FONT><BR></postgis-end></FONT></P>
<DIV><FONT size=2><php_mapscript-start><BR><FONT color=#0000ff>$map =
ms_newMapObj("");<BR>//$map->set("debug", MS_TRUE);<BR>$map->setSize(600,
300);<BR>$map->setExtent(-180, -90, 180, 90);</FONT></DIV>
<DIV><FONT color=#0000ff></FONT> </DIV>
<DIV><FONT color=#0000ff>//define path where to creat
image<BR>$map->web->set("imagepath",
"./data/");<BR>$map->web->set("imageurl",
"./data/");<BR>$map->web->set("log",
"./data/logfile.txt");<BR>$map->setProjection('init=epsg:27200');</FONT></DIV>
<DIV><FONT color=#0000ff></FONT> </DIV>
<DIV><FONT color=#0000ff>//crate parcel layer, associate it withthe
map<BR>$parcelLayer =
ms_newLayerObj($map);<BR>$parcelLayer->set("connectiontype",
MS_POSTGIS);<BR>$parcelLayer->set("name", "parcels layer");</FONT></DIV>
<DIV><FONT color=#0000ff></FONT> </DIV>
<DIV><FONT color=#0000ff>$connector = "user=user dbname=dbname
host=localhost";<BR>$parcelLayer->set("connection", $connector);</FONT></DIV>
<DIV><FONT color=#0000ff></FONT> </DIV>
<DIV><FONT color=#0000ff>$sql = "the_geom from
parcels";<BR>$parcelLayer->set("data", $sql);</FONT></DIV>
<DIV><FONT color=#0000ff></FONT> </DIV>
<DIV><FONT color=#0000ff>$parcelLayer->set("status",
MS_DEFAULT);<BR>$parcelLayer->set("type",
MS_LAYER_POLYGON);<BR>//$parcelLayer->set("debug", MS_ON);</FONT></DIV>
<DIV><FONT color=#0000ff></FONT> </DIV>
<DIV><FONT color=#0000ff>$parcelClass =
ms_newClassObj($parcelLayer);<BR>$parcelClass->set("name", "parcels
class");</FONT></DIV>
<DIV><FONT color=#0000ff></FONT> </DIV>
<DIV><FONT color=#000000><FONT color=#0000ff>$parcelStyle =
ms_newStyleObj($parcelClass);<BR>$parcelStyle->color->setRGB( 250, 0,
0);<BR>$parcelStyle->outlinecolor->setRGB( 255, 255,
255);<BR>//$parcelStyle->set("symbol",
7);<BR>$parcelStyle->set("symbolname",
"circle");<BR>//$parcelStyle->set("size", 6);<BR>$parcelStyle->set("size",
10);</FONT><BR></FONT></php_mapscript-end></DIV>
<DIV><FONT face=Arial color=#0000ff></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff>bm</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff></FONT> </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>> Hi everyone, I have a problem
generating an image from my postgis<BR>> database I have attached my
php script. No errors are returned when<BR>> the script is run, just a
blank image is returned. Can anyone see<BR>> whats wrong with my
script? 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 & 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> 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 <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>