Load and save a spatial weights matrix file

Neighborhood Explorer allows you to apply conceptualizations of spatial relationships to data, make modifications to neighborhoods, and export the modified neighborhood conceptualizations to a spatial weights matrix file (.swm). You can then use the modified spatial relationships in the steps outlined below.

Several tools in the Spatial Statistics toolbox use neighborhoods to apply as spatial constraints or as part of the calculation of a local or global statistic of interest. The following tools accept .swm files to define neighborhoods:

Load a spatial weights matrix file

Spatial weights matrix files are associated with a feature class. To use a .swm file, the feature layer that corresponds to the file must be in the Contents pane.

To load a .swm file, complete the following steps:

  1. On the Analysis ribbon in the Workflows group, click the Neighborhood Explorer button Explore Neighborhoods.
  2. In the Contents pane, select the layer that corresponds to the .swm file.
  3. Specify a Unique ID field value.

    The field links the features in the feature layer to their spatial relationships defined in the .swm file. The field should match the unique ID field that was used to create the .swm file.

    Learn about the Generate Spatial Weights Matrix tool

  4. Specify the Get Spatial Weights from File option as the Conceptualization of Spatial Relationships parameter value.
  5. Click the Browse button Browse and browse to the folder that contains the .swm file.
  6. Click the file and click Open.
  7. Click Apply.

Modify a conceptualization of spatial relationships

Each Conceptualization of Spatial Relationships option applies a method to identify neighbors and quantify the weight of those neighbors. These methods may capture the spatial relationships between most features; however, there are exceptions. For example, if you specify the Contiguity edges only option for the Conceptualization of Spatial Relationships parameter, an island would not have any neighbors. However, the island may share characteristics with several coastal features and naturally be considered a neighbor. In Neighborhood Explorer, you can account for these spatial relationships that don't conform to the neighborhood or weighting method specified by the Conceptualization of Spatial Relationships parameter value by editing them. You can modify neighborhoods by adding and removing neighbors or changing the weight of neighbors.

Learn more about editing neighborhoods

Save a spatial weights matrix file

Once you edit the spatial relationships between features, you can save those modified spatial relationships. In Neighborhood Explorer, you can save the spatial relationships between features as a .swm file.

Note:
  • If you close Neighborhood Explorer, your edits are lost. To preserve your edits, export the spatial relationships to a .swm file.
  • If the Unique ID field value is the Object ID field of the layer, you cannot export to a .swm file.

To save a .swm file, complete the following steps:

  1. On the Neighborhood Explorer ribbon, click the Export spatial weights matrix button Export.
  2. Browse to the folder where you want to save the .swm file.
  3. Name the .swm file and click Save.

Related topics