[postgis-users] PostGIS 2.02 view problem

Richard Greenwood richard.greenwood at gmail.com
Wed Jul 24 07:05:14 PDT 2013


In your map file you have "using unique gid". Are you sure that there is a
"gid" column in your view?

Rich


On Wed, Jul 24, 2013 at 3:35 AM, karsten <karsten at terragis.net> wrote:

> **
> 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').
>
> 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"
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
>


-- 
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130724/a4e6d7d7/attachment-0001.html>


More information about the postgis-users mailing list