11

I would go for the Integrate tool which finds features that are within the given x,y tolerance. Afterwards use the Dissolve tool which should work fine for the adjacent polygons.


6

In ArcGIS 10.1 you can use the Geometry on Geometry Check Tool and use the 'Spatial Relation Check Touches' Touches—A part of the feature from feature class 1 comes into contact with the boundary of a feature from feature class 2. The interiors of the features do not intersect. http://resources.arcgis.com/en/help/main/10.1/index.html#/...


5

Aggregate polygons tool is probably what you want? It can join polygons within the same layer based upon a defined distance tolerance. You can also set minimum size of polygons and holes to retain.


5

I think this is an ideal candidate for an ArcGIS Idea (if there is not already one). The Online Help for Multipart Polygons says (with my bolding): Keep in mind that parts in a multipart polygon are spatially separated. They can touch each other at vertices, but they cannot share edges or overlap. When you are sketching a multipart polygon, any ...


5

This can be done with arcobjects. Create a generic dictionary, Dictionary<int,List<string>> and load it using a cursor, looping through features from your polygon featureclass, such that the key is the ObjectID and a List of field values (e.g. "Sector 2", "100"). Find the ITopologyExtension, and get the IMapTopology.Cache. Loop through each ...


4

The function AssignValuesToAdjacentRasterCells below returns a new RasterLayer object with the desired values assigned from the original raster input. The function check if the adjacent cells from the reference position are inside raster limits. It also display messages if some bound is out. If yo need to move the reference position you can simply write an ...


3

Suggestion in my comments "Convert back to integer raster, region group, to polygons, dissolve to multipart" will work for polygons derived from rasters. However in general it's better to start with suggestion by @Polygeo . You'll need to use script though: import arcpy import networkx as nx ## replace 2 lines below to point to polygons and neighbours ...


3

Option one: Merge features only when they belong to the same country. The Dissolve tool allows you to select more than one attribute as the Dissolve field. Use these two fields for the Dissolve field: Merge_attr Whichever field is unique for each country. In your dataset it looks like CNTR_CODE is a unique code for each country, so use that field. Or there ...


3

For a matrix operator on a small matrix this makes sense and is tractable. However, you may want to really rethink your logic when applying a function like this to a large raster. Conceptually, this does not really track in general application. You are talking about what has traditionally been referred to as a block statistic. However, a block statistic is ...


3

You can do this in R using gTouches in the rgeos package. Use rgdal package to open your geojson: library(rgeos) library(rgdal) polys <- readOGR("polys.json", "OGRGeoJSON") gTouches(polys, byid=TRUE) With success, will produce an adjacency matrix in the form of: ## 0 1 2 3 ## 0 FALSE TRUE TRUE FALSE ## 1 FALSE FALSE FALSE TRUE ...


3

You could use the ArcGIS Polygon Neighbors Tool, in the Analysis, Proximity Toolset to determine which are the bordering polygons.


3

I've created an ArcGIS 10.0 Add-in that will list adjacent features of a dataset. It also allows you to show adjacent features that share the same attributes.


3

One solution I managed to get to work was to use the Dissolve tool and then use Multipart to Singlepart. This first dissolved all polygons into a single polygon but did dissolve the shapefiles that were adjacent. Then using Multipart to Singlepart this created a shapefile where each merged polygon was given by a single feature in the attribute table.


3

Using GRASS it would be a simple two step process. After importing the polygon vector into an appropriate GRASS location, you would run: v.dissolve <your polygon vector> output=<output polygon dissolved> column=<your variable> then, to get just the boundaries: v.extract <output polygon dissolved> output=<polygon boundaries> ...


2

We provided an easy to use JSON format for country adjacency based on COW dataset, have a look and fork it on github :) https://github.com/P1sec/country_adjacency


2

You can get raw adjacency information as a side-effect of the topojson.mesh and topojson.meshArcs functions (assuming you like JavaScript). The optional third parameter to those is a function that will be called (perhaps repeatedly) for adjacent geometries. Here's some nodejs pseudo-code: var topojson = require('topojson'); var fs = require('fs'); var ...


2

You can easily update raster values by subseting raster using [row,col] notation. Just note that row and column start from upper-left corner of the raster; r[1,1] is the upper left pixel index and r[2,1] is the one underneath r[1,1]. # the function to update raster cell values focal_raster_update <- function(r, row, col) { # copy the raster to hold the ...


2

The script from the linked website writes not the number of neighboring polygons but the summed up value for an attribute from the layer (e.g. the total population for all neighboring countries) to the attribute table. The easiest way to achieve your goal is probably to change line 74 in the script from neighbors_sum += intersecting_f[_SUM_FIELD] to ...


2

You could ask the dissolve tool which you can select through the Vector tab, then Geoprocessing tools. Then select the dissolve tool to open and input the dataset You could also refer to QGIS documentation


2

The trick here is counting number of neighbors that share polygon edges. Workflow for that using spatial join one to many: arcpy.Integrate_management(in_features="COUNTIES #", cluster_tolerance="0.01 Meters") arcpy.FeatureToLine_management(in_features="COUNTIES", out_feature_class="C:/SCRATCH/to_dissolve.shp", cluster_tolerance="", attributes="NO_ATTRIBUTES"...


2

An approach is: select the polygons with your agricultural data (e.g counties where wheat is only grown). You would do that with your select by attribute tool. Then run the select by location tool and choose the spatial selection method as share boundary. Finally you would run the table to Excel tool to export your attribute. If you need to do this many ...


1

The Census cartographic boundary shapefiles do not include offshore areas. You could use a Select by Location to look for tracts which intersect the cartographic boundaries. You'll need to account for tracts bounding Canada and Mexico; a few sources for administrative boundary files, such as gadm.org, are listed in Seeking administrative boundaries for ...


1

Download the QChainage From the plugin repository Open the plugin under Vector > QChainage Select the layer under the "Basic" tab Under the "Advanced" tab, put "2" into "Divide Features into _ Parts" and execute Start an edit session on the resultant layer Use Vector > Research Tools > Select by location to select the points in the resultant layer which ...


1

For QGIS3, there is a simpler way to do this using the aggregate expression. Add a new field with the following expression. Assuming your layer name is 'polygon' aggregate( layer:= 'polygon', aggregate:='count', expression:=$id, filter:=touches($geometry, geometry(@parent)) ) See more at https://spatialthoughts.com/2019/05/23/neighbor-polygons-...


1

Thanks for pointing this out. Another problem was the line f[_NEW_NEIGHBORS_FIELD] = ','.join(neighbors) which only works for string fields. I wanted to count on a integer field. The comma-separated string can be built with this line instead of the one above: f[_NEW_NEIGHBORS_FIELD] = ",".join(map(str, neighbors)) Also, there's another way to count the ...


1

Because I cannot see where 'A' lies (is it just a segment where all the pipes join, or does it actually follow the length of 1, 2 and 3), I am taking a stab at what I think might be the problem. 'Are Within' (from ArcGIS Help link within Selection Dialog Box, or, ESRI Select By Location Web Help): To be selected, the geometry of the target feature must ...


1

Based on the answer to an earlier related question Dissolve ploygons in QGIS or Grass to new polygons of defined population sizes I think you need AZTool which was designed to do the same job for the GB Census output areas.


1

I met the same problem, my solution is create one copy of the polygon first, add one field with the same ID with the centroid points(should be there, don't need to create). Then use the C# arcobjects to judge if the polygons are touched, like this: ISpatialFilter pSpatialFilter = new SpatialFilterClass(); pSpatialFilter.SpatialRel = esriSpatialRelEnum....


1

I would recommend looking at using your resulting dissolve features from your previous trials with a spatial join (ArcGIS 10.1 Spatial Join Help Page) to attach the original attributes to combined polygons. Or alternatively look at using union (ArcGIS 10.1 Union Help Page) followed by dissolving with relevant summary statistics.


1

In GRASS the module v.to.db can "upload" the cat values of the right side and left side polygons into the boundary attribute table. From the v.to.db man page: Upload category numbers of left and right area, to an attribute table of boundaries common for the areas: # add categories for boundaries of the input vector map, in layer 2: v.category soils ...


Only top voted, non community-wiki answers of a minimum length are eligible