Forum OpenACS Development: ref-us-zipcodes package changes

Collapse
Posted by Torben Brosten on

When loaded, the table us_zipcodes contains no data.

service0=# \d us_zipcodes
              Table "public.us_zipcodes"
      Column      |          Type          | Modifiers 
------------------+------------------------+-----------
 zipcode          | character(5)           | not null
 name             | character varying(100) | not null
 fips_state_code  | character(2)           | not null
 fips_county_code | character(6)           | not null
 latitude         | numeric                | 
 longitude        | numeric                | 

packages/ref-us-zipcodes/info/zcta5.txt has this legend:

Computer:~/service0/packages/ref-us-zipcodes/info service0$ more legend
 The ZCTA file contains data for all 5 digit ZCTAs in the 50 states, 
District of Columbia and Puerto Rico as of Census 2000. The file 
is plain ASCII text, one line per record.

    * Columns 1-2: United States Postal Service State Abbreviation
    * Columns 3-66: Name (e.g. 35004 5-Digit ZCTA - there are no post office names)
    * Columns 67-75: Total Population (2000)
    * Columns 76-84: Total Housing Units (2000)
    * Columns 85-98: Land Area (square meters) - Created for statistical purposes only.
    * Columns 99-112: Water Area (square meters) - Created for statistical purposes only.
    * Columns 113-124: Land Area (square miles) - Created for statistical purposes only.
    * Columns 125-136: Water Area (square miles) - Created for statistical purposes only.
    * Columns 137-146: Latitude (decimal degrees) First character is blank or
 "-" denoting North or South latitude respectively
    * Columns 147-157: Longitude (decimal degrees) First character is blank or
 "-" denoting East or West longitude respectively 

Data for fips_county_code is missing, and required for completing a customer service query in ecommerce (see bug: https://openacs.org/bugtracker/openacs/com/ecommerce/bug?bug%5fnumber=1619 ).

A note in cvs states that the data was moved out of sql to faster "bulk data loading".

Is someone working on recreating the table?

Should I just delete packages/ref-us-zipcodes/info/zcta5.txt and add a \COPY us_zipcodes TO us_zipcodes.txt in cvs??

or something else?

Collapse
Posted by Torben Brosten on
Something else!

I'm pinging Jon Griffin who apparently has the lastest version of the data.  And thanks to Dave Bauer on irc, I now know to check the other ref-us-* packages for how to setup loading the data.

Collapse
Posted by Bruno Mattarollo on
The zip-code data is in the Attic. Don't ask me why but it's there ... I don't know if it is accurate but that's the us-zipcodes.dat file that you need to load the data ...
Collapse
Posted by Torben Brosten on
Thanks, Bruno.

Jon apparently is the package maintainer[1], and recently updated the zipcodes information for it[2].

In addition to zcta5.txt, there's an upgrade file[3] for 0.1d to 2.0 that updates location data for zipcodes.

There doesn't appear to be a place in the bugtracker to report or track this, so I want to follow through with this to get it working on a fresh install.

Torben

1. https://openacs.org/projects/openacs/5.0/package_inventory

2. https://openacs.org/forums/message-view?message_id=169142

3. http://cvs.openacs.org/cvs/openacs-4/packages/ref-us-zipcodes/sql/common/upgrade/

Collapse
Posted by Jade Rubick on
There is a place in bugtracker to report this Reference Data - US Zipcodes
Collapse
Posted by Torben Brosten on
You're right, Jade. I looked at the packages shown on the left side of the bugs list page, instead of the list of choices provided by "new bug".

Well.. I'm most of the way through with this, so will just keep at it. ;)

cheers,

Torben