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>