That would work if there was an equivalent to the CAT field in the table
I wanted to join to.  There isn't, it needs to join on the zip code,
which is the key field for the data in Postgres.  There doesn't seem to
be any way to associate data from an SQL table to a piece of vector data
unless the SQL table has the same cat field available.  In other words,
if the original imported e00 file has:

cat
zipcode
altitude
population

and the database table has:

zipcode
median_income
life_expectancy

There's no way to get the two associated on the basis of the common
zipcode field.  The only solution I was able to find was to db.copy the
e00 data to the Postgres database, add a cat field to the existing
table, and then use a query to fill the cat fields in by doing a join.

James M. Turner
Senior Software Engineer - Kronos Labs
Kronos, Inc.
 
2 Omni Way, Chelmsford, MA 01824
(w) 978-947-4108, (c) 603-552-2020, (f) 978-256-2477
[EMAIL PROTECTED]
> -----Original Message-----
> From: Daniel Victoria [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 08, 2007 5:17 PM
> To: Turner, James
> Cc: [email protected]
> Subject: Re: [GRASS-user] Associating attributes from Postgres file
with a
> key other than cat
> 
> Use db.select to set your database and then v.db.connect to link the
> cat in the vector data to the postgres DB
> 
> Cheers
> Daniel
> 
> On 8/8/07, Turner, James <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> > Ok, next dumb question that the documentation didn't seem to help
with
> >
> >
> >
> > I have the Census ZCTA data loaded up "locally" (not in a database),
and
> > some proprietary zip-code based data in a Postgres DB table.  The
> Postgres
> > data is keyed off the zip code, and obviously knows nothing about
the
> cat #s
> > of the imported e00 file with the ZCTA data.  Is there any
non-trivial
> way
> > to make the values in the Postgres table available to GRASS so that
I
> can
> > use it to do coloring of areas, etc.
> >
> >
> >
> > And yes, I know that ZCTA <> Zip Code, but it's close enough for
this
> > application.
> >
> >
> >
> > James M. Turner
> >
> > Senior Software Engineer - Kronos Labs
> >
> > Kronos, Inc.
> >
> >
> >
> > 2 Omni Way, Chelmsford, MA 01824
> >
> > (w) 978-947-4108, (c) 603-552-2020, (f) 978-256-2477
> >
> > [EMAIL PROTECTED]
> >
> >
> > _______________________________________________
> > grassuser mailing list
> > [email protected]
> > http://grass.itc.it/mailman/listinfo/grassuser
> >
> >

_______________________________________________
grassuser mailing list
[email protected]
http://grass.itc.it/mailman/listinfo/grassuser

Reply via email to