Giter Club home page Giter Club logo

crashmodel's Introduction

Chapel Hill Crash Model Project

Steps to contribution

  • Create github account
  • fork this repo
  • clone/download forked repo
  • make code change (see issues tab for pending tasks)
  • push changes to forked repo
  • create a new pull request

crashmodel's People

Contributors

garrisonreid avatar mkasari avatar sleepsounder avatar jalenwayne1 avatar

Stargazers

Kate Speed avatar Michael Hoffman avatar  avatar Ryan Thornburg avatar

Watchers

James Cloos avatar  avatar Bimba Shrestha avatar Daniel Dunn avatar

crashmodel's Issues

Display sorted list of traffic signals on the sidebar

Once the sidebar is up, get the sorted list of traffic signals by calling

function getSortedTrafficSignalScores(
urlTrafficSignals,
urlPedCrashes,
urlBikeCrashes
) {
trafficSignalPoints = getPointsNonAsync(urlTrafficSignals, "geo_point");
pedCrashPoints = getPointsNonAsync(urlPedCrashes, "geo_point_2d");
bikeCrashPoints = getPointsNonAsync(urlBikeCrashes, "geo_point_2d");
trafficSignalScores = getTrafficSignalScores(
trafficSignalPoints,
pedCrashPoints,
bikeCrashPoints
);
trafficSignalPointsAndScores = zip(trafficSignalPoints, trafficSignalScores);
trafficSignalPointsAndScores = trafficSignalPointsAndScores.sort(
trafficSignalComparisionFunction
);
return trafficSignalPointsAndScores;
}

like this:

trafficSignalScores = getSortedTrafficSignalScores(
"https://www.chapelhillopendata.org/api/records/1.0/search/?dataset=traffic-signals-in-chapel-hill&rows=1000",
"https://www.chapelhillopendata.org/api/records/1.0/search/?dataset=bicycle-crash-data-chapel-hill-region&rows=1000&facet=ambulancer&facet=bikeage_gr&facet=bike_age&facet=bike_alc_d&facet=bike_dir&facet=bike_injur&facet=bike_pos&facet=bike_race&facet=bike_sex&facet=city&facet=county&facet=crashalcoh&facet=crashday&facet=crash_grp&facet=crash_hour&facet=crash_loc&facet=crash_mont&facet=crash_time&facet=crash_type&facet=crash_year&facet=crsh_sevri&facet=developmen&facet=drvrage_gr&facet=drvr_age&facet=drvr_alc_d&facet=drvr_estsp&facet=drvr_injur&facet=drvr_race&facet=drvr_sex&facet=drvr_vehty&facet=excsspdind&facet=hit_run&facet=light_cond&facet=locality&facet=num_lanes&facet=num_units&facet=rd_charact&facet=rd_class&facet=rd_conditi&facet=rd_config&facet=rd_defects&facet=rd_feature&facet=rd_surface&facet=rural_urba&facet=speed_limi&facet=traff_cntr&facet=weather&facet=workzone_i&facet=bike_unitn&facet=drvr_unitn&facet=on_rd",
"https://www.chapelhillopendata.org/api/records/1.0/search/?dataset=pedestrian-crashes-chapel-hill-region&rows=1000&facet=ambulancer&facet=city&facet=county&facet=crashalcoh&facet=crashday&facet=crash_grp&facet=crash_loc&facet=crash_type&facet=crsh_sevri&facet=developmen&facet=drvrage_gr"
);

and then just display the coordinates on the sidebar (next step will be getting the street intersections)

Improve the function for calculating geodistance

Just using euclidian estimate right now

function getEuclidianDistance(x1, y1, x2, y2) {
var x = (x1 - x2) * (x1 - x2);
var y = (y1 - y2) * (y1 - y2);
return Math.sqrt(x + y);
}
function getEuclidianDistanceInMiles(lat1, long1, lat2, long2) {
var dist = getEuclidianDistance(lat1, long1, lat2, long2);
var conversionConstant = 58.8968245849;
return conversionConstant * dist;
}

We should use havesine formula
https://www.movable-type.co.uk/scripts/latlong.html

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.