<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to convert .dbf to a spatial weights matrix .swm; quick and dirty in Spatial Statistics Questions</title>
    <link>https://community.esri.com/t5/spatial-statistics-questions/how-to-convert-dbf-to-a-spatial-weights-matrix-swm/m-p/1661593#M2696</link>
    <description>&lt;P&gt;Thank you so much!&lt;/P&gt;</description>
    <pubDate>Tue, 28 Oct 2025 23:30:31 GMT</pubDate>
    <dc:creator>deryolr</dc:creator>
    <dc:date>2025-10-28T23:30:31Z</dc:date>
    <item>
      <title>How to convert .dbf to a spatial weights matrix .swm; quick and dirty</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/how-to-convert-dbf-to-a-spatial-weights-matrix-swm/m-p/615332#M1975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you are trying to personalize your spatial weights matrix so that you can modify adjacency relationships (i.e. to modify LISA satistics) here is how you do it.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Perform the usual spatial weights matrix generation with Spatial Statistics tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Run the following Python script (you'll have some cleanup to do after pasting this) in the embedded Python window to create a seperate .dbf that represents your spatial weights relationships.&amp;nbsp; The file paths below are as they are on my cpu; adjust them for your cpu.&amp;nbsp; My .swm file was called "invasive_spatilweightsmatrix", as you can see.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... arcpy.env.workspace = "c:/thesis/spatial weights matrices/invasive_spatialweightsmatrix"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... arcpy.ConvertSpatialWeightsMatrixtoTable_stats("invasive_spatialweightsmatrix.swm","invasive_spatialweightsmatrix.dbf")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After you do this, rightclick/export the file that gets added to your ArcGIS Table of Contents.&amp;nbsp; Export it as a .dbf file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then add the .dbf file (that you created in the previous step) to your ArcGIS Table of Contents, and open it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Delete any columns other than the following four fields:&amp;nbsp; OID, "Unique ID Field", NID, and WEIGHT.&amp;nbsp; I had to delete a field called "Field1".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You will be left with four columns: OID, "UNIQUE ID FIELD", NID, and WEIGHT.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Start the Editor and manually change the weights as you want them to be.&amp;nbsp; This is the "dirty" part of the job, assuming you have to hunt down each feature weight that you want to modify.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Save your edits and stop editor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Generate a new spatial weights matrix with the Convert_Table option in the Spatial Statistics Toolkit.&amp;nbsp; Select your newly saved .dbf as the Input Table.&amp;nbsp; ***Important, if your original .swm was created with row standardization, then you should NOT select row standardization when you create your new .swm in this current step.&amp;nbsp; Your Input Table would already be row standardized if you selected row standardized in the initial creation of your .swm.&amp;nbsp; You will undo any of your weight adjustments if you check that box during this current step.***&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now you can select this new .swm for runs in Local Moran or anything that is derived from a spatial weights matrix table and gives you the option of selecting a .swm file (in ArcGIS anyways).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This was much easier than I made it out to be.&amp;nbsp; I just threw a few extra details in for anybody who might need them.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Good luck,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Chris Weston&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2011 07:19:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/how-to-convert-dbf-to-a-spatial-weights-matrix-swm/m-p/615332#M1975</guid>
      <dc:creator>ChrisWeston</dc:creator>
      <dc:date>2011-09-21T07:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert .dbf to a spatial weights matrix .swm; quick and dirty</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/how-to-convert-dbf-to-a-spatial-weights-matrix-swm/m-p/615333#M1976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you! Very helpful. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2018 09:52:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/how-to-convert-dbf-to-a-spatial-weights-matrix-swm/m-p/615333#M1976</guid>
      <dc:creator>HarryMoultrie</dc:creator>
      <dc:date>2018-03-15T09:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert .dbf to a spatial weights matrix .swm; quick and dirty</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/how-to-convert-dbf-to-a-spatial-weights-matrix-swm/m-p/1661063#M2694</link>
      <description>&lt;P&gt;Hi Chris. I am working with a customized .dbf file. I have ArcGIS pro 3.5.3 and there is no tool to convert a .dbf file to spatial weight matrix file as you described above. I would like to customize the swm file so there is no island. There is no "Convert_Table" option in the Spatial Statistics Toolkit. How can I do it with this newest version of the ArcGIS pro? Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 27 Oct 2025 18:31:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/how-to-convert-dbf-to-a-spatial-weights-matrix-swm/m-p/1661063#M2694</guid>
      <dc:creator>deryolr</dc:creator>
      <dc:date>2025-10-27T18:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert .dbf to a spatial weights matrix .swm; quick and dirty</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/how-to-convert-dbf-to-a-spatial-weights-matrix-swm/m-p/1661293#M2695</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/673943"&gt;@deryolr&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You can convert a .dbf (or any other ArcGIS table) to a spatial weights matrix using the Generate Spatial Weights Matrix tool.&amp;nbsp; The Conceptualization of Spatial Relationships parameter has a "Convert table" option that will allow you to provide your dbf.&lt;/P&gt;&lt;P&gt;Making a custom SWM usually involves first making a template SWM using Generate Spatial Weights Matrix tool. You then convert it to a table using Convert Spatial Weights Matrix to Table tool, and manually edit the table.&amp;nbsp; Finally, you convert it back to a SWM using Generate Spatial Weights Matrix.&lt;/P&gt;&lt;P&gt;Before trying to convert your dbf to a SWM, I would try to add it to a map and make sure it displays as a table layer in the Contents pane.&amp;nbsp; That will verify that it is configured such that ArcGIS Pro recognizes it as a valid table.&lt;/P&gt;&lt;P&gt;-Eric Krause&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 13:18:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/how-to-convert-dbf-to-a-spatial-weights-matrix-swm/m-p/1661293#M2695</guid>
      <dc:creator>EricKrause</dc:creator>
      <dc:date>2025-10-28T13:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert .dbf to a spatial weights matrix .swm; quick and dirty</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/how-to-convert-dbf-to-a-spatial-weights-matrix-swm/m-p/1661593#M2696</link>
      <description>&lt;P&gt;Thank you so much!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 23:30:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/how-to-convert-dbf-to-a-spatial-weights-matrix-swm/m-p/1661593#M2696</guid>
      <dc:creator>deryolr</dc:creator>
      <dc:date>2025-10-28T23:30:31Z</dc:date>
    </item>
  </channel>
</rss>

