multipolygon support on arcgis and sql server

1500
3
08-28-2018 08:01 PM
demof1234demof1234
New Contributor

I like to merge several polygon records into one with boundary preserved, but not dissolved using sql statements on sql server 2016. So I consider to use multipolygon.

Fro the link, http://desktop.arcgis.com/en/arcmap/latest/manage-data/gdbs-in-sql-server/sqlserver-spatial-types-an...

Under the section "Register an existing spatial table with the geodatabase", it is stated that sql server supports mulitipolygon. But it does not state if arcgis server supports it or not, also not give an example how to make one from a list of records. And I searched out on the internet, no example could be found for how to use multipolygon.

So, is multipolygon supported on arcgis server by using map service, and any example on how to make one multipolygon record from several records of one table?

0 Kudos
3 Replies
PaulBrandt
New Contributor III

You might look at the SQL Static Aggregate Functions. I don't know what your full workflow is, but SQL will combine these into a SQL Geometry Collection quite nicely. Static Aggregate Geography Methods | Microsoft Docs CollectionAggregate is probably what you want. This is also possible in ArcGIS with the Union GP tool Union—Help | ArcGIS Desktop, but it sounds like your starting data is a SQL Spatial table not necessarily in a Geodatabase, so staying inside of the SQL stack for your processing may make as much sense.

VinceAngelo
Esri Esteemed Contributor

Actually, ArcGIS Union splits polygons based on overlap from different layers.  The Dissolve command is used to merge geometries.  Unless you're using Python, in which case the Geometry.union() method is used to merge individual shapes.

VinceAngelo
Esri Esteemed Contributor

Yes, of course multi-part polygons are supported by both Desktop and Server.  However, the geometries must be properly constructed to conform to topology rules:

  1. Any polygon (exterior ring) may contain one or more "holes" (interior rings)
  2. Multi-part polygons are composed of multiple exterior rings (which may contain interior rings)
  3. Interior rings may not exist outside the exterior ring to which they belong, and may not touch the exterior ring for greater than one vertex at a time (the geometry library will automatically repair "inversions" to the exterior ring)
  4. Exterior rings may not overlap or touch each other at more than one point.

The Dissolve command is often the easiest way to merge multiple rows of polygon data into a single geometry in a new feature class. Though if you're comfortable with arcpy, then you can use the Geometry.union(other) method to merge individual shapes in memory. Once the geometry is constructed, it can be populated in a table and manipulated using SQL. You can also use SQL to union shapes, but there can be subtle differences in the geometry models which may result in invalid geometries.

- V