I have an interesting / annoying problem with finding lats and long ground marks inside a rectangular border. I believe that my two points are inside my rectangular border. but since you can test yourself, the result of the first choice is false instead of true!
DECLARE @boundingRect varchar(1000)
DECLARE @maxLat VARCHAR(20)
DECLARE @minLong VARCHAR(20)
DECLARE @minLat VARCHAR(20)
DECLARE @maxLong VARCHAR(20)
set @maxLat ='-36.06631759541187'
set @minLong ='125.23310677812492'
set @minLat ='-44.43329881450396'
set @maxLong='167.04707162187492'
SET @boundingRect = 'POLYGON((' + @minLong + ' ' + @minLat + ', ' +
@maxLong + ' ' + @minLat + ', ' +
@maxLong + ' ' + @maxLat + ', ' +
@minLong + ' ' + @maxLat + ', ' +
@minLong + ' ' + @minLat + '))'
DECLARE @Bounds AS Geography =GEOGRAPHY::STPolyFromText(@boundingRect,4326)
DECLARE @point1 AS GEOGRAPHY = GEOGRAPHY::Point(-37.81502, 144.94601, 4326)
DECLARE @point2 AS GEOGRAPHY = GEOGRAPHY::Point(-38.81502, 144.94601, 4326)
SELECT @Bounds.STIntersects(@point1)
SELECT @Bounds.STIntersects(@point2)
, (lat, long), Google Maps. , . , , , . - ( , ) - (. , ) Google , . , , , .