Tuesday, 24 April 2018

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 data type I was expecting it to be simple to replace to the map files with a relational database, but for some reason it doesn't seem as simple as I expected.


Has anyone got any ideas how I can use sql 2008 for data storage and do away with shape files? I've read about arcsde, but really don't understand the point of another layer. No idea what it's actually supposed to do.



Answer



Using ArcSDE you can store spatial data in basically 2 formats. Either using the SDE native format (which is a BLOB), OR depending on the database you use (SQL Server, Oracle, PostGIS, i think DB2 spatial as well) in the respective database native format. Which for Oracle for example, is the SDO_GEOMETRY type and for SQL Server the Geography or Geometry spatial types.



Which format you actually end up using is up to you and and it wouldn't/shouldn't make any (huge) difference on the client side. Any ESRI client (e.g. Arcmap) would handle the data in the same way. My suggestion would be to go for the SQL Server native format (or Oracle's if you were using it) as otherwise I think you would have to use ESRI-only tools to do even the simplest spatial queries or analysis. Using the native db format on the other hand would allow you to query the data from other clients as well and even from SQL Server Management Studio. And as @Blomster says you can move a lot of the spatial logic into stored procedures.


As first step to import shapefiles into SQL Server would be to download the extremeley handy Shape2SQL utility by Morten Nielsen


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...