All Questions
Tagged with sql-server python
22 questions
1
vote
0
answers
51
views
QGIS - Connect to DB using Task Manager (problem)
As I have a lot of layers, I am writing a plugin that will import layers through TaskManager. Script imports layers successfully into the project with some minor problems. When layers are loaded I can ...
0
votes
0
answers
114
views
Convert PostGIS to MS SQL inside web app using ogr2ogr.py and Docker
I am trying to convert a PostGIS database to a SQL Server database inside a running Flask app.
There are three docker containers running:
web: flask app
postgis: PostGIS database
mssql: MSSQL ...
5
votes
2
answers
3k
views
How to input geospatial data into MS SQL Server via Python and SQLAlchemy
I'm trying to add a GeoJSON file into the SQL Server database. I have this following script that works fine for inputting the geospatial data into MYSQL Database, thus creating a GEOMETRY type column ...
3
votes
2
answers
353
views
How QGIS Python loop through all tables MS SQL Server?
I've got Python code on QGIS 3.12 that adds a MS SQL Server data layer to the map, but I need to add all of them.
uri = QgsDataSourceUri()
uri.setConnection(r"xx.xxx.xxx.xx\xxx", "xxxx&...
0
votes
1
answer
545
views
Using Python, how to get SQL Server queried points in the map?
Since days I'm struggling with this problem, did a lot of searching - also in this forum - but did not find the answer I need.
I have a layer 'Project' in QGIS that is connected to a spatial table in ...
1
vote
1
answer
2k
views
Convert a SQL Server Geometry into PostGIS spatial data with Python and shapely
I'm trying to migrate spatial data from a SQL Server database to a PostGIS database with Python. I need this to be automated since its not just one table, but a lot tables in a lot of databases.
I am ...
0
votes
0
answers
83
views
Connect Mapnik to MSSQL
I want to connect Mapnik to MSSQL Spatial SDE, but I don't know how to do this.
import mapnik
m = mapnik.Map(256,256)
mapnik.load_map(m, "test.xml")
m.zoom_all()
mapnik.render_to_file(m, "2.png")
...
1
vote
1
answer
701
views
Unable to load layers from MSSQL PyQGIS
I have a plugin that loads layers from SQL Server 2008. It has worked before but when I reset my PC, i wasn't able to backup my plugins. I am left with an older copy. Below is my python code to load ...
2
votes
1
answer
113
views
Why does the SRID of an ogr2ogr-imported MSSQLSpatial table change when using UID/PWD vs. trusted_connection?
I'm using python to run ogr2ogr commands to load SHP to MSSQLSpatial.
The command works fine when using trusted_connection, but when I use UID and PWD, the SRID is randomly changed to SRID:846 (while ...
2
votes
0
answers
295
views
point in multiple polygons
I have a point (lat/lng) and a collection of geofences (polygons / circles / rectangles)
Simply put, I want to know if the point is inside ANY of the geofences, it's not important which one.
I know ...
2
votes
2
answers
1k
views
Using Python to backup ArcSDE geodatabase on SQL Server Express?
Is it possible to use Python to do a backup of ArcSDE databases stored in SQL Server Express? I have been using a custom executable that uses Arcobjects
IDataServerManagerAdmin.BackupGeodatabase()
...
4
votes
2
answers
2k
views
Creating a weekly FGDB backup of ArcSDE?
I need to create a script that will copy our county's parcel data, maintained in SDE/SQL, to a file geodatabase. This script will be run as a scheduled task over the weekend. What GP tool do you ...
5
votes
2
answers
11k
views
Getting from wkt to shapefile in Python?
I am querying tables from a SQL-Server database and would like to convert the table into a shapefile. It has wkt geometries and wkb as columns in the table, along with other attributes that need to ...
2
votes
1
answer
406
views
Filtering MSSQL layers in QGIS doesn't work
In my QGIS Plugin I am filtering layers with this Python code:
FeatureIterator = layer.getFeatures( QgsFeatureRequest().setFilterExpression ("Fieldname='SomeValue'") )
for feature in FeatureIterator :...
5
votes
1
answer
738
views
Automate loading a table into SDE
How can I automatically load a table stored on a network share into SDE when the original table is edited?
Environment is ESRI 10.1 ArcSDE on SQL Server.
Preference for python or existing GP tools.
...