0

We'd like to do an effective "real-time dissolve" on an Esri feature class with a SQL GEOMETRY shape where a parcel layer is "dissolved" into products using an attribute (ProductID) of the parcel layer. The SQL Server UnionAggregate() function allows for this, using a query like this:

CREATE VIEW Product
AS
SELECT 
 PPI.ProductID
 ,GEOMETRY::UnionAggregate(PL.SHAPE) as Shape
FROM ParcelProductInfo PPI
JOIN  ParcelLayer PL ON PPI.ParcelID = PL.ParcelID
GROUP BY  PPI.ProductID

This creates the desired result, but it has a side-effect where dangling artifacts are rendered in the Product layer where nodes in the parcel polygons may not have been exactly coincident, as shown here:

enter image description here

where the blue polygons are parcels and the orange polygons are the "dissolved" products.

Esri has a dissolve tool (arcpy.Dissolve_management())that seems to have an implied tolerance between polygon nodes since we don't see the same artifacts with that tool, but it's not a viable "real-time" solution. However we're hoping to find something that performs a similar function in conjunction with GEOMETRY::UnionAggregate(​).

Any thoughts or ideas out there?

0

It may not be a perfect result, but you can try to fill in some of the gaps by applying a positive buffer to the shape before it is dissolved and then a negative buffer to the dissolved shape.

CREATE VIEW Product
AS
SELECT 
 PPI.ProductID
 ,GEOMETRY::UnionAggregate(PL.SHAPE.STBuffer(1)).STBuffer(-1) as Shape
FROM ParcelProductInfo PPI
JOIN  ParcelLayer PL ON PPI.ParcelID = PL.ParcelID
GROUP BY  PPI.ProductID

This will help the different parcels "reach out" to each other. If that doesn't work then you might try using STDifference() or STIntersection to capture all of the small gaps and then dissolve those with their nearest neighbor.

New contributor
PDXGreggles is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.