0

I am using Esri web with javascript to create a heat map of tracts. There are groups of tracts that represent one area so I want to merge and remove the bounders between them. How can I do this?

This is How I draw the tracts:

var featureLayer = new FeatureLayer({
                    url: "https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/USA_Census_Tract_Areas_analysis_trim/FeatureServer/0",
                    outFields: ["*"],
                    renderer: renderer,
                    definitionExpression: "FIPS IN (" + fips + ")"
                });
Vikash Pandey
  • 5,407
  • 6
  • 41
  • 42
Moayad Ahmad
  • 115
  • 1
  • 11

1 Answers1

2

Well, It seems clear that your want to create one large polygon out of too many small polygons(group of tracts).

Follow below steps to achieve this-

  1. don't add feature layer on the map
  2. Create an empty map with basemap and add a graphics layer on it.
  3. query the group of tracts from the layer using esri query task and store the geometry in an array.
  4. use esri gemetryEngine union method and pass the array to it.
  5. union will return a big ploygon without the inner boundaries of 'group of tracts'.
  6. create an esri graphics with new polygon symbol and union polygon geometry.
  7. Add that graphics to the previously added graphics layer.

Feel free to shoot your further queries.

Hoping this will help you :)

Vikash Pandey
  • 5,407
  • 6
  • 41
  • 42
  • I am creating the feature layer like this `var featureLayer = new FeatureLayer({ url: "https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/USA_Census_Tract_Areas_analysis_trim/FeatureServer/0", outFields: ["*"], renderer: renderer, definitionExpression: "FIPS IN (" + fips + ")" }); allMap.layers.add(featureLayer);` How can I do the same with graphics using this url? – Moayad Ahmad May 14 '17 at 09:25
  • I thik u r asking for sample to achieve the steps I mentioned above... Let me create one for you... – Vikash Pandey May 14 '17 at 09:37
  • Did y get the steps what I was suggesting... However you can find sample for each step in argis js ap... – Vikash Pandey May 14 '17 at 09:38
  • Yes sure but I cant create the graphics layer with the url to draw certain tracts. The example I saw was just to create an empty one. I am trying to get it step by step. I am sorry but I am not advanced with esri frameworks :'D – Moayad Ahmad May 14 '17 at 09:45
  • Do you have sample code in JS(AMD) for above mentioned step?would be great if you share with us.If possible please give solution using DissolveBoundaries. https://developers.arcgis.com/javascript/3/jsapi/dissolveboundaries-amd.html#outputlayername – VIJAY P Jul 26 '19 at 11:16