The MS SQL Server SqlGeography type represents data in a geodetic (round earth) coordinate system.
Questions tagged [sqlgeography]
264 questions
1
vote
0 answers
Geography column not generated from SP in EF 5
I'm having an issue with Entity Framework 5 and a stored procedure in my SQL database. I have a stored procedure that returns two VARCHARs, two INTs, and a GEOGRAPHY. When I generate the EF model from the DB only the first four columns are generated…

Joel H.
- 11
- 2
1
vote
2 answers
c# SqlGeography latitude & longitude unexpected behavior
Microsoft.SqlServer.Types.SqlGeography.ToString has unexpected behavior.
Take a look at my unit test:
latitude = 40.584474F;
longitude = -111.633491F;
var location = SqlGeography.Point( latitude, longitude, 4326 );
var point =…

Gunnar
- 339
- 2
- 13
1
vote
0 answers
SQL, How to improve the speed of STGeomFromText and STDistance in this query?
I am trying to get the geo distance using query but it seems to be very slow (taking about 10 seconds on a table of 15k records). Is there a way to improve this?
select count(contact_id) from matcher_contact
WHERE…

Vibol
- 615
- 1
- 8
- 25
1
vote
3 answers
Intersecting many Points with many Polygons
I have two tables in SQLServer 2014, one with ~100M points and one with ~2000 polygons.
Each point intersects with only one of the polygons. The task is to assign the ID of the intersecting polygon to the point.
What is the best practice to do it?
I…

Michael
- 1,627
- 1
- 19
- 29
1
vote
1 answer
What type OData Edm.GeographyPoint refers to in a SQL Server database
Which column type refers to OData Edm.GeographyPoint in a SQL Server database? There is no explanation how can we use this type while integrating with SQL Server?

Arda Güçlü
- 728
- 2
- 6
- 27
1
vote
1 answer
SQL Server Geography type creates multiple types for the same variable
I am starting to use the Microsoft SQL Server Geography datatype. Everything is ok but there is a small problem I ran into.
I started by creating a table (ClientId is not actually primary) routes with 2 columns: ClientId (int) and Zone…

Albert Zakhia
- 99
- 1
- 6
1
vote
0 answers
SQL Server Spatial Types
I'm trying to create a SpatialObject in C# and pass it to my SQL Server database via a
DataSet, but I can't figure how to pass it to the DataSet :/
When I try to add the element to the params of DS it just get as param
CONVERT(geography, '')…

Kross
- 97
- 1
- 10
1
vote
1 answer
SQL Server 2012 geography STIntersects understanding
I am trying to get all the points inside the polygon and after a few tests I finally caught.
STIntersects always return 1 for all my entities even in cases when a point "visually" not in a polygon.
I have found posts about polygon creation…

taburetkin
- 313
- 3
- 17
1
vote
1 answer
How to add value to geography datatype column?
I am trying insert a record in t-sql as below. I am struck in adding a value to a geography datatype column.
This is a value for geography:
data = 0xE6100000010C8FE4F21FD26F49406002B7EEE6A9E13F
Please advise me how to add value to geography value…

Tun
- 824
- 3
- 16
- 30
1
vote
1 answer
Add Geography.Lat/Long to View with the designer
I am currently working with some GIS data and using the Geography data type in MS SQL Server 2012. I am having some difficulty when trying to display the Latitude and Longitude of the Geography type using the View designer, specifically if I have a…

Nathan
- 25
- 9
1
vote
1 answer
Django model creating geography not geometry fields
I have a Django model in which i declare maplocation = models.PointField() I'd like to work with geography not geometry, if i use python manage.py sql it maps as "maplocation" geometry(POINT,4326) NOT NULL,
what do i need to do so that the…

liv a
- 3,232
- 6
- 35
- 76
1
vote
1 answer
Lat & Long Geography Radius Query
I am trying to find the stores within X radius of a users lat & long. I have read quite a few questions, answers, and articles on the topic. My results don't have to be pin point accurate but false positives as you might get with the filter on a…

GPGVM
- 5,515
- 10
- 56
- 97
1
vote
1 answer
Unable to use geography data type with Azure Cloud Service
I have a problem trying to use SQL Server geography data type with an Azure Cloud Service. I have followed the instructions available at http://alastaira.wordpress.com/2011/08/19/spatial-applications-in-windows-azure-redux-including-denali, but,…

Marco Minerva
- 812
- 5
- 13
1
vote
1 answer
geography queries in T-SQL: using indexes
Let's say we have a database of Birthday Clowns that contains a geography column containing the binary representation of a Point where each clown is located (generated from the latitude and longitude of the clown's home address). There's a geo-index…

Tim
- 8,669
- 31
- 105
- 183
1
vote
0 answers
Cannot call methods on varbinary Using SQL View & Geography
Select
r.Id,
r.Date,
r.Position.Lat Lat,
r.Position.Long Lng,
r.DriverId,
r.VehicleId,
--IsNull(t.DriverId, r.DriverId) DriverId,
--v.Name GroupName,
l.Name LayerName
From
Operation.vw_AllRecord as r --The…

user22410
- 11
- 3