A HUGE bulk of my time today was spent researching out how to best do some geospatial work we need to do before adding a bunch of states. Here are some things I did, found out, etc.
One of the big issues we are concerned about is performance when doing point-in-polygon functions (which is what we use to figure out what regulation boundaries you are in). The no. 1 factor that affects the performance of that calculation is the number of points that make up the polygon. So naturally, we have to worry about things like the Florida State boundary that has 1m+ points to make up the polygon. Likewise, lakes are an issue too. There’s an algo to help with this: The Ramer–Douglas–Peucker algorithm. Fortunately, there are plenty of tools that use this and other algos to make this easy, here’s some of them:
QGIS is an open-source alternative to something like ESRI’s ArcGIS. For our purposes, it does the job well enough. I did some prototyping with it today and I think we’ll get to do all the things we need it to do (the interface is pretty old-school and clunky but that’s the price for not paying for ESRI I suppose)
One issue with boundaries around lakes: The user isn’t necessarily inside the lake boundary. He/she could be standing on the shore just outside of it, or in the parking lot next to the lake. If users are checking regulations in the parking lot, they won’t necessarily be inside the regulation boundary. We could use a “nearest” boundary function but there are some issues with that and it’s not nearly as precise. One great feature in QGIS (And other GIS solutions) is called “Buffering”. Here’s a video on how to do it in QGIS. This allows us to grow the border of the lake slightly larger to encapsulate surrounding areas.
A lot of states have really crazy jagged points (e.g. Arkansas, Mississippi). We’re going to have to come up with our own boundaries on these so performance is fast. Current thinking is we’ll have polygons that span the states, on these lines or rivers, so users that aren’t inside them won’t have to take the additional performance hit when we check along those lines.
Some other tools and misc. links of interest around this
This is an archived post, some things might not display right.
Copyright © Rick BlalockView Archive