crime

package
v0.0.0-...-83beb85 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2014 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Codes = aspect.Table("offense_codes",
	aspect.Column("id", aspect.String{PrimaryKey: true}),
	aspect.Column("code", aspect.Integer{}),
	aspect.Column("extension", aspect.Integer{}),
	aspect.Column("description", aspect.String{}),
	aspect.Column("category", aspect.String{}),
	aspect.Column("is_crime", aspect.Boolean{}),
	aspect.Column("is_traffic", aspect.Boolean{}),
)

Functions

func ParseCrimeCSV

func ParseCrimeCSV(path string) (crimes []rawCrime, err error)

func ParseOffenseCodesCSV

func ParseOffenseCodesCSV(path string) (codes []rawCode, err error)

Types

type Code

type Code struct {
	ID          string `json:"id"`
	Code        int64  `json:"code"`
	Extension   int64  `json:"extension"`
	Description string `json:"description"`
	Category    string `json:"category"`
	IsCrime     bool   `json:"is_crime"`
	IsTraffic   bool   `json:"is_traffic"`
}

func ConvertRawCode

func ConvertRawCode(raw rawCode) (code Code)

func ConvertRawCodes

func ConvertRawCodes(raws []rawCode) []Code

func (Code) String

func (c Code) String() string

type CodesAPI

type CodesAPI struct {
	// contains filtered or unexported fields
}

func NewCodesAPI

func NewCodesAPI(db *aspect.DB) *CodesAPI

func (*CodesAPI) Get

func (api *CodesAPI) Get(parameters url.Values) argo.Response

type Crime

type Crime struct {
	IncidentID      int64      `json:"incident_id"`
	OffenseID       int64      `json:""`
	CodeID          string     `json:"code_id"`
	Code            int64      `json:"code"`
	CodeExt         int64      `json:"code_extension"`
	Type            string     `json:"type"`
	Category        string     `json:"category"`
	FirstOccurrence time.Time  `json:"first_occurrence"`
	LastOccurrence  *time.Time `json:"last_occurrence"`
	Reported        time.Time  `json:"reported"`
	Address         string     `json:"address"`
	Latitude        float64    `json:"latitude"`
	Longitude       float64    `json:"longitude"`
	District        int64      `json:"district"`
	Precinct        int64      `json:"precinct"`
	Neighborhood    string     `json:"neighborhood"`
}

func ConvertRawCrime

func ConvertRawCrime(raw rawCrime, l *time.Location) (crime Crime, err error)

func ConvertRawCrimes

func ConvertRawCrimes(raws []rawCrime) ([]Crime, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL