I got those new amenities into my D&L trail amenities database — it was a piece of cake, once the data was cleaned up. The whole process went smoothly, even the main database report (done through Jaspersoft Studio, which can be a pain in the neck to work with) digested the new information without any glitches.
But I couldn’t leave well enough alone after that: I decided to add the amenities between Allentown and Northampton where the trail is incomplete. My original feeling was that the trail would be too vague through here — where are the “access points,” the intersections between the trail and the wider world’s road network, if you’re riding on the roads and there is no specific trail? But I’ve been riding this section a bit more lately, since it’s not been inundated with users like other sections, and discovered that much of it is only “unfinished” in the sense that it’s not up to the specifications of the rest of the D&L; it’s perfectly rideable on a mountain bike, and actually more fun than the more polished sections. If you don’t mind riding the rougher stuff there’s not much trail missing, and the remaining road portions are remote enough that there’s no need to worry about nearby amenities.
So, I repeated the process for the incomplete section: identify trail access points, import amenities from OpenStreetMap (and then clean them up, by far the most laborious part) and finally tie access points to amenities using that routing distance matrix script. Again, it worked like a charm.
…and then I started thinking about what I might want for output. That Jasper Studios report is nice, but the current output is a PDF — ugh, not very net-friendly — and I thought it might be nicer to get a more straightforwardly data-oriented output, something I can massage and format as necessary in a browser, something like JSON. Unfortunately, though Jaspersoft can do JSON output, I couldn’t quite figure how to get it to do what I wanted. Postgresql, the database I’m using, has JSON capabilities of its own, and final-product-straight-from-the-database seems like a better approach, but I didn’t know much else about those capabilities, so I sat down over the past few days and doped it out. The learning curve was pretty steep, more like a brick wall, and my code is pretty convoluted but I did get it to work. Of course, this success is just a lead-in to another escalation: if I want a web page I now have to code out the rest of the stack.