Skip to content

Instantly share code, notes, and snippets.

@wboykinm
Created October 7, 2012 00:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wboykinm/3846689 to your computer and use it in GitHub Desktop.
Save wboykinm/3846689 to your computer and use it in GitHub Desktop.
DB config, validated to a functioning instance :)
<!-- The application element that contains all other elements. -->
<DistrictBuilder>
<!-- Define legislative bodies referenced in the system. -->
<LegislativeBodies>
<!-- A Legislative body has an ID (for referencing in GeoLevel
definitions later), a name, and a label for plan items
("District" for Council, etc) -->
<LegislativeBody id="council" name="Burlington City Council" short_label="%(district_id)s" long_label="Ward %(district_id)s" maxdistricts="7" sort_key="1"/>
</LegislativeBodies>
<Regions>
<Region id="region1" name="region1" label="Council" description="City Council" sort_key="1">
<LegislativeBodies>
<LegislativeBody ref="council"/>
</LegislativeBodies>
<GeoLevels>
<GeoLevel ref="block"/>
</GeoLevels>
</Region>
</Regions>
<!-- A list of subjects referenced in the system. -->
<Subjects>
<!-- A Subject is a measurement type, such as "Total Population".
The subject is mapped to an attribute during the import phase,
and contains a long and short display name. Subjects have IDs
for referencing in GeoLevel definitions later. -->
<Subject id="poptot" field="totalpop" name="Total Population"
short_name="Total Pop." displayed="true" sortkey="1" default="true"/>
<!-- You can alias a subject by overriding the field, if the
import shapefiles have different field names at different
geographic levels. -->
<!-- <Subject id="pophisp1" field="POPHISP" aliasfor="pophisp"/> -->
</Subjects>
<Scoring>
<!--barebones-->
<ScoreFunctions>
<ScoreFunction id="score1" type="district" calculator="publicmapping.redistricting.calculators.Target">
<SubjectArgument name="value" ref="poptot"/>
<Argument name="target" value="6060" />
<Argument name="range1" value="0.05"/>
<Argument name="range2" value="0.1"/>
</ScoreFunction>
<ScoreFunction id="plan_all_blocks_assigned" type="plan"
calculator="publicmapping.redistricting.calculators.AllBlocksAssigned"
label="All Blocks Assigned"
description="All blocks in the plan must be assigned.">
</ScoreFunction>
</ScoreFunctions>
<ScorePanels>
<ScorePanel id="panel1" type="plan" position="1" title="Panel 1" cssclass="district_demographics wards" template="demographics.html">
<Score ref="score1"/>
</ScorePanel>
</ScorePanels>
<ScoreDisplays>
<ScoreDisplay id="display1" legislativebodyref="council" type="sidebar" title="Scores">
<ScorePanel ref="panel1" />
</ScoreDisplay>
</ScoreDisplays>
</Scoring>
<Validation>
<Criteria legislativebodyref="council">
<Criterion id="council-assigned" name="AllBlocksAssigned - Council" description="">
<Score ref="plan_all_blocks_assigned" />
</Criterion>
</Criteria>
</Validation>
<GeoLevels>
<GeoLevel id="block" name="block" label="wards" min_zoom="8" sort_key="3" tolerance="2.5">
<!--
You may use EITHER the "Shapefile" or "Files" element as a child
of geolevel to define the geography and attributes. The
"Shapefile" element must contain both the geography and
attributes, whereas the "Files" element contains an item for the
geography, and multiple items for the attributes.
This is in anticipation of loading data that has been downloaded
directly from the American Fact Finder web application hosted by
the US Census Beureau.
-->
<Shapefile path="/projects/DistrictBuilder/data/btv_blocks.shp">
<Fields>
<!--
Each Field item defines a field in the shapefile that
describes a different part of the geographic unit.
A "name" type field is used to display the name of the
geographic unit.
A "portable" type field is used to store the FIPS/GEOID
of the geographic unit, which is shared with other GIS
systems.
A "tree" type field is used to store information about
the geography, and where it resides in the tree. This type
of field requires a "pos" attribute, which declares which
position in the tree the field belongs (starting at 0);
a "width" attribute is also required to declare how wide
this portion of the tree code is. This is helpful when
the treecode may not be zero padded.
-->
<Field name="NAME10" type="name"/>
<Field name="GEOID10" type="portable"/>
<Field name="STATEFP10" type="tree" pos="0" width="2"/>
<Field name="COUNTYFP10" type="tree" pos="1" width="3"/>
<Field name="GEOID10" type="tree" pos="3" width="14"/>
</Fields>
</Shapefile>
<!--
A reference to a legislative body. A geolevel may be used by
many legislative bodies.
-->
</GeoLevel>
<!--
A child geolevel. The geography of the parent geolevel must
be coincident in its child.
-->
</GeoLevels>
<!--
This element facilitates the creation of system templates. A
system template is a plan owned by the admin user, that all other
users can create derivative plans from.
-->
<Templates>
<Template name="Council">
<!-- A reference to a legislative body. -->
<LegislativeBody ref="council"/>
<!--
The path to the district index file. The index file must be
a two column CSV file, with each row corresponding to 1) a
unit of geography, and 2) the district it belongs to.
-->
<Blockfile path="/projects/DistrictBuilder/data/btv_index.csv" />
</Template>
</Templates>
<!--
Configuration settings for the components of the application. The
"root" attribute defines the location in the file system, under
which the rest of the application components can be found.
-->
<Project root="/projects/DistrictBuilder" sessionquota="5" sessiontimeout="15" temp="/projects/Districtbuilder/temp">
<!--
Database connection information.
If you change the user to something different than
'publicmapping', you will have to define a schema in
postgresql by the same name as the user.
The 'host' attribute is optional.
-->
<Database name="publicmapping3" user="publicmapping" password="snupipo05" host="localhost"/>
<!--
Administrative user information. This will create an administrative
superuser in django with these credentials.
-->
<Internationalization timezone="US/Eastern" default="en">
<Language code="en" label="English"/>
</Internationalization>
<Admin user="jethro" email="vtcraghead@gmail.com" password="queencity"/>
<!-- Configuration items specific to the redistricting app. -->
<Redistricting>
<!--
Information about the mapserver and geoserver settings.
The "basemaps" attribute is optional, and can be any set to
any combination (CSV) of the following:
osm-road
google-road
google-aerial
google-hybrid
bing-road
bing-aerial
bing-hybrid
The options are displayed in the order in which they are set,
with the first one being set to the default base layer. If
this is not set, it will default to osm-road. If the desire
is to have no base layer, set it to the empty string.
-->
<MapServer hostname="ec2-23-22-217-177.compute-1.amazonaws.com:8080/geoserver/" ns="gmu" nshref="http://gmu.azavea.com/"
adminuser="GEOSERVER-ADMIN-USER" adminpass="GEOSERVER-ADMIN-PASS" maxfeatures="100"
styles="/projects/publicmapping/trunk/sld/sld2" />
<!--
Use a GoogleAnalytics account to tract the usage of the
application. This requires an account and domain.
<GoogleAnalytics account="" domain=""/>
-->
<!-- Upload file size restrictions. This is in KB -->
<Upload maxsize="5300"/>
</Redistricting>
<!--
Configure the engine used for reporting. Currently, BARD is the
only supported reporting engine.
-->
<Reporting>
<!--<BardBodyConfigs>
<BardBodyConfig
id="council_blocks"
legislativebodyref="council"
bardconfigref="blocks" />
</BardBodyConfigs>-->
</Reporting>
<!-- Information about the mailer configuration. -->
<Mailer server="localhost" port="25" username="" password=""/>
</Project>
</DistrictBuilder>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment