Hi all,<br>
<br>
Thank you very much everyone who tried to help. I have found the
problem. The map was actually rendered correctly, but since it was only
a "POINT", it is only 1 pixel big, and thus I did not see it in the
map. I defined a 50 pixel circle symbol for the class, and render it
again, and things appear correctly.<br>
<br>
Best regards,<br>
Keerati<br><br><div><span class="gmail_quote">On 4/23/05, <b class="gmail_sendername">Newland</b> <<a href="mailto:newland@vt.edu">newland@vt.edu</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><font color="#0000ff" face="Arial" size="2"><span>Below
is an example of how to access a postgis layer. take a careful look at the
DATA parameter.</span></font></div>
<div><font color="#0000ff" face="Arial" size="2"><span></span></font> </div>
<div><font color="#0000ff" face="Arial" size="2"><span>The
general format for the DATA parameter is "<GEOMETRY_COLUMN_NAME> from
<TABLE_NAME> using UNIQUE <UNIQUE_ID_COLUMNNAME> using SRID
<SRID_OF_LAYER>". <font color="#000000" face="Times New Roman" size="3"> </font></span></font></div>
<div><font><span></span></font> </div>
<div><font><span>In my example, </span></font></div>
<div><font><span>
<div><font size="+0"><span>the <font color="#0000ff" face="Arial" size="2">GEOMETRY_COLUMN_NAME </font>is shape.
<div><font size="+0"><span>the <font color="#0000ff" face="Arial" size="2">TABLE_NAME </font>is stlouis_base.
<div><font size="+0"><span>the <font size="2"><font color="#0000ff" face="Arial">UNIQUE_ID_COLUMNNAME </font></font>is oid.
<div><font size="+0"><span>the<font color="#0000ff" face="Arial" size="2"> SRID_OF_LAYER </font>is 4326.</span></font></div>
<div><font size="+0"><span></span></font> </div>
<div><font color="#0000ff" face="Arial" size="2"><span>Hope
this helps.</span></font></div>
<div><font color="#0000ff" face="Arial" size="2"><span></span></font> </div>
<div><font color="#0000ff" face="Arial" size="2"><span></span></font> </div></span></font></div></span></font></div></span></font></div></span></font><font color="#0000ff" face="Arial" size="2"><span></span></font></div>
<div><font color="#0000ff" face="Arial" size="2"><span></span></font> </div>
<div><font color="#0000ff" face="Arial" size="2"><span>-------------------------------Begin
example-----------------------------------------------------------</span></font></div>
<div><font color="#0000ff" face="Arial" size="2"></font> </div>
<div><font color="#0000ff" face="Arial" size="2"> DATA "shape from
stlouis_base using UNIQUE oid USING SRID=4326"<br></font></div>
<div><font color="#0000ff" face="Arial" size="2"> LAYER<br>
NAME "stlouis_roads"<br> TYPE LINE<br>
CONNECTION "user=<span>john</span> password=<span>doe</span> dbname=<span>stlouis</span> host=192.168.<span>1</span>.1<span>11</span>
port=5432"<br> TOLERANCEUNITS pixels<br>
CONNECTIONTYPE postgis<br> TOLERANCE 5<br>
CLASS<br>
LABEL<br> COLOR 0 255
0<br> SIZE
tiny<br> ANGLE
AUTO<br> END<br>
NAME "Roads"<br> COLOR 255 0
0<br> SIZE 1<br>
SYMBOL "circle"<br> END<br> LABELITEM
"name"<br> STATUS on<br> CLASSITEM
"frc"<br> METADATA<br> WMS_TITLE
"St. Louis County Roads"<br> END<br>
PROJECTION<br>
"init=epsg:4326"<br> END<br> DATA "shape
from stlouis_base using UNIQUE oid USING SRID=4326"<br> END</font></div>
<div><font color="#0000ff" face="Arial" size="2">
<div><font color="#0000ff" face="Arial" size="2"><span>-------------------------------End
example-----------------------------------------------------------</span></font></div></font></div><div><span class="e" id="q_1036e1b15cb35363_1">
<div><font color="#0000ff" face="Arial" size="2"></font> </div>
<blockquote>
<div align="left" dir="ltr"><font face="Tahoma" size="2">-----Original Message-----<br><b>From:</b> UMN MapServer Users List
[mailto:<a href="mailto:MAPSERVER-USERS@LISTS.UMN.EDU" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">MAPSERVER-USERS@LISTS.UMN.EDU</a>]<b>On Behalf Of </b>Keerati
Inochanon<br><b>Sent:</b> Friday, April 22, 2005 7:43 PM<br><b>To:</b>
<a href="mailto:MAPSERVER-USERS@LISTS.UMN.EDU" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">MAPSERVER-USERS@LISTS.UMN.EDU</a><br><b>Subject:</b> [UMN_MAPSERVER-USERS] Trouble
rendering map from PostGIS<br><br></font></div>Hi,<br><br>I am new, and having
problems rendering a layer from PostGIS. Here is the map
file:<br><br>==<br>MAP<br> NAME
US_EAST_COAST<br> STATUS ON<br> SIZE 800
500<br> IMAGETYPE PNG<br> IMAGECOLOR 240
240 240<br> SHAPEPATH
"/home/www/testing/maps/countries"<br> EXTENT -180.0000
-90.0000 180.0000 90.0000<br> UNITS DD<br>
PROJECTION<br>
"proj=latlong"<br>
"ellps=GRS80"<br>
"datum=NAD83"<br> END<br>
OUTPUTFORMAT<br> NAME
png<br> DRIVER
"GD/PNG"<br> MIMETYPE
"image/png"<br> IMAGEMODE
PC256<br> EXTENSION "png"<br>
END<br> LAYER<br> NAME
"countries"<br> TYPE
POLYGON<br> STATUS
ON<br> DATA
"cntry98"<br>
CLASS<br> NAME
"Countries"<br> COLOR 255 255
180<br> OUTLINECOLOR 0 0
0<br> END<br>
PROJECTION<br>
"proj=latlong"<br>
"ellps=GRS80"<br>
"datum=NAD83"<br> END<br>
END<br> LAYER<br> NAME
"cities"<br> TYPE
POINT<br> STATUS
ON<br> DATA
"cities"<br>
CLASS<br> NAME
"Cities"<br> COLOR 0 0
0<br> OUTLINECOLOR 0 0
0<br> END<br>
PROJECTION<br>
"proj=latlong"<br>
"ellps=GRS80"<br>
"datum=NAD83"<br> END<br>
END<br> LAYER<br>
CONNECTIONTYPE postgis<br> NAME
"random"<br> CONNECTION "user=xxx password=yyy
dbname=testdb host=localhost"<br> DATA "location
from gtest"<br> STATUS
ON<br> TYPE
POINT<br>
CLASS<br> NAME
"random"<br> COLOR 255 0
0<br> OUTLINECOLOR 255 0
0<br> SIZE
50<br> END<br>
PROJECTION<br>
"proj=latlong"<br>
"ellps=GRS80"<br>
"datum=NAD83"<br> END<br>
END<br>END<br>==<br><br>In python, I do<br>==<br>import mapscript<br>mapObject
= mapscript.mapObj('/path/to/map/file/mapfile')<br>image =
mapObject.draw()<br>image.save('test.png')<br>==<br><br>The result (test.png)
is a map image with only the first two layers (countries and cities), which
seem to be rendered correcly. However, I do not see anything from the postgis
layer. I have a single entry in the gtest table, which was inserted using the
command "insert into gtest (id, location) values (0,
GeomFromText('POINT(40.791723 -77.857340)', -1))". The entry was inserted with
no error. I can do a select to retrieve the entry back.<br><br>Please let me
know what I have done wrong. Any help or suggestions will be much appreciated.
Thank you very much in advance.<br><br>Best regards,<br>Keerati
Inochanon<br></blockquote>
</span></div></blockquote></div><br>