Hot answers tagged

3

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 would like to join several data tables together and see the information as points in ArcGIS. Possible solution: You should make your join/view directly in ...


3

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=SourceServerName;database=SourceDbName;trusted_connection=yes"^ -sql "SELECT [Id], [Shape].STAsText() Shape FROM [SourceDbName].[dbo].[SourceTableName]"^ -nln ...


2

I'm afraid this is more of a personal preference than a best practices issue. You have many choices: Create the spatial table in database A with SQL tools, and access it though Query Layers Create the spatial table in database B with SQL tools, and access it through Query Layers Create the spatial table in database B with SQL tools, and register it with ...


1

So I figured it out - @Yanes was close but instead of three sets of double quotes, it needed to be double-single-double. So the following script works: -- Turn ReportsTable into a View Table arcpy.MakeTableView_management(ReportsTable, ViewTable) -- Get start and end times for report start_time= datetime.timedelta(hours = 24) end_time = ...


1

Try wrapping your Where statement with three double quotations so that Arcpy understands it as an expression for your select function not a standalone SQL task - I may be wrong on the reasoning, I will check. SQL = """ "created_date" >= '{}'""".format(report_time.strftime('%Y-%m-%d %H:%M:%S')) ...


1

I have also noticed that QGIS up to my current version (2.12.2) appears to have a problem loading MSSQL geometries of type "GeometryCollection", when you would expect Polygons or Multipolygons. To check if you have these, use: SELECT GEOM.STGeometryType() FROM [yourtable]



Only top voted, non community-wiki answers of a minimum length are eligible