Is it possible to access the fields from a subquery, example of which
I've been testing in mapfile below?
LAYER
CONNECTIONTYPE POSTGIS
NAME "routes"
METADATA
wms_title "Track Route Service"
wms_srs "EPSG:4326 EPSG:3857"
END
STATUS OFF
VALIDATION
"hash_id" "[a-zA-Z0-9,']+"
END
TYPE LINE
EXTENT -112.138305051 -37.79783943 176.2273 64.56019944
INCLUDE "connection_dev_map.map"
PROCESSING "CLOSE_CONNECTION=DEFER"
DATA "wgs_geom FROM (SELECT mapserver_records('%hash_id%',
'user_schema')) as subquery using unique id using srid=4326"
CLASS
EXPRESSION ([formats] < 10)
STYLE
COLOR 0 0 255
WIDTH 3
END
END
CLASS
EXPRESSION ([formats] = 10)
STYLE
OPACITY 80
COLOR 255 0 0
WIDTH 4.0
END # STYLE
END # CLASS
END # LAYER
The error is:
msPostGISLayerWhichShapes(): Query error. Error executing query: ERROR:
column "formats" does not exist
LINE 1: select "formats",encode(ST_AsBinary(ST_Force2D("sub...
The PostgreSQL function is a simple enough conditional procedure that
takes 2 parameters and returns the formats and wgs_geom fields
The condition check is done on the first parameter and determines which
SQL to use.
The second parameter is used to set which schema to search in.
Anyway, the function is working fine in SQL testing and from the error
it seems I can get most of the way using it through a Mapfile, it just
gets hung on accessing the formats field.
I've also tried using subquery.formats in the Mapfile but get the same
error.
Maybe I should be returning an ID also!!
_______________________________________________
MapServer-users mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/mapserver-users