# 2. 🌐 Spatial Weights

Spatial weights represent the possible spatial interaction between observations in space. They are an essential element in the construction of spatial autocorrelation statistics and provide the means to create spatially explicit variables, such as spatially lagged variables and spatially smoothed rates. For more information, please read: <https://geodacenter.github.io/workbook/4a_contig_weights/lab4a.html>

&#x20;**CONTENTS**

* 2.1 Contiguity-Based Weights
  * queen\_weights()
  * rook\_weights()
  * weights\_astext()
* 2.2 Distance-Based Weights
  * distance\_weights()
  * min\_distthreshold()
  * knn\_weights()
* 2.3 Kernel Weights
  * kernel\_weights()
  * kernel\_knnweights()


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xunli.gitbook.io/postgeoda/2.-spatial-weights.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
