Sunday 29 July 2018

Access PostGIS Raster layer through mapserver



I am trying to use a cgi script calling mapserver to display a raster layer that is stored in a PostGIS database. However, only a blank white image is returned and I don't know where the problem is.


The request seems to go through, but here is an error in the postgres log that I don't understand and the result is a white image.


My questions are:



  1. What does the error from the postgres server log mean (see below)?

  2. How can I make sure the white image is not due to a misspecification of the map extent?

  3. Is there something obvious that I am doing wrong?




Here is some more detailed info for this problem.



The mapserver request is:


http://someurl.com/mapserv.cgi?map=../../usr/maps/test.map&mode=map&layers=kahoo&


The error from the postgres server log:


ERROR:  column "o_column" does not exist at character 39
STATEMENT: select o_table_name, overview_factor, o_column, o_table_schema from raster_overviews where r_table_schema = 'public' and r_table_name = 'kahoo' and r_column = 'rast'

From the mapserver log:


.632473 msDrawMap(): rendering using outputformat named png (AGG/PNG).
.632541 msDrawMap(): WMS/WFS set-up and query, 0.000s
.633883 msDrawRasterLayerLow(kahoo): entering.

.859561 msDrawMap(): Layer 0 (kahoo), 0.227s
.859588 msDrawMap(): Drawing Label Cache, 0.000s
.859594 msDrawMap() total time: 0.227s
.862701 msSaveImage(stdout) total time: 0.003s
.862751 mapserv request processing time (loadmap not incl.): 0.231s
.862759 msFreeMap(): freeing map at 0x266bc60.

The mapfile used is:


MAP
CONFIG "MS_ERRORFILE" "../../tmp/ms_error.txt"

DEBUG 5

NAME "test"
SIZE 218 152
EXTENT 739335 2268075 7761335 2284075
UNITS METERS
STATUS ON
PROJECTION
"init=epsg:26704"
END


WEB
METADATA
"wms_title" "WMS Demo Server"
"wms_onlineresource" "http://someurl.com/mapserv.cgi?map=../../usr/maps/test.map&"
"wms_enable_reqest" "*"
END
END

LAYER

NAME kahoo
TYPE RASTER
STATUS ON
DATA "PG:host=*** port=*** dbname='***' user='***' password='***' schema='public' table='kahoo' mode='2'"
PROCESSING "NODATA=0"
PROJECTION
"init=epsg:26704"
END
END
END


Here are the versions I am using: mapserver-6.0.3, postgresql-9.1.6, postgis-2.0.1




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...