CrossTab - Welcome to Zhuoyue's PORTFOLIO! · 2018. 8. 30. · Crosstab toolbox could achieve...

Post on 23-Jan-2021

1 views 0 download

transcript

CrossTab

Zhuoyue Zhou, Zifeng Li, Xiaoyan Hu

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.

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.

Flow Chart

Interface

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.

Import module:

Main Function

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.

Figure:

Main steps:

Calculate the total number of pixels for each category.

Matplotlib function

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

Main Steps:

Calculate the maximum value for y axis.

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

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.

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.

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.

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.

RUN IT

Output Table Comparison

Our Output Table

Output Table from Terrrset

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.

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.

Question?