i have a list of boundaries (polygons) and a list of ways all represented by latitudes and longitudes. i would like to find out if one way is inside a polygon. i do this in perl but cant find anything useful to calculate. Math::Polygon (::Calc) has interesting functions, but not for lat/lon only for x/y.
So im thinking about making it easier and generating a bounding box of each polygon, so its easier for me to check if one point of a way is inside a bounding box.
Does anyone know how the algorithm looks like to get the bounding box. a pseudo code would be enough so i can code it in perl.
It would be even better to check for being inside a polygon without converting a polygon into a bounding box, but i wasnt able to find anything useful on the net. There are some for simple 2d x/y based coordinate systems, but not for spherical lat/lon.