Top Banner
SPATIAL JOIN 3/1/2012 Spatial Join Calculating Number of Physician per Population GIS in Health and Planning 2012 Spring Rutgers University by Wansoo Im, Ph.D.
63
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Join location from another layer pivot table

SPATIAL JO

IN

3/1/2

012

Spatial JoinCalculating Number of Physician per Population

GIS in Health and Planning2012 SpringRutgers Universityby Wansoo Im, Ph.D.

Page 2: Join location from another layer pivot table

Download census tract 2000 fi le

-www.state.nj.us/dep/gis

Download Municipal boundaries

-https://njgin.state.nj.us

“doctor point location layer” (downlaod from Sakai )

Census tract map/Municipali ty boundaries

=>Add Al l Maps in Arc GIS

Page 3: Join location from another layer pivot table

CENSUS TRACT : OPEN ATTRIBUTE TABLE

In order to see what kind of information it has

Page 4: Join location from another layer pivot table

DOCTOR LOCATION LAYER : OPEN ATTRIBUTE TABLE

In order to see what kind of information it has

Page 5: Join location from another layer pivot table

HOW TO JOIN LOCATIONAL DATA WITH DATA FROM ANOTHER LAYER?

Based on the location, we wil l join doctor’s location into Census tract layer.

Page 6: Join location from another layer pivot table

JOIN DOCTOR POINTS WITH CENSUS DATA LAYER

Page 7: Join location from another layer pivot table

CLICK “DATA FROM ANOTHER LAYER BASED ON SPATIAL LOCATION”

Page 8: Join location from another layer pivot table

SELECT “THE LAYER(CENSUS TRACT)” WHICH YOU WANT TO JOIN WITH DOCTOR LOCATION

Page 9: Join location from another layer pivot table

SET THE DIRECTORY(LOCATION TO SAVE YOUR SHAPEFILE) -> CLICK “SHAPEFILE”

Page 10: Join location from another layer pivot table

OPEN ATTRIBUTE TABLE TO CHECK IF NEW LAYER(DOCTOR CTR) IS SUCCESSFULLY JOINTBy opening attribute table, you can check if data from 2 original

layers(doctor points/census tract information) are included into a newly-created shapefi les.

Page 11: Join location from another layer pivot table

LOOK THROUGH DATA

Page 12: Join location from another layer pivot table

EXCEL – PIVOT TABLE

Objectives :

We are going to export data from maps into dbf.

(dbf. Fi le includes the information of table, therefore, all shapefiles including data in the table have dbf. fi le)

Open dbf. Fi le in Excel

By using Pivot table, we wil l calculate the number of doctors by each census tract

(the number of doctors belonging to each census tract)

Page 13: Join location from another layer pivot table

OPEN ATTRIBUTE TABLE OF DOC_CTR LAYER

Click the menu icon to export data from table.

Page 14: Join location from another layer pivot table

EXPORT DATA “DBF. FORMAT FILE”

Page 15: Join location from another layer pivot table

WHY WE EXPORT DATA FROM TABLE? (DBF. FORMAT)

Originally Doc_CTR shapefi le already has one dbf.f i le, however, i f we start to open it in the excel and modify, we can possibly affect the original map data as the table is directly l inked to a map. Therefore, we would l ike to export data from the original table so as to create new dbf. Fi le(so to speak, “copy” dbf. f i le). In this way, we can adjust data(by using a new dbf. Fi le) in Excel regardless of affecting original data in the map.

Page 16: Join location from another layer pivot table

OPEN -> CLICK “ALL FILES”-> CLICK “DBF FILE”

Page 17: Join location from another layer pivot table

OPEN IN EXCEL

Page 18: Join location from another layer pivot table

WE CAN USE EXCEL FOR DATA CALCULATION!

Page 19: Join location from another layer pivot table

THE NUMBER OF DOCTORS WITHIN EACH OF CENSUS TRACT. Number of doctors in each of census tract.

How do we calculate?

Page 20: Join location from another layer pivot table

USE UNIQUE ID TO JOIN “INDIVIDUAL DOCTOR LOCATION” WITHIN CENSUS TRACT

– “KEY” FIELD OR “STFID” (CENSUS TRACT ID)

Why can’t we use Tract f ield? – Tract id is within County (Aggregate scale)

Page 21: Join location from another layer pivot table

CLICK “INSERT” -> PIVOT TABLE

Page 22: Join location from another layer pivot table

CLICK “PIVOT TABLE”

Page 23: Join location from another layer pivot table

CLICK OK

Page 24: Join location from another layer pivot table

THEN YOU WILL SEE THIS TABLE ;

Page 25: Join location from another layer pivot table

DRAG “STFID” INTO ROW LABELS

Page 26: Join location from another layer pivot table

DRAG “STFID” INTO VALUES

Page 27: Join location from another layer pivot table

COPY THE TABLE

Page 28: Join location from another layer pivot table

PASTE “VALUE” INTO NEW “SHEET”

Counting Case depending on variable that you chose.

In this case, Fivot Table counts the number of doctors depending on the Census Tract Area(Assigned by unique ID).

Page 29: Join location from another layer pivot table

CLEAN THE DATA – FIRST ROW SHOULD INDICATE THE NAME OF FIELD

Page 30: Join location from another layer pivot table

CLEAN THE DATA – DELETE LAST ROW ; TOTAL NUMBER

Page 31: Join location from another layer pivot table

CHANGE “SHEET” NAME INTO DATA

Name that you can remember

No space/No special characters

(Arc GIS cannot recognize)

Page 32: Join location from another layer pivot table

SAVE EXCEL FILE AND CLOSE ITBEFORE JOINING IN ARC GIS PROGRAM

Page 33: Join location from another layer pivot table

CENSUS TRACT LAYER- OPEN ATTRIBUTE BEFORE JOINING DATA

Page 34: Join location from another layer pivot table

JOIN THE TABLE

Page 35: Join location from another layer pivot table

JOIN ATTRIBUTE FROM A TABLE

Page 36: Join location from another layer pivot table

SELECT THE FIELD TO JOIN “STFID” (UNIQUE CENSUS TRACT ID)

Page 37: Join location from another layer pivot table

CLICK EXCEL FILE YOU SAVED

Page 38: Join location from another layer pivot table

CLICK THE “SHEET” THAT YOU SAVED NEW DATA (NO.DOCTORS BY CENSUS TRACT)

Page 39: Join location from another layer pivot table

SELECT THE FIELD(STFID) FROM “DATA SHEET”

Page 40: Join location from another layer pivot table

CHECK ATTRIBUTE TABLE TO MAKE SURE IF TABLE IS JOINT WELLThere are some null data because this census tract is statewide while

doctor location is located only within Middlesex county.

Page 41: Join location from another layer pivot table

CALCULATE THE NUMBER OF DOCTORS PER POPULATION WITHIN CENSUS TRACTThe number of doctor

The number of population

Let’s calculate doctors per population.

Page 42: Join location from another layer pivot table

ADD A NEW FIELD

Page 43: Join location from another layer pivot table

FIELD CALCULATION

Page 44: Join location from another layer pivot table

ADD FIELD

10 digit/3decimal

Page 45: Join location from another layer pivot table

CREATE NEW FIELD (FOR DOCTORS/POPULATION)->RIGHT CLICK TO DO “FIELD CALCULATING”

Page 46: Join location from another layer pivot table

FIELD CALCULATOR

But you wil l have 0 if denominator(total population2000=0) is 0

Select the data which population 2000 is more than 0

Use Field Calculator to use formula (number of doctors/population*100)

Page 47: Join location from another layer pivot table

2 WAYS FOR SELECTION

1. Select by Attribute

select the layer “census 2000”, and select the field “population2000” put formula

Pop2000>0 ->click apply

2. Sorting Ascending in Attribute Table

Open Attribute table, sort the data regarding population 2000, and select data which is more than 0 in population 2000 field.

Page 48: Join location from another layer pivot table

EX1) SELECTION BY SORTING POPULATION

Page 49: Join location from another layer pivot table

EX2) SELECTION BY MENU (SELECTING BY ATTRIBUTE)Make sure i f Population(denominator) is 0 not

Page 50: Join location from another layer pivot table

FIELD CALCULATOR

Page 51: Join location from another layer pivot table

RATE CALCULATION – WHY 1000? INSTEAD 100?

Page 52: Join location from another layer pivot table

IF THERE’S NULL DATA => ERROR!!!

Population should be over 0 AND

Number of doctors shouldn’t be null data

Therefore, number of doctor is more than 0 and calculate it again

(Assume that i f there’s doctor, population is over 0)

Page 53: Join location from another layer pivot table

YOU WILL GET NO.DOCTORS PER POPULATION PERCENTAGE IN NEW FIELD YOU CREATED.

Page 54: Join location from another layer pivot table

OUTCOME

Page 55: Join location from another layer pivot table

UNSELECT DATA

Page 56: Join location from another layer pivot table

GO TO SYMBOLOGY AND MAP IT OUT!

The number of doctors per population

Page 57: Join location from another layer pivot table

EXPORT MIDDLESEX MUNICIPALITY FROM CENSUS TRACT

Page 58: Join location from another layer pivot table

SELECT MUNICIPAL OF MIDDLESEX COUNTY

Page 59: Join location from another layer pivot table

EXPORT MIDDLESEX COUNTY CENSUS TRACT

Field : Double cl ick “County”

Click “Unique value

County= Middlesex county

Page 60: Join location from another layer pivot table
Page 61: Join location from another layer pivot table

CHANGE DECIMAL DEGEE IN LEGEND -> CLICK “LABEL” AND “FORMAT LABEL” CHANGE DECIMAL DEGREE.

Page 62: Join location from another layer pivot table

EXPORT MUNICIPAL BOUNDARY SHAPEFILE.

County = Middle sex

Page 63: Join location from another layer pivot table

EXPORT MIDDLESEX COUNTY BOUNDARY SHAPEFILE.