(no title)
geokon | 24 days ago
It's cool to see sleek projects like this. I made an application that needed to make heatmaps, but I just made a grid of colored squares and cropping some GeoJSON contours and I ended up generating SVGs .. A bit goofy reimplementing a mapping library, but I needed to do some heavy math, so this way it was all JVM code
ahmedoo|24 days ago
Your project sounds really cool, I'd love to read that code. The implementation in this project largely utilises Leaflet's GeoJSON layers (https://leafletjs.com/examples/geojson/) which does render out to SVGs (there's an optional canvas renderer, too). One of the trickier parts was figuring out how to layer each isochrone band so that those closest to the point (i.e. 15 minute band) were painted on top of the bands further away (https://www.geeksforgeeks.org/dsa/painters-algorithm-in-comp...). That and pre-computing the distances per NYC intersection across the tri-state area which required a lot of messing around with OpenTripPlanner configuration files, GTFS data, and parallelising the code to finish in a reasonable time span (few days).
geokon|21 days ago
- The gridded data inputs are all "normalized" to GeoTIFF files (you can using gdal and convert netCDF files easily)
- The Java standard library can handle simple GeoTIFF images with BufferedImage
- I do some math of the BufferedImage data and then plot the results using the thing/geom heatmap plot
- Just heatmaps on their own are kinda confusing. You need another layer so you can visualize "where you are". Here I plot coastlines. (you could also do elevation contours)
- There I have contours/coastlines as GeoJSON polygons. With `factual/geo` you can read them in and crop them to your observed region using `geo.jts/intersection`. You can then convert these to a series of SVG Paths (using `thing/geom` hiccup notation) and overlay it on the heatmap
> and parallelising the code to finish in a reasonable time span (few days)
Oh wow.. so you have a precomputed database!