[postgis-users] Parcel household and dwelling unit data: add column if it doesn't exist

Conor Henley conor at calthorpe.com
Wed Jun 29 10:33:37 PDT 2011


Hi all,

 

I'm working with parcel data from several different regional sources.
In some cases, the parcel data comes with a households field, in others
with a dwelling units field (in rare cases, both).  In all cases, I need
both.  Luckily, either can be calculated from the other using census
multipliers.

 

1.       What is the best way to add the missing column when it does not
exist?

 

2.       Then, how should I go about populating the newly created field
using a calculation based on the other field (keeping in mind that I
don't want to overwrite either field in the case that both existed in
the input data)?

 

Ideally, I would be able to add the missing field in cases where it does
not exist and populate its rows using a calculation based on the
existing field.  Because this step must nest in a larger set of
processes, it is impractical to check manually each time a new input
goes through.  I've seen a good deal of discussion of this topic on
forums but haven't seen any clear solutions.

 

Thanks, 

 

 

Conor Henley

GIS/Regional Planning Intern

 

C A L T H O R P E  A S S O C I A T E S

2095 ROSE STREET, SUITE 201, BERKELEY, CALIFORNIA, 94709 USA
510-548-6800 | 510 548-6848 (fax)

conor at calthorpe.com <mailto:sheara at calthorpe.com>  | www.calthorpe.com

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20110629/28a86668/attachment.html>


More information about the postgis-users mailing list