BlockCentroids.src Loader
Background
The BlockCentroids file is a part of the standard install of Allocate. It contains all the point data for creating Demographics for arbitrary geographic areas. The points are generally the centroids of the smallest geography in the system, or better yet (as in the USA) 1 geography smaller than that. There can be more than 1 point referring to the same BG (or other geographies in other countries), so each record is tagged with the Percent of the HH's and POP that is represented by that, as a fraction of the BG it refers to.
Note about projections: Make sure that the points in this file use the same coordinate system as the points in the polygon file. i.e. if the polygons are NAD83, these must be NAD83.
Required Data
The source data can be in a .MDB file or a .csv file. It must be sorted on Longitude (Long) in ascending order. If you are using Access make sure that this is not a cosmetic sort as in selecting the column in Access and just selecting ascending order. To ensure a proper sort, you must have the KEY field be a primary key, or create a Query that sorts into the data, and reference the query instead of the table in the ini file.
Make sure that the table always contains these fields. Note the fieldnames can be anything, as they are set in the ini file (see below):
| KEY |
The Key for the BG (or corresponding level in other countries) that this point refers to. In other words, when doing BlockCentroid Retrieval, the Key of the level from which data will be pulled. |
| Lat |
The latitude of this point. |
| Long |
The longitude of this point. |
| PercentPop |
A percentage from 0-1 of the Population in the KEY that is represented by this one point. This can also be a raw count, and it will be converted to a percentage by the builder. |
| PercentHH |
A percentage from 0-1 of the Households in the KEY that is represented by this one point. This can also be a raw count, and it will be converted to a percentage by the builder. |
| RawLoad |
This is used if you have already created a csv file that has the keys prepared and the system will simple add the license and then write the data out to the file. |
| RecordCountField |
Must be used if you are doing RawLoads. This tells the system how many centroids are in each group. |
Building the file
Create a BuildBlockCentroid.ini file with the following parameters:
InputFile=\\Krusty\z\COUNTRY_UK\2005_04\BASE_BUILD\BLOCKCENTROIDS\BC_POSTSECT_TO_OA.CSV
OutputFile=\\Krusty\z\COUNTRY_UK\2005_04\BASE_BUILD\CNTRY_UK_05A_BLOCKCENTROIDS_A.src
DemoKeysFile=\\Krusty\z\COUNTRY_UK\2005_04\BASE_BUILD\CNTRY_UK_05A_DEMOKEYS_A.src
PolygonFile=\\Krusty\z\COUNTRY_UK\2005_04\BASE_BUILD\CNTRY_UK_05A_POLYGONS_A.src
strGeoType=OA
bFilterOutZeroRecords=False
strLongField=LONG
strLatField=LAT
strCensusID=OUTPUTAREA
strHHField=HHOLD
strPopField=POP
;istest = True
| InputFile |
The name and full path of the file containing the above table. If it is an access file, you will need to have a ,(comma) after the file name followed by the table or query name |
| OutputFile |
The final file name for this file |
| DemoKeysFile |
Full path to DemoKeys file that this build is for |
| PolygonFile |
If referenced (optional parameter), the builder will ensure that all Centroids being built into this file fall physically within it's corresponding polygon (whose KEY is referenced in the strCensusID parameter). If needed, it will move the point 50 feet within the border of the polygon. This ensures a more consistant return of data. For example, if you choose to output data from a Block Group built into Allocate, and compare that to a custom Block Group Polygon data retrieval, if the block centroids aren't physically within it's respective Block Group, the numbers between these two reports may vary considerably. |
| strGeoType |
The SHORTNAME (as specfied in the Demokeys header) that the KEY field refers to. |
| bFilterOutZeroRecords |
Set to true if point that have 0 for both HH and Pop fields are zero. This is usually set to False, as otherwise points that correspond to non-residential areas will be thrown out. |
| strLongField |
The name of the Longitude field in the source file |
| strLatField |
You guessed it |
| strCensusID |
The name of the field containing the KEY that relates to the level from which data will be pulled |
| strHHField |
The name of the field containing either the Household ratio (e.g. fraction of HH this centroid has as compared to the entire BlockGroup) or Household Count |
| strPopField |
Guessed it again? The name of the field containing either the Population ratio or Population Count |
The BuildBlockCentroid.exe can reside anywhere on the network, but must be executed from within the folder containg the BuildBlockCentroid.ini.
Check the BuildBlockCentroid.log when the run is complete.
It will list any KEYS that are missing, or other errors.