1 of 34

Class 18

Calculating Distance, Spatial Neighbors

2 of 34

AGENDA

​

Today’s Class …

  • Why distance
  • Types of distance
  • What are spatial neighbors

​

During Class …

  • Spatial Distance Exercise
  • Spatial Neighbors Exercise

​

Next Class …

  • Spatial Clustering

3 of 34

What is Distance??

  • Fundamental geographic concept
    • Affects relationships and interactions among things and places
      • Physical Distance
      • Social Distance
  • Why do we care?
    • Want to explain it
    • Want to do calculations
    • Want to map it

Class 18

3

4 of 34

Physical Distance

  • Measurable quality describing separation across earth’s surface
    • Measured by space or time
  • Essential to understanding “space”
  • As an effect and/or as an outcome

Class 18

4

5 of 34

Social Distance

  • Separation in a non-physical manner
    • Connection and isolation
  • Formation of social networks
    • Are some subgroups more likely to interact than others?
    • Information dissemination

Class 18

5

6 of 34

Distance Decay

  • Interaction (actual or potential ) or relationship among phenomena decreases with distance
    • Distance has friction

Class 18

6

7 of 34

Distance Based Operations

Class 18

7

Spatial Query

Select geographic features based on distance

Buffer

Use distance to define area around point, line or polygon feature

Identity Neighbors

Identify geographic features within a neighborhood

8 of 34

Types of Distance - Euclidean Distance

  • Pythagorean Theorem
  • Assumes
    • A planar earth (a projected cs)
    • No differences in elevation

​

  • Should NOT be used with latitude and longitude

Class 20

8

 

9 of 34

Types of Distance – Euclidean Distance Limitations

Class 18

9

    • Limiting over large distances

Assumes a flat earth

    • Limiting in mountainous terrain

Assumes no slope

    • Includes everything that is not a road or anything than stands in the way

Assumes no barrier to movement

10 of 34

Types of Distance – Great Circle Distance

  • Shortest distance between two points on a sphere
    • Used for points stored in spherical coordinates
    • Required to calculate in spherical coordinates

Class 18

10

11 of 34

Types of Distance – Manhattan Distance

  • One way to account for barriers is to recognize that travel can be limited to transportation routes that follow cardinal directions (N, S, E, W)
    • e.g., in Manhattan where most streets are at right angles

Class 18

11

12 of 34

Types of Distance – Minkowski Distance

  • Falls between Euclidean and Manhattan distance
  • Distance of a curved arc connecting two points

Class 18

12

13 of 34

Types of Distance – Network Distance

  • Restricts travel long existing arcs (lines)
  • Examples
    • On city streets
    • Distance is the sum of the lengths of arcs that make up the route
    • API from ESRI

​

Class 18

13

14 of 34

Travel Time

  • More accurate portrayal of human movement
    • Requires travel network or travel surface
      • API from ESRI
      • Computationally $$$
  • Vehicular Based: US Studies
    • Augmented using alternative transit

​

​

Class 18

14

15 of 34

Networks and Distance

  • In many cases, human movement is constrained to a network or network-like features
    • Point: True “separation” among places should not be measured as straight lines, as this is not how people “overcome” distance
    • Counterpoint: in some (many?) cases, Euclidean distances and network-based distances/times are highly correlated; hence Euclidean distances are a reasonable proxy

Class 18

15

16 of 34

Measuring Distance

  • Basic Approaches
    • Absolute
      • Based on actual distance separating them
    • Relative
      • Nearest Feature or K nearest features
        • Nearest feature is considered a neighbor
      • Topology Based
        • Connecting features are considered neighbors

Class 18

16

17 of 34

Spatial Neighbors

18 of 34

Tobler’s First Law of Geography

  • Everything is related to everything else, but near things are more related than distant things
    • Values at locations near each other tend to be similar, with similarity decreasing over distance
  • Implies phenomena are NOT distributed randomly

Class 18

18

19 of 34

Neighborhood

  • Neighborhood has many definitions
    • Zone of influence
    • Idea of nearness or connectedness
      • Things or objects that are near one another
      • Things or objects that affect one another

Class 18

19

20 of 34

Neighbors

  • Neighbors are features located within a neighborhood
  • To describe or characterize spatial relationships among objects requires us to define the neighbor relationships
    • Neighbors for each observation!
  • Why Important
    • Many (all?) tests that integrate “space” or “position” require some form of neighborhood definition or the identification of neighbors

​

​

​

Class 18

20

21 of 34

Approaches to Calculating Neighbors

Class 18

21

Binary

Continuous

Absolute

Relative

22 of 34

Approaches to Calculating Neighbors – Binary vs Continuous

Class 18

22

​

    • Either you are neighbor, or you are not

Binary

    • Amount of “neighborliness”
    • Generally based on distance
    • Conceptually some maybe be stronger or weaker than others

Continuous

23 of 34

Approaches to Calculating Neighbors – Absolute

  • Objects are considered neighbors based upon a predetermined threshold distance
    • Distance between points
    • Distance between polygon centroids

Class 18

23

24 of 34

Approaches to Calculating Neighbors – Absolute Examples

Class 18

24

25 of 34

Approaches to Calculating Neighbors – Continuous Distance

  • Strength or weight of neighbor relationship determined by using an “inverse” relationship with distance
    • Short distance = High weight
    • Long distance = Low weight

Class 18

25

 

 

26 of 34

Approaches to Calculating Neighbors – Relative Nearest Feature

  • Nearest feature
    • Distance between points
    • Distance between polygon centroids

​

Class 18

26

27 of 34

Approaches to Calculating Neighbors – Relative Topology

  • Topology
    • Not available for points
    • Based on shared borders for polygons
      • Queen Connectivity
        • Common edge or common vertex
      • Rook Connectivity
        • Common edge

​

Class 18

27

28 of 34

Neighbor Weight Matrix

  • Matrix is a table with n rows and n columns
  • The number of observations = n
  • Entries in this table describe the neighbor relationships between observations

​

Class 18

28

29 of 34

Social Distance

  • Entries in the neighborhood weight matrix describe the relationships between observations
    • These do not have to be based on geographic relationships!
  • e.g., network connectivity�e.g., sociodemographic similarity

Class 18

29

30 of 34

Thiessen Polygons

  • Vector-based regions (neighborhoods)
    • Based on Euclidean distance
    • Nearest region to a point location
      • Relative measurement of distance
  • Start with set of points
  • Create a new polygon for each input point
    • Observations within each polygon are assigned to the point to which they are nearest
    • Nearest point defines “neighborhood” membership

​

Class 18

30

31 of 34

Thiessen Polygons Steps

  • Create Thiessen polygons from points
  • Spatially overlay other data
    • Easy if points, if polygons or lines …

Class 18

31

32 of 34

Neighborhoods - Applied

  • How do I decided how to define my neighborhood, and how to weight my neighbors??
    • No simple answer!!
      • Theory Driven -> cite previous literature
      • Empirical Approach
        • Rules of Thumb = not good
        • Exploratory data analysis!!!

Class 18

32

33 of 34

Empirical Approaches – Data Analysis

  • Explore your data
    • Choose spatial autocorrelation metric (more on this later!)
    • Test metric over multiple neighborhood definitions
    • Test metric over multiple neighborhood parameters
  • Result will likely be semi consistent

Class 18

33

34 of 34

Connectivity

  • Number of neighbors in each feature
    • Some neighborhood definitions are explicit
      • K nearest vs absolute distance based
  • Evaluation
    • Histogram - Number of neighbors on X axis, frequency on Y axis
    • Connectivity Map – lines on connecting polygons

Class 18

34