I am working with GPS tracks (lat/lon values) and my goal is to compute the minimum bounding box for a small geospatial library I am working on. The datasets are not huge, maybe a couple of tens of thousands of points. I could not find an algorithm that deals with tracks/datasets crossing from -180 to 180 lat or lon. Does anybody have pointers to algorithms?
To sum it up very simply, what I am looking for is:
- Input: (lat/long)* [possibly tens of thousands of GPS points, potentially crossing 180/-180 boundary)]
- Output: (lower-left, upper-right) of the minimal box containing all points
The background for me is that I need the bounding boxes to initialize map viewers, in particular when there is more than one track displayed on a map.