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

Twan Kogels twan at twansoft.com
Tue Jun 4 12:57:03 PDT 2002


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 





More information about the postgis-users mailing list