[postgis-users] PostGIS 2.02 view problem

karsten karsten at terragis.net
Wed Jul 24 02:35:29 PDT 2013


Hi all,
 
I am trying to use a b view in Postgis 2.0.2 ("POSTGIS="2.0.2 r10789"
GEOS="3.3.8-CAPI-1.7.8" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.0,
released 2013/04/24" LIBXML="2.8.0" LIBJSON="UNKNOWN" TOPOLOGY RASTER")
for display via MapServer 6.2 
I am getting an this error from MapServer:
 
Failed to draw layer named 'members'.
msPostGISLayerWhichShapes(): Query error. Error executing query: ERROR:
column "COUNT" does not exist
LINE 1: select
"COUNT",encode(ST_AsBinary(ST_Force_2D("geom"),'NDR&
#39;).
 
I have no idea why a count is needed here or where this field is coming from
...seems that the regular table have no issue with this. 
 
My VIEW public.geometry_columns  shows these values for the view:
"xy";"xy";"myloc";"geom";2;4269;"POINT"
 
What can I do to fix this in Postgis ?
See below for view details
 
Cheers
Karsten

Terra GIS LTD

-------------------------
-- View: 
CREATE OR REPLACE VIEW xy.test AS

 SELECT xy.census_city_id, st_centroid(places.geom)::geometry(Point,4269) AS
geom, places.name
   FROM myschema.xy,myschema.places

  WHERE xy.census_city_id = places.geoid::integer;

ALTER TABLE myschema.xy_loc


OWNER TO myuser;     
 
-----------------------------------
in mapfile:

DATA "geom from (select * from myschema.xy) as temp using unique gid using
SRID=4269"  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130724/1d86c1d6/attachment.html>


More information about the postgis-users mailing list