SQLTeam.com | Weblogs | Forums

GEOFence intersect issue in sql server

declare @g geography,@Geo geography;
set @g= geography::Point(77.6146616,13.026475, 4326);
set @Geo=0xE610000002240500000017D9CEF753032A40E0BE0E9C336A5340FAEDEBC039032A40F54A5986386A5340C217265305032A4058A835CD3B6A5340C217265305032A401904560E2D6A534017D9CEF753032A40E0BE0E9C336A534001000000010000000001000000FFFFFFFF0000000003;

select @Geo.STIntersects(@g) 'Reached',@Geo.STDistance(@g) 'Point-To-Geofence-Distance',geography::Point(77.65944979999999,13.0060924, 4326).STDistance(@g) 'Point-To-Geofence-Point-Distance'

@g is a point locating 5356 meter from the geofence(@Geo).
77.65944979999999,13.0060924 is lat-long inside the geofence, but when i run the query,
STIntersects return 1, where it should return 0 as the point is existing far away from the geofence area.

plz help