Hacker Newsnew | past | comments | ask | show | jobs | submit | Bencarneiro's commentslogin

Done


Yes and no- check the new map at roadway.report and toggle the pedestrian view


Y'all said to tippefy it. Thanks to hotgarbo for sending an example of how to do this.


Data included is specifically 2001/01/01-2023-01-01 if that makes a difference.


The data here is processed from NHTSA's FARS database. When someone dies in an accident, it gets input into a STATE reporting system, and FARS is manufactured by analyzing each state's individual record system. The feds consolidate all this data and publish a unified dataset annually. They say it's "a lot cheaper and just as good as collecting it themselves"

Additional errors are potentially produced from my own processing of the federal data, but those will be rooted out over time. Project being OS will hopefully help with that.


If you need help merging additional data sources, this project might be able to assist. I know the folks, and they are motivated to deliver open data.

https://www.data-liberation-project.org/


I noticed seemingly all deaths in Manhattan are labeled as having occurred in flushing, a nearby neighborhood. Perhaps an off by one error?


NYC is no longer called flushing in the DB <3 thank you for flagging this


Thanks for this background. What's the best way to download your data, or the feds data?


Just go to the NHTSA FARS website.. here's the FTP:

https://www.nhtsa.gov/file-downloads?p=nhtsa/downloads/FARS/


Thank you, that is very useful.

In fact, the author of the website "I mapped almost every.." might want to add references to the data sources for credibility and less of a "spam" look. How about an About page.

The splash photos on that website says it all.


Reposted to foil vandals:

So we're slowly forgetting that FTP and HTTPS aren't the same thing.


[flagged]


Yup. The same way "we're" being snarky for harmless absent-minded mistakes for no good reason.


This comment is pure useless snark.


That's the point. I'm using snark to demonstrate how useless using snark is.

Clever, eh?


So you admit you're being dumb on purpose.

Go away.


OP made a great contribution to the discussion.

Going off on a cynical tangent over protocols is just noise, and adds nothing of value to the discussion.


I mean theoretically everything is a file transfer protocol...


Nice try, but UDP is very much not a file transfer protocol.


short files only, but it is file transfer. of course nothing stops you from doing like tftp and splitting files to reassemble.


I need to look into something called NEMSIS, but no not to my knowledge. Most states have injury records though.


OK holy jeez I think I got the server back up. We now have 8X the ram and I'm not sure how, but we broke postgres....


Not to sure how your backend is set up, but it looks like you're generating GeoJSON on the fly and the JSON serialization for this amount of data can be slow.

In typical HN fashion, I would suggest looking into using Tippecanoe to generate some vector tiles of the data and host that on S3. Then the DB can fall back to performing simple lookups via the accident ID. Filtering by time will need to move to the frontend, but that should be fine (if not, look into clustering the data at further zoom levels).

https://github.com/mapbox/tippecanoe


This is very helpful


I've built quite a few open source mapping projects myself using Tippecanoe and other tools. Feel free to email me if you want help setting this up!


Hi Ben, briefly took another look this morning and I'm sorry for the hasty rec because I forgot Leaflet doesn't support vector tiles as easily as MapLibre/Mapbox.

If the bottle-neck is the DB and you haven't enabled the PostGIS extension, I'd look into that as the other commenter mentioned. If it's your server, then yes look into pre-generating all the tiles and hosting them elsewhere, but this might then mean switching over to MapLibre/Mapbox (which is what most companies end up using because of Leaflet's limitations).

For filtering on the frontend, I'd look into Expressions so you're not regenerating the GeoJSON collection every time (this causes a significant delay and flicker).

- https://maplibre.org/maplibre-style-spec/expressions/

- https://maplibre.org/maplibre-gl-js/docs/examples/hover-styl...


You could also take a look at PostGIS to do geospatial queries (if needed). And in the past I’ve used node-mapnik to render vector/image map tiles. You can indeed host and cache them effectively on S3.


You’ve had some other recommendations already but I’d suggest also looking into FlatGeobuf [0] for this use case. Have a look at the MapLibre example with a 12GB example [1]. You don’t need a server at all (unlike MBTiles) and will be able to load far more points at once than your current solution. Can easily generate it with QGIS/GDAL/PostGIS. Not sure what your plans are for the project but would be happy to donate some time to get something like that working.

[0] https://github.com/flatgeobuf/flatgeobuf

[1] https://flatgeobuf.org/examples/maplibre/large.html


Apologies for the shameless plug but do checkout https://geobase.app We built it with such use cases in mind and solves the scaling issues with geo data driven apps. We are in private beta but happy to give you early access if you hit us up.

We were also recently featured on the motherduck blog https://motherduck.com/blog/pushing-geo-boundaries-with-moth...


I was trying out different time periods (comparing 2003-2013 to 2013-2023, to see a rough trend), and I noticed that every click to change the year by one seemed to generate a refresh. Perhaps it would help to lower the load if you change the date selector widget to only refresh after the date selector is closed.


godspeed, soldier


Remember to increase the buffer pool size to use that ram!


> I mapped almost every USA traffic death in the 21st century

Is your server on that list?

j/k, I’m sorry, I’ll see myself out XD


I'm not a fan of cheap puns, but that was excellent.


Postgres didn't look both ways before stepping off the curb.


Lol ok I'm trying to get home and figure out why it's server error city (yikes)


We appreciate your diligence.

Please enjoy complimentary load death. Would you like that mapped?


It's all from the FARS database


The best I have right now is place and time to find a specific incident, but yes I should be able to get some basic filters up soon


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: