原文发布时间:2010-07-29
作者:毛毛虫
Dissolver函数的作用是通过移除共同的边界来创建较大的面来融合面要素。
函数属性如下:
Input
这个函数结束二维的多边形要素。 融合多边形是当相邻要素间的共享边界被移除后的组成的多边形。这个函数假设输入的多边形是合适的节点(也就是,顶点是当前的每个交点)。这个函数也假设多边形没有彼此覆盖。Output
AREA: 用指定的属性合适的设置的融合的多边形要素。 NTERIOR_LINE:表示输入要素部分的线性要素,不是输出的融合多边形的部分。 NON_POLYGON:任何不是多边形的要素是输出的不相接的部分。执行融合操作之前的图形:
执行融合操作之后的效果:
中间绿色的线为融合后消失的公共边,即NTERIOR_LINE端口输出的要素。
参数:
Group By
输入的多边形要素使用Group By函数进行分组融合。如果蚕食没有指定,那么所有的输入要素被一起处理。
Overlapping Input
如果Overlapping Input被设置为No Overlap,那么两个面必须有相同顶点的公共边才能融合。如果Overlapping Input 被设置为Overlap,那么多边形覆盖也可以被融合。
原始图形如下:
这两个面是相互覆盖的,如果选择No Overlap,则不进行融合,如果选择Overlap,则会融合。如果两个面是相接的,即没有覆盖,但是有公共边,则设置为No Overlap或Overlap都会进行融合。
Attributes to Sum, Average, Weight Average
如果需要,属性添加到结果面要素中,这些属性包含了初始属性的和、平均值和面积的加权平均值。
Dissolve Member Count Attribute
融合成一个输出多边形的输入多边形的数目。如上图,设置该属性为number,则输出后的number值为2
List Name
如果可选的列表的名字被提供,列表由融合为输出面的每个面的所有属性组成。
注意:如果Attributes to Sum, Average, Weight Average 、Dissolve Member Count Attribute 和List Name 参数都不设置,那么原始属性会丢失。
设置任意属性,会保留原来属性的某个要素的属性:
除了设置List Name属性外,设置这个属性的时候会增加list属性,如图:
在使用这个函数时,遇到一个问题,原始图形如下:
使用Dissolver函数后,融合后的效果让下图(黄色的为原图,粉色的为融合后的效果):
对比融合前后的效果,发现丢失了一些图形,检查日志会发现如下一些提示:
Topology Creation: The input feature (which claimed to be a polygon) consisted of only 2 identical points and had zero length and area, so it will not be considered during topology creation. Its coordinates were:
Number of Coordinates: 2
Coordinate # 0: 364999.938649994 3305879.13359803
Coordinate # 1: 364999.938649994 3305879.13359803
Topology Creation: The input feature (which claimed to be a polygon) consisted of only 2 identical points and had zero length and area, so it will not be considered during topology creation. Its coordinates were:
Number of Coordinates: 2
Coordinate # 0: 365429.65383664 3305881.86384181
Coordinate # 1: 365429.65383664 3305881.86384181
此时,我们可以提取两个要素来做测试,如图:
执行融合操作是,日志提示:
Topology Creation: The input feature (which claimed to be a polygon) consisted of only 2 identical points and had zero length and area, so it will not be considered during topology creation. Its coordinates were:
Number of Coordinates: 2
Coordinate # 0: 356569.109841752 3304784.83927771
Coordinate # 1: 356569.109841752 3304784.83927771
Topology Creation: The input feature (which claimed to be a polygon) consisted of only 2 identical points and had zero length and area, so it will not be considered during topology creation. Its coordinates were:
Number of Coordinates: 2
Coordinate # 0: 356938.311903691 3304861.56233429
Coordinate # 1: 356938.311903691 3304861.56233429
Topology Creation: The input feature (which claimed to be a polygon) consisted of only 2 identical points and had zero length and area, so it will not be considered during topology creation. Its coordinates were:
Number of Coordinates: 2
Coordinate # 0: 356907.934397771 3304922.9356774
Coordinate # 1: 356907.934397771 3304922.9356774
OVERLAY_FACTORY_PREPROCESSOR::polygon_dissolve_overlay_factory(OverlayFactory): Starting iteration #1 of intersection processing
OVERLAY_FACTORY_PREPROCESSOR::polygon_dissolve_overlay_factory(OverlayFactory): Completed intersection processing, iteration #1. 0 new nodes were generated among 5 segments
OVERLAY_FACTORY_PREPROCESSOR::polygon_dissolve_overlay_factory(OverlayFactory): Done computing polygon intersections -- creating topology on 5 segments
Topology Creation: The input feature (which claimed to be a polygon) consisted of only 2 identical points and had zero length and area, so it will not be considered during topology creation. Its coordinates were:
Number of Coordinates: 2
Coordinate # 0: 356569.109841752 3304784.83927771
Coordinate # 1: 356569.109841752 3304784.83927771
Topology Creation: The input feature (which claimed to be a polygon) consisted of only 2 identical points and had zero length and area, so it will not be considered during topology creation. Its coordinates were:
Number of Coordinates: 2
Coordinate # 0: 356624.395739311 3304996.48405632
Coordinate # 1: 356624.395739311 3304996.48405632
得到的结果是:AREA端口没有要素输出,INTERIOR_LINE端口有五个要素输出:
使用函数DuplicateCoordinateRemover移除重复坐标后,会得到我们想要的结果:
此时对整个图层再次进行融合后的结果如下,没有遗失图形:
