The MS SQL Server SqlGeography type represents data in a geodetic (round earth) coordinate system.
Questions tagged [sqlgeography]
264 questions
2
votes
1 answer
recursive geometric query : five closest entities
The question is whether the query described below can be done without recourse to procedural logic, that is, can it be handled by SQL and a CTE and a windowing function alone? I'm using SQL Server 2012 but the question is not limited to that…

Tim
- 8,669
- 31
- 105
- 183
2
votes
1 answer
Creating a sqlGeography LINESTRING using .NET
I am building an application that parses a variety of external map file formats (i.e. ShapeFiles, MapPoint, KML, etc.) and stores the shapes in a centralized database that will be used for a central mapping / reporting base. I have a routine that…

Chet at C2IT
- 549
- 6
- 21
2
votes
1 answer
SQL Server 2008 Spatial Query performance
I have an application where user's store their commute routes in our database.
The routes are stored as polylines (linestrings).
The database also stores incidents, traffic accidents that kind of thing.
Periodically we need to query a route to see…

CianM
- 397
- 5
- 17
2
votes
1 answer
SQL Summarize and Average
I am fairly new to SQL Server, .NET and MVC 3/4, so please bear with me. I had created a query in Linq-to-SQL that returned the data I needed, but unfortunately my host provider does not support the DbGeography class, specifically the…

Don P
- 570
- 1
- 5
- 12
2
votes
1 answer
Calculating distances between two tables full of GEOGRAPHY points
I'm using SQL Server.
I have two tables like this:
Table1:
Column1, Column2, Column3, GeoLoc
-----------------------------------
a b c 0xE61...
Table2:
Column1, Column2, Column3, GeoLoc
-----------------------------------
a …

Waller
- 1,795
- 4
- 18
- 35
2
votes
1 answer
What Big Data product or platform can I use to store geographical data?
I'm looking for a Big Data solution for storing records with geographical locations (Lat/Lng), and then performing a proximity search.
For instance, storing all buildings in a database, and then querying it for the buildings closest to the user's…

Dor Rotman
- 1,511
- 1
- 15
- 27
1
vote
1 answer
Converting Geometry to a Geography yields an Invalid shape
I have two Geometry shapes of types Polygon or MultiPolygon [with Lat & Lng points] that I want to get their intersected shape.
I do this as follows:
land_shape.STIntersection(grid_shape) as shape
Then, I check to see when
shape.STIsValid() = 1 and…

HR1
- 487
- 4
- 14
1
vote
1 answer
SqlGeography.STGeomFromText throw exception when creating Polygon
During creating Polygon it throws execution. I am using library Microsoft.SqlServer.Types latest version 160.
polyText = "POLYGON ((
45.3972179 8.8406638000000157,
45.4215054 8.9151509000000715,
45.4001544 8.9361126999999669,
45.4016369…

Kamran Musayev
- 13
- 5
1
vote
1 answer
How to measure distance between two Points in metres with NetTopologySuite / ProjNet (2022)
This question has been posted multiple times before but the answers no longer appear to match the method signatures available in the latest NuGet packages.
After spending days trying to piece together an answer from other places (1, 2, 3, 4, 5, 6,…

EvilDr
- 8,943
- 14
- 73
- 133
1
vote
1 answer
SqlGeography does not implement IComparable interface, preventing DataSet.RejectChanges() from succeeding
I'm working on an Enterprise application that has an SQL backend, and uses System.Data.DataSet etc to represent that data in C#.
Previously we turned the SqlGeography into DbGeography before putting it in our DataTables, and everything worked, until…

Patashu
- 21,443
- 3
- 45
- 53
1
vote
2 answers
Move coordinates a set distance in meters
In SQL Server I want to be able to take a single latitude and longitude (51.500709, -0.124646) and move these coordinates 50 meters north, but I'm not sure how to do this. I am aware of the geography spatial data type and have used the STDistance…

CGarden
- 169
- 17
1
vote
1 answer
SQL Spatial / Issue With Incorrect Or Inconsistent Polygon Data
I am working on implementing a polygon accumulation process for an Insurance company. I'm importing GeoJSON data into SQL and transforming into a table that I can later link to a series of lat/long points.
I'm running into lots of trouble with the…

ccdrm
- 300
- 2
- 9
1
vote
1 answer
Errors converting Geometry to Geography
I am getting an error trying to convert data from a Geometry field to a geography field in a separate table.
INSERT INTO PIGeoData
([ID], [geo_name], [geo_wkt] ,[port_geography_binary] )
SELECT [id], [name] ,[wkt],…

Feargal Hogan
- 169
- 1
- 8
1
vote
1 answer
Convert XAML to ShapeFile or SqlGeometry formats
I have some XAML based diagrams that consist of Paths embedded in Canvas objects e.g.
1
vote
1 answer
pyodbc ERROR - ('ODBC SQL type -151 is not yet supported. column-index=16 type=-151', 'HY106')
I'm working on automating some query extraction using python and pyodbc, and then converting to parquet format, and send to AWS S3.
My script solution is working fine so far, but I have faced a problem. I have a Schema, let us call it SCHEMA_A, and…

Pj-
- 430
- 4
- 14