20
CrossTab Zhuoyue Zhou, Zifeng Li, Xiaoyan Hu

CrossTab - Welcome to Zhuoyue's PORTFOLIO! · 2018. 8. 30. · Crosstab toolbox could achieve following objectives: Produce cross-classification image. Create cross-tabulation table

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CrossTab - Welcome to Zhuoyue's PORTFOLIO! · 2018. 8. 30. · Crosstab toolbox could achieve following objectives: Produce cross-classification image. Create cross-tabulation table

CrossTab

Zhuoyue Zhou, Zifeng Li, Xiaoyan Hu

Page 2: CrossTab - Welcome to Zhuoyue's PORTFOLIO! · 2018. 8. 30. · Crosstab toolbox could achieve following objectives: Produce cross-classification image. Create cross-tabulation table

Why we chose it?The Land Change Modeler in Terrset provides a rapid assessment of land cover change, presenting the change, persistence and specific transition both in map and graphical form.

But In ArcMap, the way to conduct these analyses is using the Tabulate Area tool, which could generate outputs that are in areas not in amount of cells, and could not provide a map to display land cover change.

Page 3: CrossTab - Welcome to Zhuoyue's PORTFOLIO! · 2018. 8. 30. · Crosstab toolbox could achieve following objectives: Produce cross-classification image. Create cross-tabulation table

Research Objectives:Create crosstab toolbox, which performs a cross-tabulation analysis that compares images

containing categorical variables.

The crosstab tool could produce cross-classification image to show the transition between categories in the two images.

The crosstab tool could create a tabular matrix that shows the number of pixels that correspond to each combination of categories in the two (column-row) images being compared.

The crosstab tool could create a bar chart that shows the number of pixels in each category that correspond to two images being processed.

The crosstab tool could create map to present the transition from one category to another category, from one to many other categories or from many categories to one.

Page 4: CrossTab - Welcome to Zhuoyue's PORTFOLIO! · 2018. 8. 30. · Crosstab toolbox could achieve following objectives: Produce cross-classification image. Create cross-tabulation table

Flow Chart

Page 5: CrossTab - Welcome to Zhuoyue's PORTFOLIO! · 2018. 8. 30. · Crosstab toolbox could achieve following objectives: Produce cross-classification image. Create cross-tabulation table

Interface

Page 6: CrossTab - Welcome to Zhuoyue's PORTFOLIO! · 2018. 8. 30. · Crosstab toolbox could achieve following objectives: Produce cross-classification image. Create cross-tabulation table

Edit ToolValidator Class

Reference: http://gis.stackexchange.com/questions/113879/setting-up-drop-down-list-in-parameters-of-python-script-tool

Main Steps:

Define the function updateParameters(), which enables user to choose categories from drop down lists.

Page 7: CrossTab - Welcome to Zhuoyue's PORTFOLIO! · 2018. 8. 30. · Crosstab toolbox could achieve following objectives: Produce cross-classification image. Create cross-tabulation table

Import module:

Page 8: CrossTab - Welcome to Zhuoyue's PORTFOLIO! · 2018. 8. 30. · Crosstab toolbox could achieve following objectives: Produce cross-classification image. Create cross-tabulation table

Main Function

Page 9: CrossTab - Welcome to Zhuoyue's PORTFOLIO! · 2018. 8. 30. · Crosstab toolbox could achieve following objectives: Produce cross-classification image. Create cross-tabulation table

CrossTab Image:

Main steps:

Detect the transition condition between categories and assign values for corresponding pixels in the output image.

Replace the randomly chosen values to values based on the order of values in the input images.

Page 10: CrossTab - Welcome to Zhuoyue's PORTFOLIO! · 2018. 8. 30. · Crosstab toolbox could achieve following objectives: Produce cross-classification image. Create cross-tabulation table

Figure:

Main steps:

Calculate the total number of pixels for each category.

Matplotlib function

Reference: https://plot.ly/python/bar-charts/

Page 11: CrossTab - Welcome to Zhuoyue's PORTFOLIO! · 2018. 8. 30. · Crosstab toolbox could achieve following objectives: Produce cross-classification image. Create cross-tabulation table

Main Steps:

Calculate the maximum value for y axis.

Format output, including bar width, legend extent and font size.

Page 12: CrossTab - Welcome to Zhuoyue's PORTFOLIO! · 2018. 8. 30. · Crosstab toolbox could achieve following objectives: Produce cross-classification image. Create cross-tabulation table

Report:

Main Steps:

Summary the total number of pixels that represent the change from one category to another one in two images.

Calculate number of persistent pixels.

Page 13: CrossTab - Welcome to Zhuoyue's PORTFOLIO! · 2018. 8. 30. · Crosstab toolbox could achieve following objectives: Produce cross-classification image. Create cross-tabulation table

Boolean Images: One-to-One

-The (key, value) in dictionary_sort{} stands for the (category, pixel value) in the cross-classification image.-Randomly define two categories x and y to calculate the land change from x to y. -Look up the key (x, y) in dictionary_sort{}:-Existing: loop the cross-classification image and

assign the value of key(x,y) to a new blank image at the corresponding location.-Not: no change & a black image.

Page 14: CrossTab - Welcome to Zhuoyue's PORTFOLIO! · 2018. 8. 30. · Crosstab toolbox could achieve following objectives: Produce cross-classification image. Create cross-tabulation table

One-to-AllSimilar method to one-to-one.-Randomly assign a value for x and place y as the variable.-For each key(x,y) in keys(x,y), look it up in the dictionary_sort{ }:-Exsiting: loop the cross-classification image and

assign values to a new blank image.-Not: look up for the next one.

Page 15: CrossTab - Welcome to Zhuoyue's PORTFOLIO! · 2018. 8. 30. · Crosstab toolbox could achieve following objectives: Produce cross-classification image. Create cross-tabulation table

All-to-One-Randomly assign a value for y and place x as the variable.-For each key(x,y) in keys(x,y), look it up in the dictionary_sort{ }:-Exsiting: loop the cross-classification image and

assign values to the new blank image.-Not: look up for the next one.

Page 16: CrossTab - Welcome to Zhuoyue's PORTFOLIO! · 2018. 8. 30. · Crosstab toolbox could achieve following objectives: Produce cross-classification image. Create cross-tabulation table

RUN IT

Page 17: CrossTab - Welcome to Zhuoyue's PORTFOLIO! · 2018. 8. 30. · Crosstab toolbox could achieve following objectives: Produce cross-classification image. Create cross-tabulation table

Output Table Comparison

Our Output Table

Output Table from Terrrset

Page 18: CrossTab - Welcome to Zhuoyue's PORTFOLIO! · 2018. 8. 30. · Crosstab toolbox could achieve following objectives: Produce cross-classification image. Create cross-tabulation table

Summary:

Crosstab toolbox could achieve following objectives:

Produce cross-classification image.

Create cross-tabulation table that shows the number of transition between categories.

Generate a bar chart that shows the number of pixels in each category.

Create Boolean map to exhibit the transition between user-defined categories.

Page 19: CrossTab - Welcome to Zhuoyue's PORTFOLIO! · 2018. 8. 30. · Crosstab toolbox could achieve following objectives: Produce cross-classification image. Create cross-tabulation table

Limitations And Further Research:Limitation:

Could only perform hard classification but not soft classification.

There might be redundancy in the script.

Further Research:

Generate a thematic map for land cover change.

Create gains and losses bar chart for land cover categories.

Page 20: CrossTab - Welcome to Zhuoyue's PORTFOLIO! · 2018. 8. 30. · Crosstab toolbox could achieve following objectives: Produce cross-classification image. Create cross-tabulation table

Question?