POST
|
Thanks Thejus, What we did here was make an editing tool that honors topology between two layers using the geometry engine. Attached is a snip from the code that is fired using the on "edits-complete" method. Thanks for the help. Enjoy the day, Mike function forageGo(evt) { console.log(evt); var union; var query = new Query(); query.outSpatialReference = map.spatialReference; //query.num = 1; if (evt.adds.length == 0) { return; } var objID = evt.adds[0].objectId; query.objectIds = [objID]; //query.spatialRelationship = Query.SPATIAL_INTERSECTS; var polyGreen; var polyGreenAttr; var geoms = []; //var polyunion; ForageDelineationInput.queryFeatures(query, function(featureSet2) { if (featureSet2.features.length == 0) { return; } polyGreen = featureSet2.features[0].geometry; polyGreenAttr = featureSet2.features[0].attributes; }); var query1 = new Query(); query1.outSpatialReference = map.spatialReference; query1.num = 1; query1.geometry = polyGreen; query1.spatialRelationship = Query.SPATIAL_INTERSECTS; // query PropertyBoundaryInput to get the geometry PropertyBoundaryInput.queryFeatures(query1, function(featureSet) { if (featureSet.features.length == 0) { //alert("No Results found"); } else { for (var i = 0; i < featureSet.features.length; i++) { var graphic = new Graphic(); var features = []; console.log(polyGreen); console.log(ForageDelineationInput.getSelectedFeatures); var graphic = ForageDelineationInput.getSelectedFeatures()[0].setGeometry(geometryEngine.difference(polyGreen, featureSet.features[0].geometry)); graphic = ForageDelineationInput.getSelectedFeatures()[0].setGeometry(geometryEngine.intersect(query1.geometry, featureSet.features[0].geometry)); //property.applyEdits([evt.adds[0]], null, [evt.adds[0]]); ForageDelineationInput.applyEdits(null, [graphic], null); var query2 = new Query(); query2.outSpatialReference = map.spatialReference; //query2.num = 1; query2.geometry = graphic.geometry; query2.spatialRelationship = Query.SPATIAL_INTERSECTS; query2.where = "OBJECTID_1 <>" + objID; ForageDelineationInput.queryFeatures(query2, function(featureSet2) { if (featureSet2.features.length == 0) { //alert("No Results found"); } else { for (var i = 0; i < featureSet2.features.length; i++) { /*console.log(featureSet2.features.length); //var features = []; graphic1 = ForageDelineationInput.getSelectedFeatures()[0].setGeometry(geometryEngine.difference(ForageDelineationInput.getSelectedFeatures()[0].geometry, featureSet2.features[0].geometry));*/ var fFeature = featureSet2.features; geoms.push(fFeature.geometry); console.log(geoms); } union = geometryEngine.union(geoms); console.log(union.toJson()); var graphic1 = new Graphic(); graphic1 = ForageDelineationInput.getSelectedFeatures()[0].setGeometry(geometryEngine.difference(ForageDelineationInput.getSelectedFeatures()[0].geometry, union)); console.log(graphic1); ForageDelineationInput.applyEdits(null, [graphic1], null); } }); } } }); }
... View more
02-06-2017
11:29 AM
|
0
|
0
|
864
|
POST
|
Thanks thejus. I'm working to try this now. I'll respond as soon as I have more. Enjoy the day, Mike
... View more
01-31-2017
01:01 PM
|
0
|
0
|
864
|
POST
|
Hello all, I've implemented the following code using a before-apply-edits on a layer, however I get an error when I try to apply those changes I made using a geometry service. The server does send an error 17000 on the Method "GraphicFeatureServer.HandleREST_ApplyEditsOperation". Any help is much appreciated. This is a head scratcher for me. forage.on("before-apply-edits", function (evt) { if (evt.adds != null){ console.log("QueryRunning"); var query = new Query(); query.outSpatialReference = map.spatialReference; query.geometry = evt.adds[0].geometry; query.spatialRelationship = Query.SPATIAL_INTERSECTS; var feat = evt.adds[0]; property.queryFeatures(query, function(featureSet) { if (featureSet.features.length == 0) { } else { console.log("pboundary detected"); console.log(evt.adds[0]); var intersectGeometry = feat.geometry; var queryGeometry = featureSet.features[0].geometry; var newGeom = geometryEngine.intersect(intersectGeometry, queryGeometry); feat.setGeometry(newGeom); console.log(feat.geometry); forage.applyEdits(null, [feat], null); } }); } });
... View more
01-31-2017
07:02 AM
|
0
|
3
|
2060
|
POST
|
Possibly, if we could apply a geometric query to the layer. We are using the geometry engine to create a selection that is then displayed to the user. Thanks for your help, Mike
... View more
06-20-2016
06:28 AM
|
0
|
0
|
289
|
POST
|
Hello all, I have an app with a dynamic query of a feature service that changes depending on user input. This adjusts what is displayed to the user depending on their needs. We deploy the editor widget then to work on that feature class. We run into issues with data not part of the original query showing up. Is there a solution to only edit the selectedfeatures from the original query? Enjoy the day, Mike
... View more
06-16-2016
12:07 PM
|
0
|
4
|
2093
|
POST
|
I have published in that manner. That's why I am confused that only the line features throw a security error. Other layers within the same service group export from the web task fine. Any ideas?
... View more
05-11-2016
06:02 AM
|
0
|
0
|
303
|
POST
|
I'm receiving the following error when trying to execute an Export Web Map Task. This only occurs when attempting to print line feature services - all polygon layers work (i.e., when I turn off the line layers in my application, the export task executes). I've tried republishing the data, recreating the data, and adjusting the print services. The webmap task is set up to run as a secure service. Any clue why this might be? Error executing tool. Export Web Map Job ID: j8bd345affcde4facba68f168a7277f5a : Layer "graphicsLayer3": Failed to create layer from service at https://xxxxxxx/webgis/rest/services/Cooperators/CooperatorFenceLines/featureserver/0. ERROR: code:-1, Unable to check permission on resource cooperators/cooperatorfencelines.mapserver.Failed to compute the privilege for the user 'xxxx\AGSA'. Could not find user account in the Identity Store. Failed to execute (ExportWebMap). Failed to execute (Export Web Map)
... View more
05-11-2016
05:23 AM
|
0
|
2
|
2871
|
POST
|
Hello all, I have a Trimble Geo7x unit with RTX corrections, NMEA out, and Terrasync Centimeter edition. When connecting to ArcGIS for Windows Mobile I can collect data when the receiver has SBAS enabled. Once it switches to RTX the Fix Type shows as invalid making collection impossible. Has anyone else experienced this issue before? Enjoy the Day, Mike
... View more
01-26-2016
09:06 AM
|
0
|
0
|
2588
|
POST
|
Hi Robert, Thanks for all your help. Below is the query that works. You are correct the spatialReference needed to be changed. I also needed to add in the EntityID field to query into Query2. Thank you. I got at least 2 beers for you at the UC this year! Enjoy the day, Mike function queryGo(){ var geoms = []; var union; //console.log(union); var query = new Query(); query.where = entityIDexp; query.outfields = ["*"]; query.returnGeometry = true; query.spatialReference = sr; query.outSpatialReference = sr; geoms.SpatialReference = sr; //union.SpatialReference = sr; featureLayer.queryFeatures(query, function(featureSet){ for (var i = 0; i < featureSet.features.length; i++) { var feature = featureSet.features; geoms.push(feature.geometry); console.log(geoms); } union = geometryEngine.union(geoms); console.log(union.toJson()); var query2 = new Query(); query2.geometry = union.geometry; query2.where = entityIDexp; console.log(union); query2.returnGeometry = true; query2.spatialReference = sr; query2.spatialRelationship = Query.SPATIAL_REL_INTERSECTS; pondLayer.selectFeatures(query2, FeatureLayer.SELECTION_NEW); pondLayer.queryCount(query2, function(count) { console.log(count + " features satisfied the input query")}); pondLayer.getSelectedFeatures(); pondLayer.refresh(); console.log('refreshed') }); function queryGo(){ var geoms = []; var union; //console.log(union); var query = new Query(); query.where = entityIDexp; query.outfields = ["*"]; query.returnGeometry = true; query.spatialReference = sr; query.outSpatialReference = sr; geoms.SpatialReference = sr; //union.SpatialReference = sr; featureLayer.queryFeatures(query, function(featureSet){ for (var i = 0; i < featureSet.features.length; i++) { var feature = featureSet.features; geoms.push(feature.geometry); console.log(geoms); } union = geometryEngine.union(geoms); console.log(union.toJson()); var query2 = new Query(); query2.geometry = union.geometry; query2.where = entityIDexp; console.log(union); query2.returnGeometry = true; query2.spatialReference = sr; query2.spatialRelationship = Query.SPATIAL_REL_INTERSECTS; pondLayer.selectFeatures(query2, FeatureLayer.SELECTION_NEW); pondLayer.queryCount(query2, function(count) { console.log(count + " features satisfied the input query")}); pondLayer.getSelectedFeatures(); pondLayer.refresh(); console.log('refreshed') });
... View more
01-08-2016
09:42 AM
|
0
|
0
|
217
|
POST
|
Hi Robert, A little more digging on this. When I get the count of features selected by Query2 run against the pondLayer it returns all features in the database. Not sure if I'm missing a query parameter? Enjoy the day, Mike
... View more
01-08-2016
08:59 AM
|
1
|
2
|
735
|
POST
|
Hi Robert, This is working great for me right now. I see the array of the unioned features, but I can't get the selected features to show now. Any ideas on why that may be? Thank you so much for your help. Enjoy the day, Mike
... View more
01-08-2016
08:15 AM
|
1
|
3
|
735
|
POST
|
Robert, Here is the full html file for the page. Thanks for all your help again. Enjoy the day, Mike
... View more
01-07-2016
02:39 PM
|
0
|
5
|
735
|
POST
|
c.getCacheValue is not a function still persists after switching to 3.15 and points to the geometryEngine. I'm going to keep digging, but I'm not finding an obvious solution. Any other ideas? Thanks for all your help. Very appreciated.
... View more
01-07-2016
01:46 PM
|
0
|
7
|
735
|
POST
|
Thanks Robert and Ken. I'm seeing light at the end of the tunnel. Now I'm getting a TypeError that refers back to the geometryEngine saying "c.getCacheValue is not a function". I'm assuming I may have the wrong references (currently referencing 3.13)? var geoms = []; pondLayer.queryFeatures(query, function(featureSet){ for (var i = 0; i < featureSet.features.length; i++) { var feature = featureSet.features; geoms.push(feature); }; var union = geometryEngine.union(geoms); //Notice I am using geometryEngine and not geometryEngineAsync var query2 = new Query(); query2.geometry = union; query2.spatialRelationship = Query.SPATIAL_REL_CONTAINS; pondLayer.selectFeatures(query2, FeatureLayer.SELECTION_NEW); });
... View more
01-07-2016
01:08 PM
|
0
|
9
|
735
|
Title | Kudos | Posted |
---|---|---|
1 | 01-08-2016 08:15 AM | |
1 | 01-08-2016 08:59 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|