codeforkansascity / Neighborhood-Dashboard

We're working to help neighborhoods help themselves by giving them easy access to useful data to allow them to identify and track problem areas in their neighborhood.
https://neighborhood-dashboard.codeforkc.org/
MIT License
18 stars 9 forks source link

Add address_api county tax delinquent data for 2016, 2017, and 2018 #137

Closed zmon closed 5 years ago

zmon commented 6 years ago

I think the change needs to be in spec/services/neighborhood_services/legally_abandoned_calculation/tax_delinquent_spec.rb .

app/service/neighborhood_services/legally_abandoned_calculation/tax_delinquent.rb:        
    while taxed_address["county_delinquent_tax_#{current_year}"].to_f > 0 do

lib/entities/address_api/address.rb:        
    if self.instance_variable_get("@county_delinquent_tax_#{year}").to_f > 0
    if self.instance_variable_get("@county_delinquent_tax_#{year}").to_f > 0

spec/services/neighborhood_services/legally_abandoned_calculation/tax_delinquent_spec.rb:        
       'county_delinquent_tax_2010' => '45',
       'county_delinquent_tax_2011' => '45',
       'county_delinquent_tax_2012' => '45',
       'county_delinquent_tax_2013' => '45',
       'county_delinquent_tax_2014' => '45',
       'county_delinquent_tax_2015' => '0'
       'county_delinquent_tax_2010' => '45',
       'county_delinquent_tax_2011' => '45',
       'county_delinquent_tax_2012' => '0',
       'county_delinquent_tax_2013' => '45',
       'county_delinquent_tax_2014' => '45',
       'county_delinquent_tax_2015' => '50'
AmandaWilsonKC commented 5 years ago

Abby Judah w Legal Aid is going to try to get 2018 data from the County.

buzwells commented 5 years ago

A few files needed to change. I believe I've got this working, but I'm spending some time validating the UI results against the response from the Address API. Based on the comments I saw for the legally abandoned calculation, where all years of tax delinquency beyond three are weighted equally, I moved the time window forward, effectively dropping some of the earlier years.

Will push and deploy after more testing.

buzwells commented 5 years ago

The markers displayed on the map appear to be consistent with the data returned from the address api based on multiple spot checks. I used Postman and the app's queries to validate this, but the handy Address API query UI also allows you to enter addresses and check to see the delinquency (and other) data returned for those addresses: http://address-api.codeforkc.org/.

For purposes of the legally abandoned calculation, it looks like the code was set to walk back through all years of tax delinquency history, even though only the most recent 3 years were weighted in the scoring process. So, while additional years of delinquency won't affect the score, they will be displayed in the popup. I left that as is.

For purposes of the tax deliquency filter, a window of delinquency years was applied. I moved it forward and expanded it to 5 years (2014-2018). As a side note, I was shocked at the number of delinquencies, which produced a map bursting with markers. As an enhancement down the road, we might want to consider using some techniques to manage the clutter and also differentiate between properties with more delinquencies by shape, color or size.

I will push and deploy my changes shortly.

buzwells commented 5 years ago

Code deployed. Closing issue. Feel free to reopen if you encounter problems.