Latitude and Longitude Issue with out of the boundary values
<p>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:</p>

<pre><code>Bad X value -245.0791883469 is not in boundary Rect(minX=-180.0,maxX=180.0,minY=-90.0,maxY=90.0)
</code></pre>

<p>The input was (lat,lon) : -8.1832432059,-245.0791883469</p>

<p>I know that the latitude must be within -180 and 180, and I've made a latitude &amp; longitude validation for those fields which I've skipped. BUT, when I used this service <a href="http://www.latlong.net/Show-Latitude-Longitude.html" rel="nofollow noreferrer">http://www.latlong.net/Show-Latitude-Longitude.html</a>
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 <strong>matches the location in my feed</strong>, except that I have the wrong longitude). Or I really miss something out... Screenshot:</p>

<p><a href="https://i.stack.imgur.com/UU0Pe.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UU0Pe.jpg" alt="enter image description here"></a></p>

<p>So I'm wondering if there is some kind of formula to do that? To convert latitude/longitude values out of regular boundaries?</p>

<p>Thanks</p>

<p><strong>EDIT:</strong></p>

<p>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. </p>