Hi all,
I am working with geometryservice's union. I noticed while testing it that depending of the scale you are at the "union" does not return high quality graphs. Is there something I need to modify in my union to make it more accurate or should I just use a geoprocessing service?
Alex,
it looks like the geometry for the FeatureLayer is being generalized. You should use the:
yourFeatureLayer<SPAN class="punctuation token">.</SPAN><SPAN class="token function">setMaxAllowableOffset</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> yourFeatureLayer<SPAN class="punctuation token">.</SPAN><SPAN class="token function">setAutoGeneralize</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">false</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN></SPAN>
Thanks Robert!
Comment out the
var dissolveBoundaries = new DissolveBoundaries({});
as you are not constructing this correctly.
Thanks Robert,
I just added those lines but I get this error message:
function initSelectToolbar(event) { console.log("start edits"); selectionToolbar = new Draw(event.map); var selectQuery = new Query(); var targetGeometry; on(selectionToolbar, "DrawEnd", function (geometry) { var geometryService = new GeometryService("http://itas46:6080/arcgis/rest/services/Utilities/Geometry/GeometryServer"); selectQuery.geometry = geometry; featureLayer.selectFeatures(selectQuery, FeatureLayer.SELECTION_NEW, function (targetGeometry) { targetGeometry = graphicsUtils.getGeometries(featureLayer.getSelectedFeatures()); console.log(targetGeometry); var dissolveBoundaries = new DissolveBoundaries({}); geometryService.union(targetGeometry, function (geometry) { featureLayer.clearSelection(); var symbol = new SimpleFillSymbol("none", new SimpleLineSymbol("solid", new Color([255, 255, 255]), 2), new Color([255, 255, 255, 0.25])); var graphic = new Graphic(geometry, symbol); map.graphics.add(graphic); console.log("unioned features"); }, function (err) { console.log(err); }); }); }); }
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.