I found a project that is under active development, that generates a very precise shapefile, and figured out how to use it.
I load a database, as opposed to doing shapefile parsing on the fly, for performance reasons.
The magic juice is the domain rect. It’s a superfast triage, that gets us into the ballpark, and then I use a fast winding number test, to get precise.
I think that I could probably do a whole lot to optimize it, but PHP/SQL is not my forte, so I kept it simple. It works great for the manner in which I use it.
The unit tests have a lot of points, close together, on either side of a TZ boundary. The edges are where the Devil lives.