Questions tagged [sql-server]

Microsoft SQL Server is a relational database server product by Microsoft. Its primary query languages are T-SQL and ANSI SQL.

Filter by
Sorted by
Tagged with
32 votes
4 answers
7k views

When should you NOT use a spatial index?

I am asking this because I was mainly working with Oracle but for the past year I've been doubling with PostGIS and SQLServer 2008. Most spatial functions in Oracle won't work without a spatial index ...
mapoholic's user avatar
  • 2,360
30 votes
4 answers
99k views

Create a geography/geometry column from x and y fields - SQL Server 2008

I'm new in SQL Server 2008 and I hope you will understand my question/need. Thus, I have a table which contains 3 fields (Name, Lat and Long) in my data base (spatial). I want to create a geometry/...
Tudor's user avatar
  • 331
26 votes
4 answers
30k views

Is it possible to reproject spatial data using SQL Server?

SQL Server takes an SRID when creating spatial data, but is it possible to retrieve with a different SRID translating the coordinates? For example, let's say I have a bunch of spatial polygons using ...
Rowland Shaw's user avatar
21 votes
9 answers
36k views

Choosing database for storing spatial data?

A couple of days ago I installed the demo of spatialware 4.9 from MapInfo into my SQL Server 2005 install and loaded all the larger dataset into it. I was quite impressed with the performance vs the ...
Nathan W's user avatar
  • 34.6k
17 votes
3 answers
58k views

How I get SRID from Geometry field

What is the function for getting SRID from Geometry field. I have inserted a shapefile into SQL Server table with a Geometry field defined. I know the projection of shapefile is Swreff99_1800 (EPSG:...
user1899's user avatar
  • 1,427
16 votes
3 answers
4k views

Optimize nearest neighbor query on 70 million point cloud on SQL Server 2008

I have about 75 million records in a SQL Server 2008 R2 Express database. Each is a lat long corresponding to some value. The table has geography column. I am trying to find one nearest neighbor for a ...
Shaunak's user avatar
  • 999
16 votes
1 answer
2k views

sql server spatial index performance

I have a table with around 2 million records in it. I create a spatial index, using the defaults other than the bounding box. I've been noticing that some queries are extremely fast, and some are ...
mdm20's user avatar
  • 261
15 votes
5 answers
9k views

Using ArcGIS Desktop with SQL Server Spatial as backend?

I'm wondering how best to use ArcGIS Desktop and SQL Server 2008 together. At the moment we run manual imports and exports between sql 2008 and arcgis 10 shape files. With sql 2008 having a geography ...
Michael's user avatar
  • 185
15 votes
3 answers
24k views

How to convert from SQL Server geometry BLOB to something else?

I have a CSV data file from a 3rd party that is an exported SQL Server table. They simply did a select * from foo and output the result to a text file and sent it over. In their table is column of ...
Peter's user avatar
  • 151
15 votes
2 answers
6k views

How can I fix my complex Polygons so they show correctly in Google Maps?

Problem: I'm trying to find a way to fix some broken polygon shapes and I'm not sure how I can do this. Details: I've got a number of polygons which I basically imported from TIGERLINES a while back....
Pure.Krome's user avatar
  • 1,793
14 votes
15 answers
3k views

What GIS editors work with GIS data that is stored in SQL-Server

If I store my vector GIS data in SQL-Server, what editors can I use to edit the GIS data?
Ian's user avatar
  • 549
14 votes
8 answers
16k views

How can I use SQL Server's spatial types from a .Net application?

For an upcoming project, one of the requirements is to store and use basic geogrpahic data as part of an existing SQL-Server/.Net application. It seems obvious that we could use the SQL Spatial types,...
Rowland Shaw's user avatar
13 votes
1 answer
16k views

Importing shapefiles to SQL Server [closed]

I often use the brilliant SQL Server 2008 Spatial Tools to import shapefiles into SQL Server 2008. This works absolutely fine but it leaves me wondering, how do Microsoft expect end users of SQL ...
Tumbledown's user avatar
  • 1,683
12 votes
1 answer
9k views

Updating field to give count of points in polygon using STIntersects?

I have a points layer (dbo.ptLayer) Around 1M points Spatial Geometry Type (dbo.ptLayer.geom) No spatial index just yet, but will create one once data gathering complete. I have a polygon layer (dbo....
jakc's user avatar
  • 9,858
12 votes
2 answers
4k views

Needing ArcGIS Server to edit MS SQL Server database?

Here is what I have: ArcGIS Desktop Advanced (10.2) & MS SQL Server 2008 R2 Here is my problem: I need to be able to connect to the ms sql server and import, export, create, and edit spatial ...
Brain's user avatar
  • 129
12 votes
2 answers
31k views

Find closest lat long to an input lat long (SQL Server 2008)

I have a point cloud in my database (SQL Server 2008 spatial). That is about 6 million records. There are 3 columns: id, value, geom. What is the optimal way of getting the 'value' at input lat long?? ...
Shaunak's user avatar
  • 999
12 votes
4 answers
5k views

Inserting points into SQL Server using pymssql?

I am collecting X and Y values from a web service (Twitter) via a python script. In the long run, this will run over a period of months and I intend on stopping at around the 6 million point mark. ...
jakc's user avatar
  • 9,858
11 votes
3 answers
962 views

Searching many feature datasets for ArcSDE feature classes using field filters in ArcCatalog?

I have ~30 feature datasets and ~100 feature classes spread throughout the feature datasets. I would like to search for a feature class by name among the feature datasets. Also, I would like to ...
Justin's user avatar
  • 3,400
11 votes
2 answers
2k views

Why is SQL Server 2019's STDistance Very Slightly Different Than The Vincenty Formula? (Same Up To ~0.0001km)

I'm trying to make a C language equivalent to STDistance. Through research, I've narrowed down what STDistance uses, which apparently is the (inverse) Vincenty Formula. The problem is, I've tried ...
MJT's user avatar
  • 113
10 votes
3 answers
35k views

MSSQL Connection settings for QGIS on Windows

OK first lets get the blond elements out of the way- I'm not asking for how I connect to my actual database. What I'm asking for is an example or screen shot of the entries required when setting up a ...
Richard Colwill's user avatar
10 votes
4 answers
20k views

SQL Server - Select all polygons nested within a larger polygon

This is a seemingly simple SQL Server geometry question that I thought would have an out-of-the box solution, but I'm not having any luck finding one. My intent is to select all the records within ...
baobobs's user avatar
  • 411
10 votes
2 answers
1k views

Find duplicate vertices in SQL Server geometry line (ArcSDE)

I have a line in a ZM polyline featureclass that has a invalid geometry. My suspicion is that the line doubles back on itself somewhere, which I've found SQL Server doesn't like. Anyone know of a ...
Chad Cooper's user avatar
  • 12.7k
10 votes
2 answers
12k views

ArcGIS Server Error: "Feature service requires a registered database"

I'm attempting to publish a feature service to ArcGIS server. I'm running SQL Server Express and ArcSDE. When I try to publish the service I get the error "00090: Feature service requires a registered ...
Radar's user avatar
  • 10.7k
10 votes
2 answers
958 views

How do I perform a 3 parameter geotransformation and projection in Sql Server 2012?

I have a table with latitude longitude (NAD27) columns in it. I compute two other columns, X and Y, representing Web Mercator (WGS84) location. Currently I'm using a Arcmap to do this, by applying ...
Kirk Kuykendall's user avatar
10 votes
4 answers
3k views

ArcGIS 10.2 Query Layer on SQL Server performance

I'm using a Query Layer on SQL Server in ArcMap. The Query Layer executes instantly in in SQL Server but but takes so long to draw in ArcMap that the system appears unresponsive for about 10 minutes ...
Eamonn Doyle's user avatar
10 votes
2 answers
2k views

Can Mapnik render spatial data from SQL Server?

This is a very simple question - I just want to know if anybody can confirm that they have successfully used Mapnik to render tiles directly from data held in SQL Server. (And, if so, what did you do ...
Alastair Aitchison's user avatar
9 votes
4 answers
1k views

What is spatial query tool for laymen?

I know nothing about GIS, but I have what I think is a GIS problem. From spending a few hours googling my problem, I think what I need to do is perform a spatial query, but I'm not sure how to go ...
Elbelcho's user avatar
  • 193
9 votes
4 answers
694 views

MS SQL Spatial as Central Datastore?

I've been working on opening up our spatial data from a proprietry system to one that can be read by more products (MapGuide, ESRI, gvSIG, Map3D etc....) I've decided on using SQL Spatial as we have ...
Jamo's user avatar
  • 1,457
9 votes
2 answers
11k views

Optimizing Geometry.STIntersect Query

I am attempting to move simple Geoprocessing routines from ESRI based processes to SQL Server. My assumption is that it will be far more efficient. For my initial test I am working on an intersection ...
Rick Monteiro's user avatar
9 votes
1 answer
1k views

SQL Server Relationships in ArcSDE?

I am running ArcSDE 10 with SQL Server 2008 R2 Standard Edition. I am new to SDE and SQL Server, but I understand that SQL Server has the ability to create relationships between tables and maintain ...
Brian's user avatar
  • 4,209
9 votes
1 answer
3k views

"Driver not loaded Driver not loaded" when trying to connect to MSSQL database in QGIS 3.8 on MacOS

When trying to create a new MSSQL Connection, I get an error saying: Error opening connection: Driver not loaded Driver not loaded. I have tried both QGIS 3.8.0 and the newest pre-compiled QGIS 3.8.1 ...
Daniel James's user avatar
9 votes
4 answers
7k views

Downloading entire OSM world dataset and import into MS SQL

I am trying to download the entire dataset of OSM and placing into a MS SQL Database. Does anyone have any ideas of how to go about that?
ABaut's user avatar
  • 101
9 votes
2 answers
21k views

Geoserver SLD using PropertyIsEqualTo And PropertyIsLike

I have two SLD rules one using PropertyIsEqualTo and another using PropertyIsLike Using PropertyIsEqualTo <Rule> <Name>Vendor FirstVendor</Name> <...
kinkajou's user avatar
  • 4,396
9 votes
2 answers
14k views

Fastest strategy for proximity searches in SQL Server

I am using SQL Server 2012. I'm implementing a back end for a mobile app which will have to do proximity searches to find nearby POIs (points os interest). I know it's a very common scenario and looks ...
Loudenvier's user avatar
9 votes
3 answers
15k views

How can we generate GeoJSON from SQL data with latlong

Is there any way we can create GeoJSON from SQL server table with Latitude & Longitude Data?
Pragnesh Patel's user avatar
9 votes
1 answer
4k views

add new SRID to sql server

Is it possible to add a new SRID to sql server 2012? I've tried insert into sys.spatial_reference_systems values (4938, 'GEOCCS["GDA94",DATUM["Geocentric Datum of Australia 1994",SPHEROID["GRS 1980"...
Daniel Powell's user avatar
9 votes
5 answers
17k views

Convert Sql Server Spatial data to GeoJSON & plot on map

I have a sql server table with Geo spatial data. An example of row would be (with Column names): type: streetline code: 231001 geog: 0xE6100000011 ........ Centroid 0xE61000000C....... geom: ...
moh's user avatar
  • 101
8 votes
4 answers
4k views

Import SQL Server Spatial Data into PostGIS

Is there a free tool to import SQL Server spatial data into PostGIS? Specifically I want to be able to provide connection strings to my SQL Server and PostgreSQL instances, specify the table(s) I ...
FunkMonkey33's user avatar
8 votes
2 answers
4k views

Understanding Geodatabase Archiving and H tables in ArcSDE?

We have ArcSDE 10.0 on MSSQL 2008 with Geodatabase archiving enabled. In the process of updating a topology I deleted the topology, disabled archiving, unregistered as versioned and then recreated ...
Justin's user avatar
  • 3,400
8 votes
2 answers
4k views

How to use the ESRI JS API to map SQL Server Spatial Types without ArcGIS Server

I have heard of people using the ESRI Javascript API to create webmaps with spatial data from SQL Server or other RDBMS's. From what I can tell, they are not using ArcGIS Server as a middleware. In ...
Brian's user avatar
  • 4,209
8 votes
2 answers
5k views

Does SQL Server need extensions to do spatial?

Does SQL Server need extensions to do spatial like Oracle does? Just wondering if there will be extra costs for implementing a SQL Server backend to SDE.
zarb's user avatar
  • 81
8 votes
2 answers
855 views

Can't open ArcCatalog Database Connection SQL database Tables with field names greater than 31 characters

I am using SQLEXPRESS as a test environment. I have a database connection in ArcCatalog to a SQL database. Some tables in the SQL database have field names greater than 31 characters and these ...
user22816's user avatar
8 votes
3 answers
2k views

Are large companies successfully using SQL Server GeoSpatial functionality?

I am working on a project where I have to allow users to find things that are near by. In the past I have just manually stored lat/longs and done my own calculations but I'm curious if it's worth ...
Abe Miessler's user avatar
8 votes
2 answers
316 views

Given two lat/longs, how can I tell if they are within 1 mile of each other?

I'm trying to implement a very efficient check to see whether two points are within a mile of each other, or not. My current approach is to compute the Haversine distance, and then check to see if it'...
JosephStyons's user avatar
8 votes
2 answers
1k views

Storing SRID:4326 data as Geometry or Geography?

I used OGR2OGR to import SRID 4326 point data into MSSQL Server. Didn't realize that it defaults to creating a geometry column instead of detecting the data as 4326 and creating a geography column. ...
user28525's user avatar
7 votes
2 answers
3k views

How to set up an ArcMap Relate with a table from MS SQL Server 2012

This is my first time working with data directly from MS SQL Server 2012, and I'm unsure whether I can use it in a Relate in ArcMap. I have a table in MS SQL Server, which I brought into ArcMap via ...
Stephen Lead's user avatar
  • 21.1k
7 votes
3 answers
4k views

Determine if a polygon intersects itself in OpenLayers

I let the users draw polygons and then I try to save them out to the SQL Server 2008 SQLGeography field, but it is giving me an error: Error 24200: The specified input does not represent a valid ...
Eric Packwood's user avatar
7 votes
2 answers
2k views

Spatial metadata table in SQL Server 2008

I have a db and want to know if it contains any spatial tables. Is there a table in SQL Server that holds spatial metadata i.e. a list of all the spatial tables in the current db? Oracle has the ...
mapoholic's user avatar
  • 2,360
7 votes
3 answers
4k views

When to store geometries using SQL-server geometry datatypes or ArcSDE?

With the release of SQL Server 2008 Microsoft added geometry data types. So geometries can now in an ESRI enviroment be either be stored using SQL-Server datatypes or ArcSDE datatypes. A colleague ...
MathiasWestin's user avatar
7 votes
1 answer
5k views

Does a high number of SDE_state_lineages slow performance?

In our SDE database, the SDE_state_lineages table has around 200,000 records, the SDE_states has around 900, and our SDE_versions table has around 1,300 records. We've been having performance issues ...
geogeogeo's user avatar
  • 581

1
2 3 4 5
19