Sunday, April 3, 2016

GIS 1 Lab 4

Goals and Background:
The goal of this lab was to use the skills I learned from lectures and tutorials in class to develop queries that returned the desired results in the instructions and assess my knowledge of attribute queries and spatial queries. A combination of Boolean expressions, operators and parentheses were used to develop the correct multiple criteria queries that the instructions requested.


Part 1

Query 1
Methodology:
Part one focused on the United States for building multiple criteria queries. From a blank map in ArcMap I added the counties shapefile from the USA geodatabase in my mgisdata folder. To begin building my first query I opened the selection drop-down menu from ArcMap and chose the 'Select by Attributes' tool. This opened a new window in which I chose my layer to select attributes from, in this case counties. The method of choosing the attributes remained at its default 'Create a new selection'. The next step was to begin building query 1 and to do so I first added parentheses to my query to separate one part from the other, then I scrolled through my options until I found the expression that represented the 2010 population 'POP2010'. Double clicking on the expression added it to the query box. In order to get a result that returned a population between 3000 and 4000 I added a greater than or equal to sign to include 3000, then I added the AND operator to include all attributes between the two numeric values: 3000 and 4000 and selected 'POP2010', a less than or equal to sign and entered in 4000 as the final numeric value in this part of the query. Another parenthesis closed off the first part so I could begin on the second part of query 1. The second part was left out of parentheses because they were not necessary as the first part was already separated from the second part. The second part of query 1 required the use of a new Boolean expression "POP10_SQMI. This expression would return results of the 2010 population in persons per square mile and for this particular part of the query, I wanted the population per square mile greater than or equal to 1000. First I had to use an OR operator, this operator selects records for which either expression is true, that is it would select records that have a population between 3000 and 4000 and it would select records that have a population per square mile over 1000. After the OR operator I added the 'POP_SQMI' expression, the greater than or equal to sign and 1000 as the final numeric value. In order to execute the query to actually return any records, I first verified it to check for any errors and then clicked okay. The counties highlighted were the records returned from the query. From the counties layer in the Table of Contents, I right-clicked it to open a new menu and under the selection tab I chose to create a new layer from the selected attributes. This created a  new layer so I could create a cartographically pleasing map instead of having all of the selected counties outlined by the query.


Query 1: Multiple criteria query that shows counties with a population between 3000 and 4000 people in 2010 as well as counties in 2010 that had a population density greater than or equal to 1000 persons per square mile.  
Query 1 results
Results:
The results from query 1 are shown above. The query I developed was a multiple criteria query that returned counties in the United States with a population between 3000 and 4000 (including 3000 and 4000) and counties that had a 2010 population density of at least 1000 persons per square mile.  The resulting query and map are shown above with the desired counties highlighted in yellow on the map.

Query 2
Methodology:
Query 2 focused again on the United States when returning desired records. I began first by clearing the first query from the map and from the select by attributes window. The first step to creating Query 2 was similar to Query 1 in that I used the selection tool to open the select by attributes window. The layer stayed the same, counties and the method also stayed the same, create a new selection. For this query I wanted counties within specific states so to start the query I needed to specify which state I wanted. To do so I entered the expression 'STATE_NAME', an equal sign to indicate the exact state I wanted results from and the state name. After I used the AND operator to isolate specific results within that state. To follow that I added parentheses to separate one part of the query from the other, and in the parentheses I added the male population greater than the female population. The last part of the query, followed by another AND operator was intended to return results of counties with a senior population greater than 6500. to add this to Query 2 I found the 'AGE_65_UP' expression, added a greater than sign and added the 6500 value.
Query 2: Multiple criteria query that shows counties in Wisconsin where the male population is greater than the female population and where the population of seniors (ages  65 and up) is greater than 6500. Other queries were created with the same structure but for different states: Texas, New York, Minnesota and California.

Query 2 results
Results: The query I developed was a multiple criteria query that returns counties in a state that have a male population that is greater than the female population and counties that have a senior population, ages 65 and up, that is greater than 6500. The states I used for this query were Wisconsin, Minnesota, California, Texas and New York, the counties in each state are highlighted in different colors: Wisconsin counties in orange, Minnesota counties in purple, California counties in pink, Texas counties in yellow and New York counties in green.

Query 3
Methodology:
Similar to the first two queries, Query 3 focused on the United States counties. From the select by attributes window, the layer remained on counties and the method remained on create a new selection. I also maintained the use of the 'STATE_NAME' expression, as I wanted results from specific states. The query begins by naming the state I wanted to isolate then using the AND operator to separate the first part of the query from the second part. Parentheses were also used for the second part to further isolate that specific part of the query from the first and third parts. After the AND operator I added the parentheses and within those I added the 'AGE_65_UP' expression followed by the greater than sign and 6500 as a numeric value. I ended that part of the query with a closing parenthesis and another AND operator to indicate a new part of the query. The final part made use of the 'HSE_UNITS' expression which indicates the number of housing units per county. After this expression I added a greater than sign and 30000 as a numeric value.


Query 3: Multiple criteria query that shows the counties in a state containing seniors ages 65 and above and containing more than 30,000 housing units. The same structure of the query was used for multiple other states, including Washington, Maryland, Illinois, Nebraska and District of Columbia.
Query 3 results


Results: The query I developed was a multiple criteria query similar to the first two. This query returned results for counties in the states of Washington, Maryland, Illinois, Nebraska, District of Columbia and Michigan. The query intended on returning results for counties where the senior population was greater than 6500 and those counties also contained more than 30000 housing units. Washington counties are shown in dark orange, Illinois counties are shown in pink, Michigan counties in yellow, Nebraska counties (though very few) are shown in a pale orange, Maryland counties in green and unfortunately, the District of Columbia counties were too small to be seen on the map.


Part 2


Query 1
Methodology:
This query had multiple parts using two different tools. I started by using the select by attributes tool and entered in the query " 'POP2007' > 15000 AND 'POP2007' < 20000 AND 'AREALAND' >= 5 AND 'FEMALES' > 'MALES' " This part of the query was separated by the AND operators So it would return population data, city area data and the ratio of females population greater than the male population. After applying that part of the query I opened the select by location tool and changed the selection method to "select from the currently selected features in". This would ensure that the results returned from this part of the query stemmed from the first part. I chose the target layer as WI_cities, the source later to be Lakes, and the spatial section method to be "are within a distance of the source layer" with a distance of 2 miles. Finally, I clicked the OK button to apply this part of my query to the first part.


Query 1: Selecting by both attributes and location to return a result of the cities in Wisconsin that have a population between 15,000 and 20,000, where the female population is greater than the male population, the area of the city is greater than or equal to 5 square miles and the city is within 2 miles of a lake.
Query 1 result



Results: The results of Query 1 returned data of cities in Wisconsin that have a population between 15000 and 20000, with a female population greater than the male population and the area of those cities being greater than or equal to 5 square miles. This was part one of Query 1. Part two of Query 1 was a location query that returned results of the cities selected in part one that were within 2 miles of a lake. A map of the results and the two queries are shown above


Query 2

Methodology:
This query was simple to construct but involved selecting multiple rivers. To do so I simply added the 'PNAME' expression an equal sign, and the name of the river I wanted to select. To include other rivers in the same selection I would add the AND operator and use the same structure as the first part of the query: 'PNAME' = "river name". I got the river names from the unique values list to save time instead of typing out all the names.
Query 2: The same structure was used for different rivers listed.


Query 2 result
Results: The results returned a record of the rivers I selected from the instructions given to me. In the map above the results are shown with a backdrop of major roads, lakes and counties in Wisconsin. The rivers selected are: The Chippewa River, Eau Claire River, Embarrass River, Fisher River, Hunting River, Kinnickinnic River, Maunesha River, Milwaukee River, Moose River, Namekagon River, Pelican River, Platte River and Potato River.