Skip to content

Commit 73d4e5e

Browse files
committed
Working locally with city council districts.
1 parent 0aceb63 commit 73d4e5e

29 files changed

+58
-60
lines changed

config/settings.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,9 @@
102102
'django.contrib.sitemaps',
103103

104104
'tastypie',
105-
106105
'boundaryservice',
107106

108-
'newsapps.templatelib',
109-
'demo',
107+
'finder',
110108
)
111109

112110
# Predefined domain

config/urls.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from django.conf import settings
2-
from django.conf.urls.defaults import patterns
2+
from django.conf.urls.defaults import include, patterns
33
from django.contrib import admin
44

55
admin.autodiscover()
@@ -13,5 +13,5 @@
1313
}),
1414

1515
(r'', include('boundaryservice.urls')),
16-
(r'', include('demo.urls'))
16+
(r'', include('finder.urls'))
1717
)
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PROJCS["NAD_1983_StatePlane_Texas_North_Central_FIPS_4202_Feet",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",1968500.0],PARAMETER["False_Northing",6561666.666666666],PARAMETER["Central_Meridian",-98.5],PARAMETER["Standard_Parallel_1",32.13333333333333],PARAMETER["Standard_Parallel_2",33.96666666666667],PARAMETER["Latitude_Of_Origin",31.66666666666667],UNIT["Foot_US",0.3048006096012192]]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0"?>
2+
<!--<!DOCTYPE metadata SYSTEM "http://www.esri.com/metadata/esriprof80.dtd">-->
3+
<metadata xml:lang="en"><Esri><MetaID>{7B6B63EF-226B-4C4E-9B25-65F3934F83B3}</MetaID><CreaDate>20110513</CreaDate><CreaTime>22015900</CreaTime><SyncOnce>FALSE</SyncOnce><SyncDate>20110513</SyncDate><SyncTime>22015900</SyncTime><ModDate>20110513</ModDate><ModTime>22015900</ModTime><DataProperties><lineage><Process ToolSource="C:\Program Files (x86)\ArcGIS\ArcToolbox\Toolboxes\Conversion Tools.tbx\FeatureClassToFeatureClass" Date="20110513" Time="220201">FeatureClassToFeatureClass "Database Connections\Tyler.sde\Tyler.GIS.AdministrativeBoundaries\Tyler.GIS.COUNCIL_DISTRICTS" K:\GIS\WEBSHARE\downloads "Council Districts.shp" # "DISTRICT 'DISTRICT' true false false 4 Text 0 0 ,First,#,Database Connections\Tyler.sde\Tyler.GIS.AdministrativeBoundaries\Tyler.GIS.COUNCIL_DISTRICTS,DISTRICT,-1,-1;NAME 'NAME' true false false 15 Text 0 0 ,First,#,Database Connections\Tyler.sde\Tyler.GIS.AdministrativeBoundaries\Tyler.GIS.COUNCIL_DISTRICTS,NAME,-1,-1;REP 'Representative' true false false 25 Text 0 0 ,First,#,Database Connections\Tyler.sde\Tyler.GIS.AdministrativeBoundaries\Tyler.GIS.COUNCIL_DISTRICTS,REP,-1,-1;SHAPE_STArea() 'SHAPE_STArea()' false false true 0 Double 0 0 ,First,#,Database Connections\Tyler.sde\Tyler.GIS.AdministrativeBoundaries\Tyler.GIS.COUNCIL_DISTRICTS,SHAPE.STArea(),-1,-1;SHAPE_STLength() 'SHAPE_STLength()' false false true 0 Double 0 0 ,First,#,Database Connections\Tyler.sde\Tyler.GIS.AdministrativeBoundaries\Tyler.GIS.COUNCIL_DISTRICTS,SHAPE.STLength(),-1,-1" # "K:\GIS\WEBSHARE\downloads\Council Districts.shp"</Process></lineage></DataProperties></Esri><idinfo><native Sync="TRUE">Microsoft Windows Vista Version 6.1 (Build 7600) ; ESRI ArcCatalog 9.3.1.3500</native><descript><langdata Sync="TRUE">en</langdata><abstract>REQUIRED: A brief narrative summary of the data set.</abstract><purpose>REQUIRED: A summary of the intentions with which the data set was developed.</purpose></descript><citation><citeinfo><origin>REQUIRED: The name of an organization or individual that developed the data set.</origin><pubdate>REQUIRED: The date when the data set is published or otherwise made available for release.</pubdate><title Sync="TRUE">Council Districts</title><ftname Sync="TRUE">Council Districts</ftname><geoform Sync="TRUE">vector digital data</geoform><onlink Sync="TRUE">\\GISDATA\GIS\WEBSHARE\downloads\Council Districts.shp</onlink></citeinfo></citation><timeperd><current>REQUIRED: The basis on which the time period of content information is determined.</current><timeinfo><sngdate><caldate>REQUIRED: The year (and optionally month, or month and day) for which the data set corresponds to the ground.</caldate></sngdate></timeinfo></timeperd><status><progress>REQUIRED: The state of the data set.</progress><update>REQUIRED: The frequency with which changes and additions are made to the data set after the initial data set is completed.</update></status><spdom><bounding><westbc Sync="TRUE">REQUIRED: Western-most coordinate of the limit of coverage expressed in longitude.</westbc><eastbc Sync="TRUE">REQUIRED: Eastern-most coordinate of the limit of coverage expressed in longitude.</eastbc><northbc Sync="TRUE">REQUIRED: Northern-most coordinate of the limit of coverage expressed in latitude.</northbc><southbc Sync="TRUE">REQUIRED: Southern-most coordinate of the limit of coverage expressed in latitude.</southbc></bounding></spdom><keywords><theme><themekt>REQUIRED: Reference to a formally registered thesaurus or a similar authoritative source of theme keywords.</themekt><themekey>REQUIRED: Common-use word or phrase used to describe the subject of the data set.</themekey></theme></keywords><accconst>REQUIRED: Restrictions and legal prerequisites for accessing the data set.</accconst><useconst>REQUIRED: Restrictions and legal prerequisites for using the data set after access is granted.</useconst><natvform Sync="TRUE">Shapefile</natvform></idinfo><dataIdInfo><envirDesc Sync="TRUE">Microsoft Windows Vista Version 6.1 (Build 7600) ; ESRI ArcCatalog 9.3.1.3500</envirDesc><dataLang><languageCode Sync="TRUE" value="en"></languageCode></dataLang><idCitation><resTitle Sync="TRUE">Council Districts</resTitle><presForm><PresFormCd Sync="TRUE" value="005"></PresFormCd></presForm></idCitation><spatRpType><SpatRepTypCd Sync="TRUE" value="001"></SpatRepTypCd></spatRpType></dataIdInfo><metainfo><langmeta Sync="TRUE">en</langmeta><metstdn Sync="TRUE">FGDC Content Standards for Digital Geospatial Metadata</metstdn><metstdv Sync="TRUE">FGDC-STD-001-1998</metstdv><mettc Sync="TRUE">local time</mettc><metextns><onlink Sync="TRUE">http://www.esri.com/metadata/esriprof80.html</onlink><metprof Sync="TRUE">ESRI Metadata Profile</metprof></metextns><metc><cntinfo><cntorgp><cntper>REQUIRED: The person responsible for the metadata information.</cntper><cntorg>REQUIRED: The organization responsible for the metadata information.</cntorg></cntorgp><cntaddr><addrtype>REQUIRED: The mailing and/or physical address for the organization or individual.</addrtype><city>REQUIRED: The city of the address.</city><state>REQUIRED: The state or province of the address.</state><postal>REQUIRED: The ZIP or other postal code of the address.</postal></cntaddr><cntvoice>REQUIRED: The telephone number by which individuals can speak to the organization or individual.</cntvoice></cntinfo></metc><metd Sync="TRUE">20110513</metd></metainfo><mdLang><languageCode Sync="TRUE" value="en"></languageCode></mdLang><mdStanName Sync="TRUE">ISO 19115 Geographic Information - Metadata</mdStanName><mdStanVer Sync="TRUE">DIS_ESRI1.0</mdStanVer><mdChar><CharSetCd Sync="TRUE" value="004"></CharSetCd></mdChar><mdHrLv><ScopeCd Sync="TRUE" value="005"></ScopeCd></mdHrLv><mdHrLvName Sync="TRUE">dataset</mdHrLvName><distinfo><resdesc Sync="TRUE">Downloadable Data</resdesc><stdorder><digform><digtinfo><transize Sync="TRUE">0.000</transize><dssize Sync="TRUE">0.000</dssize></digtinfo></digform></stdorder></distinfo><distInfo><distributor><distorTran><onLineSrc><orDesc Sync="TRUE">002</orDesc><linkage Sync="TRUE">file://\\GISDATA\GIS\WEBSHARE\downloads\Council Districts.shp</linkage><protocol Sync="TRUE">Local Area Network</protocol></onLineSrc><transSize Sync="TRUE">0.000</transSize></distorTran><distorFormat><formatName Sync="TRUE">Shapefile</formatName></distorFormat></distributor></distInfo><spdoinfo><direct Sync="TRUE">Vector</direct><ptvctinf><esriterm Name="Council Districts"><efeatyp Sync="TRUE">Simple</efeatyp><efeageom Sync="TRUE">Polygon</efeageom><esritopo Sync="TRUE">FALSE</esritopo><efeacnt Sync="TRUE">0</efeacnt><spindex Sync="TRUE">FALSE</spindex><linrefer Sync="TRUE">FALSE</linrefer></esriterm><sdtsterm Name="Council Districts"><sdtstype Sync="TRUE">G-polygon</sdtstype><ptvctcnt Sync="TRUE">0</ptvctcnt></sdtsterm></ptvctinf></spdoinfo><spref><horizsys><cordsysn><geogcsn Sync="TRUE">GCS_North_American_1983</geogcsn><projcsn Sync="TRUE">NAD_1983_StatePlane_Texas_North_Central_FIPS_4202_Feet</projcsn></cordsysn><planar><mapproj><mapprojn Sync="TRUE">Lambert Conformal Conic</mapprojn><lambertc><stdparll Sync="TRUE">32.133333</stdparll><stdparll Sync="TRUE">33.966667</stdparll><longcm Sync="TRUE">-98.500000</longcm><latprjo Sync="TRUE">31.666667</latprjo><feast Sync="TRUE">1968500.000000</feast><fnorth Sync="TRUE">6561666.666667</fnorth></lambertc></mapproj><planci><plance Sync="TRUE">coordinate pair</plance><plandu Sync="TRUE">survey feet</plandu><coordrep><absres Sync="TRUE">0.000000</absres><ordres Sync="TRUE">0.000000</ordres></coordrep></planci></planar><geodetic><horizdn Sync="TRUE">North American Datum of 1983</horizdn><ellips Sync="TRUE">Geodetic Reference System 80</ellips><semiaxis Sync="TRUE">6378137.000000</semiaxis><denflat Sync="TRUE">298.257222</denflat></geodetic></horizsys></spref><refSysInfo><RefSystem><refSysID><identCode Sync="TRUE">NAD_1983_StatePlane_Texas_North_Central_FIPS_4202_Feet</identCode></refSysID></RefSystem></refSysInfo><spatRepInfo><VectSpatRep><topLvl><TopoLevCd Sync="TRUE" value="001"></TopoLevCd></topLvl><geometObjs Name="Council Districts"><geoObjTyp><GeoObjTypCd Sync="TRUE" value="001"></GeoObjTypCd></geoObjTyp><geoObjCnt Sync="TRUE">0</geoObjCnt></geometObjs></VectSpatRep></spatRepInfo><eainfo><detailed Name="Council Districts"><enttyp><enttypl Sync="TRUE">Council Districts</enttypl><enttypt Sync="TRUE">Feature Class</enttypt><enttypc Sync="TRUE">0</enttypc></enttyp><attr><attrlabl Sync="TRUE">FID</attrlabl><attalias Sync="TRUE">FID</attalias><attrtype Sync="TRUE">OID</attrtype><attwidth Sync="TRUE">4</attwidth><atprecis Sync="TRUE">0</atprecis><attscale Sync="TRUE">0</attscale><attrdef Sync="TRUE">Internal feature number.</attrdef><attrdefs Sync="TRUE">ESRI</attrdefs><attrdomv><udom Sync="TRUE">Sequential unique whole numbers that are automatically generated.</udom></attrdomv></attr><attr><attrlabl Sync="TRUE">Shape</attrlabl><attalias Sync="TRUE">Shape</attalias><attrtype Sync="TRUE">Geometry</attrtype><attwidth Sync="TRUE">0</attwidth><atprecis Sync="TRUE">0</atprecis><attscale Sync="TRUE">0</attscale><attrdef Sync="TRUE">Feature geometry.</attrdef><attrdefs Sync="TRUE">ESRI</attrdefs><attrdomv><udom Sync="TRUE">Coordinates defining the features.</udom></attrdomv></attr><attr><attrlabl Sync="TRUE">DISTRICT</attrlabl><attalias Sync="TRUE">DISTRICT</attalias><attrtype Sync="TRUE">String</attrtype><attwidth Sync="TRUE">4</attwidth></attr><attr><attrlabl Sync="TRUE">NAME</attrlabl><attalias Sync="TRUE">NAME</attalias><attrtype Sync="TRUE">String</attrtype><attwidth Sync="TRUE">15</attwidth></attr><attr><attrlabl Sync="TRUE">REP</attrlabl><attalias Sync="TRUE">REP</attalias><attrtype Sync="TRUE">String</attrtype><attwidth Sync="TRUE">25</attwidth></attr><attr><attrlabl Sync="TRUE">SHAPE_STAr</attrlabl><attalias Sync="TRUE">SHAPE_STAr</attalias><attrtype Sync="TRUE">Float</attrtype><attwidth Sync="TRUE">19</attwidth><atnumdec Sync="TRUE">11</atnumdec></attr><attr><attrlabl Sync="TRUE">SHAPE_STLe</attrlabl><attalias Sync="TRUE">SHAPE_STLe</attalias><attrtype Sync="TRUE">Float</attrtype><attwidth Sync="TRUE">19</attwidth><atnumdec Sync="TRUE">11</atnumdec></attr></detailed></eainfo><mdDateSt Sync="TRUE">20110513</mdDateSt></metadata>
Binary file not shown.

data/shapefiles/definitions.py

+10-11
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,26 @@
99

1010
SHAPEFILES = {
1111
# This key should be the plural name of the boundaries in this set
12-
'Neighborhoods': {
13-
# Path to a shapefile, relative to /data
14-
'file': 'neighborhoods/Neighboorhoods.shp',
12+
'City Council Districts': {
13+
# Path to a shapefile, relative to /data/shapefiles
14+
'file': 'city_council_districts/Council Districts.shp',
1515
# Generic singular name for an boundary of from this set
16-
'singular': 'Neighborhood',
16+
'singular': 'City Council District',
1717
# Should the singular name come first when creating canonical identifiers for this set?
18-
# (e.g. True in this case would result in "Neighborhood South Austin" rather than "South Austin Neighborhood")
1918
'kind_first': False,
2019
# Function which each feature wall be passed to in order to extract its "external_id" property
2120
# The utils module contains several generic functions for doing this
22-
'ider': utils.simple_namer(['PRI_NEIGH_']),
21+
'ider': utils.simple_namer(['DISTRICT']),
2322
# Function which each feature will be passed to in order to extract its "name" property
24-
'namer': utils.simple_namer(['PRI_NEIGH']),
23+
'namer': utils.simple_namer(['NAME']),
2524
# Authority that is responsible for the accuracy of this data
26-
'authority': 'City of Chicago',
25+
'authority': 'Tyler GIS Department',
2726
# Geographic extents which the boundary set encompasses
28-
'domain': 'Chicago',
27+
'domain': 'Tyler',
2928
# Last time the source was checked for new data
30-
'last_updated': date(2010, 12, 12),
29+
'last_updated': date(2011, 5, 14),
3130
# A url to the source of the data
32-
'href': 'http://www.cityofchicago.org/city/en/depts/doit/supp_info/gis_data.html',
31+
'href': 'http://www.smithcountymapsite.org/webshare/data.html',
3332
# Notes identifying any pecularities about the data, such as columns that were deleted or files which were merged
3433
'notes': '',
3534
# Encoding of the text fields in the shapefile, i.e. 'utf-8'. If this is left empty 'ascii' is assumed
-34.8 KB
Binary file not shown.

data/shapefiles/neighborhoods/Neighboorhoods.prj

-1
This file was deleted.
-2.29 KB
Binary file not shown.
-292 Bytes
Binary file not shown.
-1.06 MB
Binary file not shown.
-1.88 KB
Binary file not shown.

fabfile.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
env.database_password = 'dMQlbUCftr'
1414
env.site_media_prefix = "site_media"
1515
env.admin_media_prefix = "admin_media"
16-
env.path = '/home/newsapps/sites/%(project_name)s' % env
17-
env.log_path = '/home/newsapps/logs/%(project_name)s' % env
18-
env.env_path = '/home/newsapps/sites/virtualenvs/%(project_name)s' % env
16+
env.path = '/home/ubuntu/sites/%(project_name)s' % env
17+
env.log_path = '/home/ubuntu/logs/%(project_name)s' % env
18+
env.env_path = '/home/ubuntu/sites/virtualenvs/%(project_name)s' % env
1919
env.repo_path = '%(path)s' % env
20-
env.apache_config_path = '/home/newsapps/sites/apache/%(project_name)s' % env
20+
env.apache_config_path = '/home/ubuntu/sites/apache/%(project_name)s' % env
2121
env.python = 'python2.6'
2222
env.repository_url = "[email protected]:onyxfish/hacktyler-boundaryservice.git"
2323
env.memcached_server_address = "cache"
@@ -33,7 +33,7 @@ def production():
3333
"""
3434
env.settings = 'production'
3535
env.hosts = ['db.hacktyler.com']
36-
env.user = 'newsapps'
36+
env.user = 'ubuntu'
3737
env.s3_bucket = 'media.hacktyler.com'
3838
env.site_domain = 'boundaryservice.hacktyler.com'
3939

@@ -43,7 +43,7 @@ def staging():
4343
"""
4444
env.settings = 'staging'
4545
env.hosts = ['db.beta.hacktyler.com']
46-
env.user = 'newsapps'
46+
env.user = 'ubuntu'
4747
env.s3_bucket = 'media.beta.hacktyler.com'
4848
env.site_domain = 'boundaryservice.beta.hacktyler.com'
4949

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

demo/templates/demo.js finder/templates/demo.js

+26-26
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
var geolocate_supported = true; // until prove false
22

33
var geocoder = new google.maps.Geocoder();
4-
var southwest_limit = new google.maps.LatLng(36.970298, -91.513079);
5-
var northeast_limit = new google.maps.LatLng(42.508338, -87.019935);
4+
var southwest_limit = new google.maps.LatLng(32.1342, -95.6219);
5+
var northeast_limit = new google.maps.LatLng(32.6871, -94.9844);
66
var bounding_box = new google.maps.LatLngBounds(southwest_limit, northeast_limit);
7-
var outside_il = false; // until prove true
7+
var outside = false; // until prove true
88

99
var map = null;
1010

@@ -31,7 +31,7 @@ function init_map(lat, lng) {
3131
var center = new google.maps.LatLng(lat, lng);
3232
map.panTo(center);
3333

34-
check_for_illinois(center);
34+
check_for_locale(center);
3535
resize_listener(center);
3636
}
3737

@@ -53,10 +53,10 @@ function show_user_marker(lat, lng) {
5353

5454
function geocode(query) {
5555
if (typeof(query) == 'string') {
56-
pattr = /\sil\s|\sillinois\s/gi;
56+
pattr = /\stx\s|\stexas\s/gi;
5757
match = query.match(pattr);
5858
if (!match) {
59-
query = query + ' IL';
59+
query = query + ' TX';
6060
}
6161
gr = { 'address': query };
6262
} else {
@@ -84,9 +84,9 @@ function geolocate() {
8484
if (navigator.geolocation) {
8585
navigator.geolocation.getCurrentPosition(geolocation_success, geolocation_error);
8686
} else {
87-
process_location(41.890498, -87.62361);
87+
use_default_location();
8888

89-
$('#resultinfo').html('Your browser does not support automatically determining your location so we\'re showing you where <a href="http://twitter.com/#!/coloneltribune">@ColonelTribune</a> lives.');
89+
$('#resultinfo').html('Your browser does not support automatically determining your location so we\'re showing you Tyler Public Library.');
9090

9191
geolocate_supported = false;
9292
}
@@ -97,14 +97,14 @@ function geolocation_success(position) {
9797
lat_lng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
9898

9999
geocode(lat_lng);
100-
check_for_illinois(lat_lng);
100+
check_for_locale(lat_lng);
101101
hide_search()
102102
}
103103

104104
function geolocation_error() {
105-
process_location(41.890498, -87.62361);
105+
use_default_location();
106106

107-
$('#resultinfo').html('We could not automatically determine your location so we\'re showing you where <a href="http://twitter.com/#!/coloneltribune">@ColonelTribune</a> lives.');
107+
$('#resultinfo').html('Your browser does not support automatically determining your location so we\'re showing you Tyler Public Library.');
108108
}
109109

110110
function process_location(lat, lng) {
@@ -140,13 +140,13 @@ function check_saved_location() {
140140
}
141141
}
142142

143-
function check_for_illinois(center) {
143+
function check_for_locale(center) {
144144
if (!bounding_box.contains(center) && window.location.hash == "#demo") {
145-
show_outside_il();
146-
outside_il = true;
145+
show_outside();
146+
outside = true;
147147
} else {
148-
hide_outside_il();
149-
outside_il = false;
148+
hide_outside();
149+
outside = false;
150150
}
151151
}
152152

@@ -289,8 +289,8 @@ function switch_page(page_id) {
289289
window.location.hash = page_id
290290

291291
if (window.location.hash == "#demo") {
292-
if (outside_il) {
293-
show_outside_il();
292+
if (outside) {
293+
show_outside();
294294
}
295295

296296
resize_end_trigger();
@@ -304,17 +304,17 @@ function switch_page(page_id) {
304304
}
305305
}
306306
} else {
307-
hide_outside_il();
307+
hide_outside();
308308
}
309309
}
310310

311311

312-
function show_outside_il() {
313-
$('#outside-il').fadeIn(500);
312+
function show_outside() {
313+
$('#outside').fadeIn(500);
314314
}
315315

316-
function hide_outside_il() {
317-
$('#outside-il').fadeOut(250);
316+
function hide_outside() {
317+
$('#outside').fadeOut(250);
318318
}
319319

320320
/* DOM EVENT HANDLERS */
@@ -346,8 +346,8 @@ function use_current_location() {
346346
geolocate();
347347
}
348348

349-
function use_tribune_tower() {
350-
process_location(41.890422, -87.623702);
349+
function use_default_location() {
350+
process_location(32.349549, -95.301829);
351351
}
352352

353353
function toggle_alt_addresses() {
@@ -386,7 +386,7 @@ $(document).ready(function() {
386386
$('body').click(hide_alt_addresses);
387387
$('#not-where-i-am').click(not_where_i_am);
388388
$('#use-current-location').click(use_current_location);
389-
$('#use-tribune-tower').click(use_tribune_tower);
389+
$('#use-default-location').click(use_default_location);
390390
$('#did-you-mean').click(function(e) { e.stopPropagation(); toggle_alt_addresses(); });
391391
$('#location-form input[type=text]').focus(search_focused);
392392
$('#location-form').submit(address_search)

0 commit comments

Comments
 (0)