[mapserver-users] Re: GetCoverage request and time-idexed coverage using postgis

Alexander Petkov greenkov at gmail.com
Fri Aug 1 10:33:38 PDT 2008


I upgraded to 5.2.0 and I am getting the same exception, although
formatted differently. This is the relevant snippet from the log file:

=================================
[Fri Aug  1 11:33:16 2008].508042 getSymbol(): Symbol definition
error. Parsing error near (2000):(line 203)
[Fri Aug  1 11:33:16 2008].512132 msDrawRasterLayerLow(da): entering.
[Fri Aug  1 11:33:16 2008].512180 msPOSTGISLayerOpen called
datastatement: the_geom from da_index
[Fri Aug  1 11:33:16 2008].512194 MSPOSTGISLayerOpen -- shared
connection not available.
[Fri Aug  1 11:33:16 2008].517455
msConnPoolRegister(da_time_idx,dbname=somedbname user=someuser
host=somehost,0x898d938)
[Fri Aug  1 11:33:16 2008].517492 msPOSTGISLayerFreeItemInfo called
[Fri Aug  1 11:33:16 2008].517504 msPOSTGISLayerInitItemInfo called
[Fri Aug  1 11:33:16 2008].517567 msPOSTGISLayerWhichShapes called
[Fri Aug  1 11:33:16 2008].517589 msPOSTGISLayerRetrievePGVersion():
query = select substring(version() from 12 for (position('on' in
version()) - 13))
[Fri Aug  1 11:33:16 2008].518561 msPOSTGISLayerRetrievePGVersion:
Version String: 7.4.19
[Fri Aug  1 11:33:16 2008].518571 msPOSTGISLayerRetrievePGVersion():
Found version 7, 4, 19
[Fri Aug  1 11:33:16 2008].518585 msPOSTGISLayerRetrievePK: query =
select attname from pg_attribute, pg_constraint, pg_class where
pg_constraint.conrelid = pg_class.oid and pg_class.oid =
pg_attribute.attrelid
 and pg_constraint.contype = 'p' and pg_constraint.conkey[1] =
pg_attribute.attnum and pg_class.relname = 'da_index' and
pg_table_is_visible(pg_class.oid) and pg_constraint.conkey[2] is null
[Fri Aug  1 11:33:16 2008].520630 msPOSTGISLayerParseData: unique
column = location, srid='', geom_column_name = the_geom,
table_name=da_index
[Fri Aug  1 11:33:16 2008].520743 query_string_0_6:DECLARE mycursor
BINARY CURSOR FOR SELECT
"date"::text,"location"::text,asbinary(force_collection(force_2d(the_geom)),'NDR'),location::text
from da_index WHERE
 (2000-01-06) and (the_geom && setSRID( 'BOX3D(-2050000
-2136000,2536000 752000)'::BOX3D,find_srid('','da_index','the_geom')
))
[Fri Aug  1 11:33:16 2008].537924 prepare_database(): Query error.
Error declaring cursor: ERROR:  argument of AND must be type boolean,
not type integer

With query string: DECLARE mycursor BINARY CURSOR FOR SELECT
"date"::text,"location"::text,asbinary(force_collection(force_2d(the_geom)),'NDR'),location::text
from da_index WHERE (2000-01-06) and (the_geom && s
etSRID( 'BOX3D(-2050000 -2136000,2536000
752000)'::BOX3D,find_srid('','da_index','the_geom') ))

[Fri Aug  1 11:33:16 2008].537933 msPOSTGISLayerFreeItemInfo called
[Fri Aug  1 11:33:16 2008].537939 msPOSTGISLayerClose datastatement:
the_geom from da_index
[Fri Aug  1 11:33:16 2008].537944 msPOSTGISLayerClose -- query_result is NULL
[Fri Aug  1 11:33:16 2008].538069
msConnPoolRelease(da_time_idx,dbname=somedbname user=someuser
host=somehost,0x898d938)
[Fri Aug  1 11:33:16 2008].538078
msConnPoolClose(da_time_idx,dbname=somedbname user=someuser
host=somehost,0x898d938)
[Fri Aug  1 11:33:16 2008].538647 msPOSTGISLayerClose datastatement:
the_geom from da_index
[Fri Aug  1 11:33:16 2008].538655 msPOSTGISLayerClose -- layerinfo is  NULL
================================
WMS GetMap requests work and return the tile/image for the
corresponding time stamp.
I also tried using a shapefile for the tile index, and GetCoverage
requests work.

Below is my layer definition, as well as the postgis and shapefile tileindexes:
================================
# Departure from Average Postgis Tile Index:
LAYER
  STATUS ON
  NAME "da_time_idx"
  TYPE TILEINDEX
  DATA "the_geom from da_index"
  DEBUG 5
  METADATA
   "wms_srs"   "EPSG:2613"
   "wms_extent" "-2050500.000 -2136500.000 2536500.000 752500.000"
   "wms_title" "TIME INDEX for departure from average images"
   "wms_title" "TIME INDEX for departure from average images"
  END
  CONNECTION "conn params omitted"
  CONNECTIONTYPE postgis
  EXTENT -2050500.000 -2136500.000 2536500.000 752500.000
  PROJECTION
    "init=epsg:2163"
  END
END


# Departure from Average Tile Index:
LAYER
  STATUS ON
  NAME "da_shape_idx"
  TYPE POLYGON
  DEBUG 5
  DATA "da_index.shp"
  METADATA
   "wms_srs"   "EPSG:2613"
   "wms_extent" "-2050500.000 -2136500.000 2536500.000 752500.000"
   "wms_title" "TIME INDEX for departure from average images"
   "wms_title" "TIME INDEX for departure from average images"
  END
  EXTENT -2050500.000 -2136500.000 2536500.000 752500.000
  PROJECTION
    "init=epsg:2163"
  END
END


# raster layer
LAYER
  NAME "da"
  TYPE RASTER
  STATUS ON
  DEBUG 5
  PROCESSING "SCALE=AUTO"
  UNITS Meters
  DUMP TRUE
  PROJECTION
    "init=epsg:2163"
  END
  METADATA
    "wms_title" "Departure from Average"
    "wms_srs"   "EPSG:2613"
    "wms_extent" "-2050500.000 -2136500.000 2536500.000 752500.000"
    "wms_timeextent" "2000-01-06/2005-12-27"
    "wms_timedefault" "2005-12-27"
    "wms_timeitem" "date" #date is a column in postgis table of type timestamp
    "wcs_label"           "Departure From Average WFAS Product"  ### required
    "wcs_name"  "da"
    "wcs_timeitem" "date" #datetime is a column in postgis table of
type timestamp
    "wcs_timeposition" "2000-01-06,2005-12-27"
    "wcs_rangeset_label" "testlabel"
    "wcs_rangeset_name" "testname"
    "wcs_resolution" "1000 1000"
    "wcs_size" "4587 2889"
    "wcs_description" "dep from average resolution mosaic"
    "ows_extent" "-2050500.000 -2136500.000 2536500.000 752500.000"
    "ows_srs" "EPSG:2613"
  END
=============================

Any ideas as to what I might be doing wrong for using WCS with
tile-indexed raster layers?

TIA,
Alex


On Wed, Jul 30, 2008 at 3:32 PM, Alexander Petkov <greenkov at gmail.com> wrote:
> Currently I am using Mapserver version 5.0.2
>
> I am getting the following error when I issue a GetCoverage request
> for a time-indexed coverage, using postgis for the indexing.
> ================================================
> <ServiceException>
> prepare_database(): Query error. Error executing POSTGIS DECLARE (the
> actual query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT
> "date"::text,"fullpath"::text,asbinary(force_collection(force_2d(the_geom)),'NDR'),fullpath::text
> from da_index WHERE (2005-12-27) and (the_geom && setSRID(
> 'BOX3D(-2050500 -2136500,2536500
> 752500)'::BOX3D,find_srid('','da_index','the_geom') ))'
>
> Postgresql reports the error as 'ERROR:  argument of AND must be type
> boolean, not type integer
> '
>
> More Help:
>
> Error with POSTGIS data variable. You specified 'check your .map file'.
> Standard ways of specifiying are :
> (1) 'geometry_column from geometry_table'
> (2) 'geometry_column from (sub query) as foo using unique column name
> using SRID=srid#'
>
> Make sure you put in the 'using unique  column name' and 'using
> SRID=#' clauses in.
>
> For more help, please see http://postgis.refractions.net/documentation/
>
> Mappostgis.c - version of Jan 23/2004.
>
>
> </ServiceException>
>
>
> ==================================================
>
> In my table, the 'date' field has the date values. I see from the
> query above that is missing "date='2005-12-27' in the WHERE clause.
> Indeed, when I add it using the psql client, the query works.
>
> The coverage in question gets listed when I make a WCS GetCapabilities
> request. How shoud I go about getting the error above resolved? Should
> I try the latest version or am I doing something wrong? Here is the
> request in question:
>
> http://someserver/cgi-bin/mapserv?MAP=some_time_index.map&SERVICE=WCS&REQUEST=GetCoverage&coverage=da&CRS=EPSG:2163&FORMAT=GTiff&TIME=2005-12-27&WIDTH=800&HEIGHT=600
>
> Does anyone else who uses postgis for time indexing have GetCoverage
> requests working?
>
> Thanks in advance,
> Alex
>



More information about the MapServer-users mailing list