[postgis-users] Create a view and dissolve on attribute

Gregory S. Williamson gsw at globexplorer.com
Thu Aug 17 00:11:47 PDT 2006


Craig --

Postgres makes column and table names lower case by default. I don't have your original posting at hand, but if the table was defined so that the column is "propertyID" then the references to that column ought to be enclosed in double quotes (") to maintain the uppercase (and embedded spaces, etc.). Use single quotes (') for strings and the like. So perhaps:

SELECT c.kilter, GeomUnion(p.the_geom) AS the_geom
FROM vmprop.property_view AS p
JOIN kilter.property AS c ON "c.propertyID" = p.pfi
GROUP BY c.kilter;

Might work (inserted the double quotes).

HTH,

Greg Williamson
DBA
GlobeXplorer LLC


-----Original Message-----
From:	postgis-users-bounces at postgis.refractions.net on behalf of Craig Feuerherdt
Sent:	Wed 8/16/2006 11:10 PM
To:	postgis-users at postgis.refractions.net
Cc:	
Subject:	Re: [postgis-users] Create a view and dissolve on attribute

Michael,
Thanks for your reply.
I believe that is what I am looking for, however I can not get it to work.
Not sure if it is because my various tables are in two separate schemas or
not. I have copied my SQL below, but it keeps giving me an error;
An error has occured:
ERROR: column c.propertyid does not exist

I tried various combinations of the SQL syntax but to no avail.

View definition:
SELECT c.kilter, GeomUnion(p.the_geom) AS the_geom
FROM vmprop.property_view AS p
JOIN kilter.property AS c ON c.propertyID = p.pfi
GROUP BY c.kilter;

Craig

Is the following what you're looking for?  If not then please explain
> in more detail what you'd like to do.
>
> CREATE VIEW catview AS
> SELECT c.cat, GeomUnion(p.geom) AS geom
> FROM poly AS p
> JOIN category AS c ON c.polyid = p.polyid
> GROUP BY c.cat;
>
> --
> Michael Fuhr
>
>


!DSPAM:44e40850134051804284693!






More information about the postgis-users mailing list