Vacant housing units within .25 miles (~.4km) of high schools.
Find analyses allow you to find feature data with a SQL or spatial query or to export feature data to create new feature data.
In this tutorial, you use the Find Existing Locations and Derive New Locations operations to determine which neighborhood areas have more vacant housing to live in within a quarter of a mile of high schools in San Francisco. You can perform the combine analyses either in Map Viewer or programmatically using the ArcGIS Python, ArcGIS REST JS, and ArcGIS REST APIs.
The analyses include:
Finding high schools within San Francisco (excluding Treasure Island and Yerba Buena Island).
Finding neighborhoods within a quarter mile (~.4 km) of a high school.
Identifying the census blocks within neighborhoods closest to a high school.
Styling the census blocks to identify the blocks with most vacant housing.
After performing the analyses, you will export the results to a KML file.
Prerequisites
Steps
Copy the web map
The tutorial web map contains predefined layers to use as the starting point for the analyses outlined in the steps below.
Verify that you have the following layers by toggling the visibility on and off:
San Francisco Schools
Census blocks with housing data
San Francisco neighborhoods with population
Click Save > Save As > Save Map to save a copy.
Create a feature layer with high schools
The San Francisco Schools hosted feature layer contains 445 schools in San Francisco, including independent, private, and public schools. Use the Find Existing Locations operation to return only high schools (grades 9-12) in San Francisco.
Steps to use the Map ViewerSteps to use ArcGIS Python, REST JS, and REST APIs
In the top bar, click Analysis > Find Locations > Find Existing Locations.
Select San Francisco Schools.
Click Add Expression to build the following query:
San Francisco Schools
where(attribute query)
Category
is
USD Grades 9-12
Click Add.
Set the Result layer name to: San Francisco High Schools.
Click Show credits. The analysis will consume approximately USD $.00004 (.445 credits).
Click Run Analysis.
Select the San Francisco High Schools layer > Show Table to see the features returned.
Provide an ArcGIS Identity to access the spatial analysis service.
Define the parameters of the request.
Execute the operation. Note: This is a long transaction managed with a job request.
Handle the results.
APIs
ArcGIS API for PythonArcGIS API for PythonArcGIS REST JS
The results contain 22 high schools in the San Francisco area.
Derive new neighborhood areas near a high school
The San Francisco Neighborhoods hosted feature layer contains the boundaries for 92 neighborhoods in San Francisco. To find the areas within a neighborhood that are closest to the 22 high schools found in the previous analysis, use the Derive New Locations operation.
Steps to use the Map ViewerSteps to use ArcGIS Python, REST JS, and REST APIs
Construct the spatial query
In the top bar, click Analysis.
In the panel, click Find Locations > Derive New Locations.
Click Add Expression to create the following query:
SF Neighborhoods
within a distance of
.25Miles
from
San Francisco High Schools
Click Add
Set the Result layer name to: Neighborhood portions near high schools.
Click Show credits. The analysis will consume approximately USD $.000011 (.11 credits).
Click Run Analysis to create the new layer.
Style neighborhoods
To differentiate between the neighborhoods, style Neighborhood portions near high schools with a unique symbol.
Select the Neighborhood portions near high schools > Change Style.
Select nbrhood from the dropdown under Choose an attribute to show.
Click Options within Types(Unique symbols).
Click Done
The neighborhoods should all have unique colors.
Provide an ArcGIS Identity to access the spatial analysis service.
Define the parameters of the request.
Execute the operation. Note: This is a long transaction managed with a job request.
Handle the results.
APIs
ArcGIS API for PythonArcGIS API for PythonArcGIS REST JS
The resulting layer contains neighborhoods within a .25 mile buffer of the schools.
Find census blocks completely within neighborhood portions
Census blocks are statistical areas bounded by roads, property lines, and other features. In cities, they can correspond to city blocks. The Census blocks with housing data hosted feature layer contains 7,823 features with attribute informtion about the total number of vacant housing units per block. Use the Derive New Locations tool to find which census blocks are completely within the .25 mile buffer of neighborhood sections.
Steps to use the Map ViewerSteps to use ArcGIS Python, REST JS, and REST APIs
Construct the spatial query
In the top bar, click Analysis.
In the panel, click Find Locations > Find Existing Locations.
Select Census_blocks_with_housing_data as the input layer.
Click Add Expression to create the following query:
Census blocks with housing data
completely within
Neighborhood portions near high schools
Click Add
Set the Result layer name to: Census blocks within neighborhood portions.
Click Show credits. The analysis will consume approximately USD $.000786 (7.86 credits).
Click Run Analysis to create the new layer.
Style the resulting layer
The Census blocks within neighborhood portions layer contains attributes, such as the total number of rentals, owner-occupied housing, and total units available. Style the feature layer to visualize the amount of housing units available per census block.
In Content, select Census blocks within neighborhood portions > Change Style.
Choose 2020 Vacant Housing Units from the dropdown.
Select Counts and Amounts(Color) > Options > Symbols to select a color ramp, for example yellow to red.
Click OK > OK > Done.
In the top bar click Save to save your web map.
Provide an ArcGIS Identity to access the spatial analysis service.
Define the parameters of the request.
Execute the operation. Note: This is a long transaction managed with a job request.
Handle the results.
APIs
ArcGIS API for PythonArcGIS API for PythonArcGIS REST JS
The resulting layer should look something like this
Export as KML
You can use the Extract Data operation to export your own or a shared layer, if the owner of the layer has enabled exporting. You can export a layer into formats such as: CSV, File Geodatabase, Shapefile, and KML. Use the operation to export the Derived census blocks hosted feature layer as a KML file.
Steps to use the Map ViewerSteps to use ArcGIS Python, REST JS, and REST APIs
In the top bar > Analysis > Manage Data > Extract Data.
Set the following:
Layers to extract: Census blocks within neighborhood portions.
Study area: Same as Census blocks within neighborhood portions.
Select KML from the dropdown under Output data format.
Set Output file name to: Extract census blocks.
Click Run Analysis.
Click Show credits. The analysis will consume USD $ .000023 (.23 credits).
Locate the saved KML file in your folder.
Click the Extract census blocks file.
On the right of the Overview page, click Download.
Provide an ArcGIS Identity to access the spatial analysis service.
Define the parameters of the request.
Execute the operation. Note: This is a long transaction managed with a job request.
Handle the results.
APIs
ArcGIS API for PythonArcGIS API for PythonArcGIS REST JS
Go to the folder in which you saved the file to verify that it is there.
Display the KML file in Google Earth
Extract data and convert it to a different data format...a nice feature to have...a beneficial feature to have to support interoperability to different services. KML files can be used in a Google Earth project. Upload the KML file to Google Earth to see the census blocks from the exported file.
You will be zoomed in to San Francisco and see the census blocks that were exported from the Census blocks within neighborhood portions. However, you will not see the layer styles that were applied earlier.
What's next?
You performed a series of find analyeses to identify the areas of census blocks that have vacant housing units near a high school. Your web map should look something like this.