Skip to content
Browse files

add xwalk dict

  • Loading branch information...
bhgrant8 committed Jun 13, 2018
1 parent d147d25 commit f77ab7c1b616865d96b7b44dfc8bc48870a76c8c

This file was deleted.

@@ -0,0 +1,28 @@
# Generated by Django 2.0.1 on 2018-06-13 02:28

import django.contrib.gis.db.models.fields
from django.db import migrations, models

class Migration(migrations.Migration):

initial = True

dependencies = [

operations = [
('id', models.IntegerField(primary_key=True, serialize=False)),
('date_created', models.DateField()),
('description', models.TextField(blank=True, null=True)),
('geom_4326', django.contrib.gis.db.models.fields.PointField(srid=4326)),
'db_table': 'safety_hotline_tickets',
'managed': False,
@@ -1,5 +1,8 @@
from django.contrib.gis.db import models

import django.db.models.options as options
options.DEFAULT_NAMES = options.DEFAULT_NAMES + ('in_db',)

class SafetyHotlineTickets(models.Model):
id = models.IntegerField(primary_key=True)
date_created = models.DateField()
@@ -9,4 +12,4 @@ class SafetyHotlineTickets(models.Model):
class Meta:
managed = False
db_table = 'safety_hotline_tickets'
in_db = 'safety_hotline_tickets'
in_db = 'safety_hotline_tickets'
@@ -9,7 +9,7 @@

originDestinationCharacteristicsDefinitions= json.dumps(
originDestinationCharacteristicsDefinitions = json.dumps(
"h_geocode": "Residence census block",
"c000": "Total number of jobs",
@@ -56,3 +56,52 @@
"year": "Date on which data was created, formatted as YYYYMMDD"

originDestinationXwalkDefinitions = json.dumps(
"tabblk2010": "2010 Census Tabulation Block Code",
"st":"FIPS State Code",
"stusps":"USPS State Code",
"stname":"State Name",
"cty":"FIPS County Code",
"ctyname":"County or County Equivalent Name",
"trct":"Census Tract Code",
"trctname":"Census Tract Code",
"bgrp":"Census Tract Code",
"bgrpname":"Census Blockgroup Name, formatted with Tract, County, and State",
"cbsa":"CBSA (Metropolitan/Micropolitan Area) Code",
"cbsaname":"CBSA (Metropolitan/Micropolitan Area) Name",
"zcta":"ZIP Code Tabulation Area (ZCTA) Code",
"zctaname":"ZCTA Name",
"stplc":"Nationally Unique Place Code, (FIPS State + FIPS Place)",
"stplcname":"Place Name",
"ctycsub":"Nationally Unique County Subdivision Code, (FIPS State + FIPS County + FIPS County Subdivision)",
"ctycsubname":"County Subdivision Name",
"stcd115":"Nationally Unique 115th Congressional District Code, (FIPS State + 2-digit District Number)",
"stcd115name":"115th Congressional District Name",
"stsldl":"Nationally Unique State Legislative District, Lower Chamber, (FIPS State + 3-digit District Number)",
"stsldlname":"State Legislative District Chamber, Lower Chamber",
"stsldu":"Nationally Unique State Legislative District, Upper Chamber, (FIPS State + 3-digit District Number) ",
"stslduname":"State Legislative District Chamber, Upper Chamber Chamber",
"stschool":"Nationally Unique Unified/Elementary School District Code, (FIPS State + 5-digit Local Education Agency Code)",
"stschoolname":"Unified/Elementary School District Name",
"stsecon":"Nationally Unique Secondary School District Code, (FIPS State + 5-digit Local Education Agency Code)",
"stseconname":"Secondary School District Name",
"trib":"American Indian /Alaska Native/Native Hawaiian Area Census Code",
"tribname":"American Indian /Alaska Native/Native Hawaiian Area Name",
"tsub":"American Indian Tribal Subdivision Code",
"tsubname":"American Indian Tribal Subdivision Name",
"stanrc":"Nationally Unique Alaska Native Regional Corporation (ANRC) Code (FIPS State + FIPS ANRC)",
"stanrcname":"Alaska Native Regional Corporation Name",
"necta":"New England City and Town Area (NECTA) Code",
"nectaname":"New England City and Town Area (NECTA) Name",
"mil":"Military Installation Landmark Code",
"milname":"Military Installation Name",
"stwib":"Nationally Unique Workforce Innovation Board (WIB) Area Code (FIPS State + state-provided 6-digit WIB Area Code)",
"stwibname":"Workforce Innovation Board Area Name",
"blklatdd":"Latitude (in decimal degrees) of block internal point",
"blklondd":"Longitude (in decimal degrees) of block internal point",
"createdate":"Date on which data was created, formatted as YYYYMMDD",
@@ -15,7 +15,7 @@

from origin_destination_api.models import OriginDestination, ResidenceAreaCharacteristics, WorkplaceAreaCharacteristics, Xwalk
from origin_destination_api.serializers import OriginDestinationSerializer, ResidenceAreaCharacteristicsSerializer, XwalkSerializer, WorkplaceAreaCharacteristicsSerializer
from .dictionary import originDestinationDefinitions, originDestinationCharacteristicsDefinitions
from .dictionary import originDestinationDefinitions, originDestinationCharacteristicsDefinitions, originDestinationXwalkDefinitions
import json

class OriginDestinationViewSet(viewsets.ReadOnlyModelViewSet):
@@ -56,7 +56,9 @@ def list(self, request, *args, **kwargs):
# with open('./routes.json') as handle:
odd = json.loads(originDestinationDefinitions)
odc = json.loads(originDestinationCharacteristicsDefinitions)
odx = json.loads (originDestinationXwalkDefinitions)
return Response({
"originDestinationDefinitions": odd,
"originDestinationCharacteristicsDefinitions": odc
"originDestinationCharacteristicsDefinitions": odc,
"originDestinationXwalkDefinitions": odx
@@ -15,9 +15,7 @@
url(r'^transportation-systems/safety-hotline/', include('safety_hotline_api.urls')),
url(r'^transportation-systems/biketown/', include('biketown_api.urls')),
url(r'^transportation-systems/trimet-stop-events/', include('trimet_stop_event_api.urls')),
url(r'^transportation-systems/trimet-gis/', include('trimet_gis_api.urls')),
url(r'^transportation-systems/multnomah-county-permits/', include('multco_permits_api.urls')),
url(r'^transportation-systems/origin-destination/', include('origin_destination_api.urls')),
path('transportation-systems/sandbox/', include('civic_sandbox.urls')),


0 comments on commit f77ab7c

Please sign in to comment.
You can’t perform that action at this time.