Questions tagged [sqlgeography]

The MS SQL Server SqlGeography type represents data in a geodetic (round earth) coordinate system.

264 questions
0
votes
1 answer

Filter list of points using list of Polygons

Given a list of points and a list of polygons. How do you return a list of points (subset of original list of points) that is in any of the polygons on the list I've removed other columns in the sample tables to simplify things Points Table: |…
Mayoweezy
  • 537
  • 1
  • 8
  • 21
0
votes
1 answer

Find Segments lying inside another using Geography points SQL Server

Let me explain the attached picture Yellow line termed as Construction Planning identified by Planning Id and all other colors termed as Construction Segment identified by SegmentId. I am trying to use STDistance function of Geography Points to find…
Souradip Roy
  • 300
  • 2
  • 12
0
votes
2 answers

Why simple sql geography polygon fill whole Earth?

I'm trying to create a geography polygon in sqlserver: declare @poly geography = geography::STGeomFromText('POLYGON ((37.1834472346309 55.9627364130318, 37.1843162703518 55.9615689125515, 37.1847990679744 55.9603833217405, 37.1861294436458…
0
votes
0 answers

EntityType 'DbGeography' has no key defined on EF6

I've checked various posts about this, but my problem is not solved. I am using EF6, so my namespace is System.Data.Spatial, my reference is System.Data.Entity and still I get this error: Geocoder.DbGeography: : EntityType 'DbGeography' has no key…
YSFKBDY
  • 735
  • 1
  • 12
  • 38
0
votes
1 answer

Getting Errors Trying to Load SqlServerSpatial140.dll

I am using SqlGeography in a project that was working but now is not. The only thing that has changed that I can think of is that Windows 10 did an update to my PC but I am unsure that that is the source of the problem. I used NuGet to remove and…
SezMe
  • 527
  • 8
  • 24
0
votes
1 answer

unable to set value for geography data type in sql server

I am trying to run a query that sets the geography and geometry data types in a sql table. The geometry value is being set but not the geography field. Thanks for your help. query: DECLARE @g GEOMETRY; SET @g = geometry::STGeomFromText('POLYGON…
NickyLarson
  • 115
  • 1
  • 2
  • 18
0
votes
1 answer

SQL Server 2016 - Updating microsoft.sqlserver.types

Currently using SQL Server 2016: Microsoft SQL Server 2016 (RTM) - 13.0.1601.5 (X64) Apr 29 2016 23:23:58 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows Server 2012 R2 Standard 6.3 (Build 9600: ) (Hypervisor) I check to…
bdcoder
  • 3,280
  • 8
  • 35
  • 55
0
votes
0 answers

SqlGeography.STPolyFromText - Throws Error 24201: Latitude values must be between -90 and 90 degrees

when I am converting polygon text to sqlGeography object I get error "24201: Latitude values must be between -90 and 90 degrees." Polygon example which throws error: POLYGON((58.197682 -151.896133,58.26688 -151.839327,58.256878…
Drasius
  • 825
  • 1
  • 11
  • 26
0
votes
1 answer

STContains - tests failing for points INSIDE polygon

First, SQL version: Microsoft SQL Server 2016 (RTM) - 13.0.1601.5 (X64) Apr 29 2016 23:23:58 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows Server 2012 R2 Standard 6.3 (Build 9600: ) (Hypervisor) I declare a single closed…
bdcoder
  • 3,280
  • 8
  • 35
  • 55
0
votes
1 answer

SQL Server Geography datatype: weird behavior

I have an application that has been running for years now with no issues. Recently I decided to add a Geography type column to one of the tables, application uses. After doing so, the website on production server started acting up: weird null…
Dimitri
  • 6,923
  • 4
  • 35
  • 49
0
votes
1 answer

Entity Framework 6 and Geography data STContains

I've included Microsoft.SqlServer.Types to enable the geography and geometry types in Entity Framework, but I don't see any functions equivalent to STContains(). I need to make a query to retrieve the geography that contains a point In SQL I wrote…
Giox
  • 4,785
  • 8
  • 38
  • 81
0
votes
1 answer

left hand/foot rule in SQL Server 2016

I have seen that SQL Server uses left hand/foot rule while creating polygons. But the articles I have read are talking about SQL Server 2012 and I am not sure if it's the case with SQL Server 2016 as well. Do we have to start specifying the points…
Sree
  • 973
  • 2
  • 14
  • 32
0
votes
1 answer

SQL Server Why is geography::Point inside function non-deterministic?

I store Latitude and Longitude (float null) data from the user, and want to create a persisted computed column of Geography data type based on these values (with the intention of using a spatial index on this column). The computed column formula…
Nick
  • 685
  • 12
  • 27
0
votes
1 answer

CPU usage goes to high when only 20 simultaneous users insert tracking data into geographical table

We have live tracking application in which we are inserting tracking point to one table called Tracking. We have another table called ExistingAddressPointTable where we have delivery address. We are considering particular address as delivered when…
0
votes
0 answers

Using varables in sql spatial data

I am attempting to write an sql stored procedure that will determine if a point is within a buffer. So far I have been able to hard code the values in the query and they work as expected but when I attempt to replace the hard coded values with…
joebohen
  • 145
  • 1
  • 14