[mapserver-users] Re: [postgis-users] sql works, but not as l ayer?

Obe, Regina DND\MIS robe.dnd at ci.boston.ma.us
Tue Jun 4 14:36:23 PDT 2002


I think maybe the problem is you have two oids (so it is unclear which is
which) in your select.  Try setting your select statement such that you only
have one oid (the oid from the spatial table).

Something like
(SELECT o.oid, o.the_geom, p.myfield1, p.myfield2, etc. from
objecteigenschappen o left join 
pc6punten p on p.pc6=o.eigenschap_3) as foo"



-----Original Message-----
From: Twan Kogels [mailto:twan at twansoft.com]
Sent: Tuesday, June 04, 2002 3:57 PM
To: Dave Blasby
Cc: postgis-users at postgis.refractions.net;
mapserver-users at lists.gis.umn.edu
Subject: Re: [mapserver-users] Re: [postgis-users] sql works, but not as
layer?


I'm sorry, but after tons of trying and recreating tables it still doesn't 
work. I've simplyfied the query:

CONNECTION "user=postgres dbname=food host=10.0.0.2"
DATA "the_geom from (SELECT * from objecteigenschappen o left join 
pc6punten p on p.pc6=o.eigenschap_3) as foo"
FILTER "pc6 like '1797%'"

I still get the postgresql error "ERROR:  Attribute 'oid' not found", but i 
have defined a index for oid for both (pc6punten en objecteigenschappen) 
tables. Also geometry_columns table is correctly setup.

Does anybody knows what is going wrong?

Best regards,
-twan

At 09:43 4-6-2002 -0700, you wrote:
> > CONNECTION "user=postgres dbname=food host=10.0.0.2"
> > DATA "the_geom from objecteigenschappen o left join pc6punten p on
> > p.pc6=o.eigenschap_3"
> > FILTER "(the_geom && GeometryFromText('BOX3D(109258 559953,115258
> > 565953)'::box3d,-1) and distance(the_geom,
GeometryFromText('POINT(112258
> > 562953)',-1)) < 3000)"
>
>
>You're using the DATA parameter incorrectly - its a bit confusing.
>
>The generic templates are:
>
>DATA "<geom column name> from <table name>"
>         or
>DATA "<geom column name> from (<sql statement>) as foo"
>
>In your case, use:
>
>DATA "the_geom from (SELECT * from objecteigenschappen o left join
>pc6punten p on p.pc6=o.eigenschap_3) as foo"
>
>hope that works,
>
>dave

-- 
http://www.twansoft.com 


_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list