12
votes
MSSQL Connection settings for QGIS on Windows
In 2.16... (some really basic information I struggled to find and a note about an unhelpful error message)
The 'Connection Name' is a name for our own use.
The 'Provider/DSN' field can be left blank....
11
votes
Accepted
Why is SQL Server 2019's STDistance Very Slightly Different Than The Vincenty Formula? (Same Up To ~0.0001km)
SQL Server's STDistance function does not compute geodesic distances. Its algorithm essentially generates straight lines in 3D, densifies them and maps them on the ellipsoid in a manner described more ...
10
votes
Create a geography/geometry column from x and y fields - SQL Server 2008
SQL Server 2012
You can do it like this,
SELECT geography::Point(lat, long, 4326)
For more information see my post on Database Administrators, "SQL Server Point Constructor or version of ST_Point(x,...
9
votes
Accepted
SQL Server - Select all polygons nested within a larger polygon
In theory the queries that you have done should return the polygons you said haven't been returned. That makes me suspect that you might be encountering floating point error issues that SQL Server ...
9
votes
Accepted
enable enterprise geodatabase error
A google on "ArcGIS READ_COMMITTED_SNAPSHOT ALLOW_SNAPSHOT_ISOLATION" returned a "What's new in ArcMap" 10.4 documentation reference. In the Geodata section it states (third bullet, emphasis mine):
...
9
votes
Accepted
Using the MOD expression on an SQL Feature Class is not possible?
The mod keyword is not recognised by SQL Server. For modulo function, you'll need to reformat the expression like so:
contour % 50 = 0
9
votes
Importing Shapefile geometry into SQL Server 2016?
Adding to klewis's answer: I got shape2sql.exe to work by adding a Shape2Sql.exe.config file with the following contents:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<...
8
votes
Accepted
How to use LIKE clause/condition in Arcpy.Exists/Delete
Wildcard searching is built into arcpy.ListRasters():
import arcpy
arcpy.env.workspace = "c:/base/data.gdb"
for raster in arcpy.ListRasters("*_*"):
arcpy.Delete_management(raster)
If you want ...
8
votes
Working around Table does not contain OIDs arcpy Error 000339?
I am getting the same error as you, I have tested your workflow on 10.3.1.
I get the error in both cases, when I have the source view is registered with geodatabase and when it's not. Running the ...
7
votes
Is it possible to reproject spatial data using SQL Server?
Example for reprojection from EPSG:2193 to EPSG:3857
c:\OSGeo4W64\bin\ogr2ogr.exe ^
-f "MSSQLSpatial"^
"MSSQL:server=DestServerName;database=DestDbName;trusted_connection=yes"^
"MSSQL:server=...
7
votes
Accepted
Should the QGIS "DB Manager" have Microsoft SQL Server as an option?
It's not supported (yet). Db manager only supports Postgres, Spatialite and Oracle databases.
7
votes
Accepted
Working around Table does not contain OIDs arcpy Error 000339?
The Copy Rows to in_memory as suggested by @alex-tereshenkov took the processing time for this part of the script down from 2mins+ to 38 seconds, however I have found an even quicker solution that ...
6
votes
The layer is not a valid layer and can not be added to the map - QGIS WFS
For debugging going to Menu -> View -> Panels -> Log Messages Panel worked for me. In the error log panel showing up, go to WFS-Tab and check for any error messages. It's not very verbose but ...
6
votes
Accepted
Downloading the Geoserver SQL Server Extension
You can grab it from this site.
Navigate through by selecting the version of GeoServer you're on, and get the latest for that version. So, for version 2.13, you can get it here: https://build....
6
votes
Accepted
Importing a shapefile or geopackage from QGIS 3.16 to MSSQL Server 2019
You can drag and drop the layer directly into the database seen in browser. Just have a look to this video:
5
votes
Accepted
Unable to register gdb with the server due to sql server client incompatibility
I was having this same problem after upgrading everything to 10.3.
I just dug this up from an old e-mail from ESRI Support. Here is the main part of the information in the e-mail.
Regarding SQL ...
5
votes
How do I find points that are NOT within a list of polygons using MS SQL?
At least in PostgreSQL it is much faster to do a left or right join on st_intersects instead and use
"where id is null"
to find those that "don't have a friend"
edit:
Ok, here comes an example ...
5
votes
Mapping SQL tables in ArcGIS Desktop
First, I hope I understand your setup correctly:
You have several tables in SQL, some with tabular data and one table containing Lat/Long columns (probably floating/double precision data type).
You ...
5
votes
Accepted
Error when using arcpy.ArcSDESQLExecute() to connect to SQL Server - ArcGIS 10.4
Use sde:sqlserver:mymachinename for your server instance
arcpy.ArcSDESQLExecute(server='mymachinename', instance='sde:sqlserver:mymachinename', database='mydbname', user='myuser',password='mypass')
...
5
votes
Accepted
Geography for Sql Server STIsValid() getting error
STIsValid() was added to the Geography type with SQL Server 2012.
If you are using SQL Server 2008 this method only exists for the Geometry data type
5
votes
Accepted
Is it possible to convert from Microsoft's format to WKB?
Yes, STAsBinary() will return WKB.
https://msdn.microsoft.com/en-us/library/bb933912.aspx
5
votes
Accepted
Import SQL Server Spatial Data into PostGIS
You can also use ogrfdw foreign data wrapper which piggy backs on GDAL. That's what I use for my SQL Server / to PostGIS import needs.
https://github.com/pramsey/pgsql-ogr-fdw
It's installed as ...
5
votes
Working on databased-stored-geodatabase with a ArcGIS for Desktop standard license?
The two highlighted passages do not contradict each other, they're merely referring to different capabilities.
The first passage explains that Standard or Advanced seats of ArcGIS
Desktop can ...
5
votes
Accepted
Export spatial data from SQL Server to ESRI shapefile
If that is the exact command copied from your terminal, you simply need to be more careful with the spelling; there are spaces between quotation marks and the output file string. Try and replace your ...
5
votes
How to Cast geometry to Geography in SQL script in MS SQL Server?
I'm not sure this is the most efficient way of doing it, but it certainly works:
SELECT geography::STGeomFromText([geom].STAsText(),4326)
where 4326 is the spatial reference ID (SRID)
5
votes
Accepted
Native JAI is false in geoserver
The docs are old and native JAI is on the "way of the dodo", I believe in most of our installations we are not adding it anymore (mostly because it does not have some basic fixes present in jai-ext ...
5
votes
Accepted
ArcGIS Pro cannot read SQL Server databases with "-" in their name
Esri states this as a limitation for geodatabases on their Enterprise geodatabase size and name limits page.
Character type limits in object names
Database management systems have different ...
5
votes
Accepted
Performance of arcpy.Exists() in SQL Server enterprise gdb environment
One of the interesting quirks of many SQL client APIs is the lack of a "table exists" function. Many implementations of an "exists" are really a low-level "describe", which returns a "does not exist" ...
5
votes
Accepted
Non-spatial SQL Server table with X,Y fields directly in QGIS?
You can create a virtual layer in QGIS that builds the geometry. Changes to the data source should be reflected upon panning/refreshing the attribute table.
Go to the menu layer / Add layer / Add-...
5
votes
"Driver not loaded Driver not loaded" when trying to connect to MSSQL database in QGIS 3.8 on MacOS
When you click "Test Connection" you get the "Driver not loaded Driver not Loaded" error at the top. However, if you ignore the Test Connection button, and instead click the "...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
sql-server × 945enterprise-geodatabase × 204
arcgis-desktop × 123
qgis × 122
sql × 88
arcgis-server × 78
geometry × 66
sql-server-spatial × 57
arcpy × 52
spatial-database × 51
geoserver × 45
arcgis-10.1 × 44
arcgis-10.2 × 43
arcgis-10.0 × 40
arcmap × 39
ogr2ogr × 37
shapefile × 34
esri-geodatabase × 34
coordinate-system × 32
c# × 29
postgis × 28
python × 22
polygon × 22
well-known-text × 22
postgresql × 21