Code Monkey home page Code Monkey logo

mkupisie / calculating-spatial-autocorrelation-of-income-pysal-esda-geopandas Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 494 KB

Calculating global and local spatial autocorrelation of income noted per each polish county in 2022 based on Moran's I and LISA statistics. Calculations were conducted using the following packages: pySAL, splot.esda, geopandas.

Jupyter Notebook 100.00%
esda geopandas income-dataset lisa pysal spatial-autocorrelation

calculating-spatial-autocorrelation-of-income-pysal-esda-geopandas's Introduction

Calculating global and spatial autocorrelation of income

Calculating global and local spatial autocorrelation of income (average monthly gross wages and salaries) noted per each polish county in 2022 based on Moran's I and LISA statistics. Calculations were conducted using the following packages: pySAL, splot.esda, geopandas.

Detailed steps of calculating spatial autocorrelation are described within the code.

Note: For the purpose of spatial autocorrelation calculation, the geometry of counties shapefile must have been fixed as it contained overlapping polygons (overlapping polygons could influence the results as in the calculation 'neighbour' was defined as any polygon that is sharing at least one common vertex of the border).

Fixing overlapping polygons

For this purpose the following steps and vector function in QGIS were used:

  • Topology Checker: to identify overlapping polygons
  • Polygon Self-Intersection: to create new separate polygons from overlapping parts
  • Editing ids of new created polygons, so that it is the same as one of the polygons to which it is adjacent
  • Dissolve: to dissolve polygons based on their unique ids

the technique can be seen here: https://www.youtube.com/watch?v=DMmGTtLx73M (this technique was chosen for the purpose of the spatial autocorrelation calculation, because the area of the overlapping polygons was less than 1% of the Poland area, so regardless of which neighboring polygon the overlapping layers were attached to, it should not affect the results).

Topology checker QGIS_topography_checker_overlapping

Polygon Self-intersection QGIS_intersected_parts

Topology checker after dissolving polygons topology_check_after

calculating-spatial-autocorrelation-of-income-pysal-esda-geopandas's People

Contributors

mkupisie avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.