I have a strange issue. I'm parsing the feed into the SOLR index and one of the fields is the latlon (location) field type. Everything works fine, but I've stumbled upon a strange latitude and the longitude data within the feed, so my import into SOLR failed with error:
Bad X value -245.0791883469 is not in boundary Rect(minX=-180.0,maxX=180.0,minY=-90.0,maxY=90.0)
The input was (lat,lon) : -8.1832432059,-245.0791883469
I know that the latitude must be within -180 and 180, and I've made a latitude & longitude validation for those fields which I've skipped. BUT, when I used this service http://www.latlong.net/Show-Latitude-Longitude.html to check this weird latitude and longitude data, I was surprised that they actually converts the wrong latitude input to the correct one (which basically matches the location in my feed, except that I have the wrong longitude). Or I really miss something out... Screenshot:
So I'm wondering if there is some kind of formula to do that? To convert latitude/longitude values out of regular boundaries?
Thanks
EDIT:
Solved. If any of you stumble across this problem, the really simple solution is to add/subtract the 360 from a longitude. Some feeds have a full 360 degrees longitude radius, and to convert those to 2D points - longitude value less than -180 will have 360 added to it, and a longitude value greater than 180 will have 360 subtracted from it. This works of course if the longitude and latitude as a pair is not obsolete.