VGF Loader API
const char * AllCreateVGF(const char *pXml)
return is non-zero on success or 0 for failure
Changes
As of Allocate 5.6.10 there is a new command within the Params
Set this to True if your load is very large (greater that 1,000,000 records or so) and the loader is running out of memory. This will cause the load to work in chunks small enough to fit in memory. The records MUST be presorted and the key lengths must all be the same. It is also incompatible with optimize="true" and autoAssignParent="true".
buildAltKeyIndex
if this is true, it will build an AltKey index. In order for this to work, all the keys must start with a special character, usually # and the AltKeys must never start with the special character.
Polygon based loads
Example XML
<CreateVGFFile type="Polygon">
<InputFile
path="c:\temp\ColoradoPlaces.tab"
table=""
nameField="Name"
keyField="Key"
altKeyField=""
/>
<OutputFile
path="c:\temp\ColoradoPlaces.vgf"
/>
<Params
longName="Colorado Places"
shortName="TEMP"
parentShortName="COUNTY"
autoGenerateKey="False"
autoAssignParent="True"
autoRegisterResult="True"
autoUnregisterPrevious="True"
optimize="False"
/>
</CreateVGFFile>
AltKeyField
This is optional and will default to the same as the key.
AutoGenerateKey
if this is set to True, the KeyField will not be used. The AltKeyField can still be used, but as always, is optional.
If there is both a parent short name and AutoGenerateKey="True", the keys will be generated to fall within a parent when the centroid of the generated polygon falls within the parent. This will be MUCH slower for most builds, especially when the VGF is for a small region, but the parent is national.
If True, it tries to roll up all the block groups into a tract or tracts into a county in order to minimize the data that is needed. This will happen in the exact reverse of how the level is seen in the pick geography tree in the gui. The default is set with by the data set.
Record based loads
Example XML
<CreateVGFFile type="Record">
<InputFile
path="C:\Temp\ZipVGFBuild\ZIP5Load.dbf"
table=""
nameField="Name"
keyField="KEY"
altKeyField=""
percentHouseholdWeightField=""
percentPopWeightField=""
percentCountWeightField=""
demoKeysShortNameField="KEY_TYPE"
demoKeysKeyField="KEY"
/>
<SpatialInputFile
path="C:\Temp\ZipVGFBuild\ZipVgfSpatialSource.tab"
keyField="ZIPCODE"
/>
<OutputFile
path="C:\Temp\ZipVGFBuild\ZIP5_1.vgf"
/>
<Params
longName="5 Digit Zip Codes"
shortName="ZIP5"
parentShortName="ZIP4"
makeIntermediateVGF="False"
createPolygons="False"
autoAssignParent="False"
autoRegisterResult="True"
autoUnregisterPrevious="True"
optimize="False"
/>
</CreateVGFFile>
Household and PopWieghts
These are purely optional and will generally give proper results when left to the default behavior.
These are very complex issues and should not be used (and are not required) unless you know what you are doing. It is possible to manipulate the demographic results such that they will be meaningless. If HouseholdsWeight or PopWeight, both not both are specified, the other will be computed with the same ratio.
percentCountField
This is a 0 to 1 percentage of the count of this record to pull. If this is specified, but not Household or Pop Weight, then this percentage will be applied to the others and visa versa.
HideVGFInGUI
Use this for creating an intermediate layer in the hierarchy that is not in and of itself used to retrieve data.
CreatePolygons
If this is on, polygons will be merged and stored in the VGF file. Any records that refer to only 1 DemoKeys Object will NOT store the polygon, as the polygon can be looked up at run time very quickly.
ParentShortName and AutoGenerateKey
See above.
This requires that CreatePolygons="True"
<SpatialInputFile ...>
If you use this, it requires that createPolygons=false. You can use this to specify the polygons for a record based load. The input file must be sorted by key, as well as the main input file must be sorted by key. It supports .tab, .mid/mif .shp, .geo and .sdf if you have the autodesk sdf toolkit installed. You can load points, lines or polygons into a VGF.
same as above except the default is always false for record based loads.
Allocate® is a registered trademark of SRC, LLC
Last Updated