Thursday, October 17, 2013

Lab 4: ArcGIS Flex API

Goal and Background
The purpose of this lab was is to familiarize us with ArcGIS Flex API with the goal of developing a Web GIS application. To build the application, Adobe Flash Builder was used. Although Flash Builder 4.6 works with ArcGIS Flex API, the version 4.7 was used in this lab.

**Data for this lab was served to us in a compressed format by Dr. C. Wilson and was downloaded online.

Methods & Results
After downloading the data for this lab, the first thing that needed to be done was to create a new project in Flash Builder. Flash builder is a program within the Adobe CS6 software package. Next, we created a new Flex project and adjusted the version of Flex SDK to version Flex 4.6 which is the minimum requirement for ArcGIS Flex API. After setting the output folder to ‘bin-debug’, we were ready to import the Flex API library (agslib-3.4-2013-06-30.swc) that would be referenced when coding within Flex API. After connecting to our folders on the M-drive and then navigating through the Flex Build Path tutorial, we were able to add the library.
With our project created and saved with the reference API library, we were able to begin coding. First, the map UI component created in the first section was brought in by adding the ESRI namespace. The next step was to add a map component to our Flex application’s UI to serve as blank slate to allow for map content to be added later. The specific layers added were the ArcGISTiledMapServiceLayer that functioned as a baselayer, and the ArcGISDynamicMapServiceLayer that would show world population density. The specific code entered can be seen in Fig. 1.

Fig. 1: Code entered to add the map component to the application's UI

After running the code in Flash Builder to check for any errors present, the application opened in the web browser and displayed the map below. Although attribute data for the map was included, pop-ups did not display when you clicked on the map due to the fact that they were not configured within the code to show.

Map 1: Map created after running our application with the new code added.


After closing out of the previous project, we created another within Flash Builder. The same steps outlined above were followed to add the Flex API library. Next, a map hosted in ArcGIS Online was added to the project by referencing its identification number using the ActionScript block of code shown below in Fig. 2. Lastly, code needed to stylize and add a title to the map was added. The final code block for this section is shown below in Fig. 3. The map below is the application that was created from that code. Interactive pop-ups show on this map due to the fact that they were configured within the code we used for this application.

Fig. 2: Block of ActionScript code added to identify the ArcGIS Online map.
 
Fig. 3: Final block of code that includes the stylistic elements needed to add style and a title to the map. 


The final section of this lab taught us how to add our own map to display within a Flex application. We used the Wisconsin Web Map we created in Lab 2 to replace the Map ID to display our own map. Next, we customized an event handler graphic listener to create a mouse over function to be applied to our application. The mouse over code provided to us would be used, but needed to be modified to display information on Wisconsin counties instead of the counties in South Carolina which it was originally configured for. By editing the code in Notepad++ we were able to modify it to fit the extent of our application. Edited within the code were the functions of zoom, extent, map id, and definition expression to switch all mouse over controls from South Carolina to Wisconsin. Shown Below in Fig. 4 is a snapshot of what is displayed when you hold the mouse icon over Dane County.
Fig. 4: Snapshot of the mouse over function added to the application showing attribute data on Dane County, WI.


Sources
1. Lab4data.zip (Provided by Dr. C. Wilson)
2. Wilson. C. (2013). Lab 4:ArcGIS Flex API. GEOG 455: Web GIS, UW- Eau Claire.

Thursday, October 10, 2013

Lab 3: ArcGIS Flex Viewer

Goal and Background
            The purpose of this lab is to expose us to the one of the techniques used when creating a web GIS application. Using ArcGIS Flex Application Builder, the steps needed to configure a web application will be outlined. In addition to teaching how to configure a web application using ArcGIS Flex Application Builder, methods for finding and using data analytical services to further develop a web GIS application will also be done. Also, the structure of Flex XML 9extensible markup language) will also be introduced to configure custom widgets using XML script.
Methods and Results

**Data for this lab exercise was provided to us in the form of a compressed .zip file by Dr. C. Wilson. Services for the second portion of this lab were located in ESRI ArcGIS REST sample servers.

Once the data for this lab had been downloaded, the next step was to connect to our personal folders on the Universities virtual server. By connecting to this server, we would gain access to the ArcGIS Flex Application Builder interface. Once connected, we were able to open ArcGIS Viewer for Flex- Application Builder where each of the applications created would be displayed. Since this was our first time opening this program, no applications were displayed because there had been no projects created. After clicking the ‘Create a New application’ tab, and following the tutorial to name, save, and add operational basemaps/ layers, we were able to create our application. For this application, census block point data containing information on our study area (City of Eau Claire) was also added. Specifically, we chose to include Census 2000 Block Population data to include the attributes of population, the number of households, and also the total number of housing units. Next we set out to configure the widgets that would be contained within the application. Included in were the draw and locator widgets.
After creating our first application to become familiar with ArcGIS Flex Application Builder, the next task for this lab was to configure Arc GIS Flex Application Builder XML config files. Since this was our first time being exposed to MXML and ActionScrip languages, only basic manipulation of the code would be done to add a custom widget to the application through the use of reference services through a Flex Application configuration file. After entering the code pictured below into Notepad++ and then adding references to the swf, xml, and png files in the config.xml file we created earlier, the custom widget was added. The resulting application can be viewed at: http://gistest/STUDENTS/GEOG455Fall13/toppernd/Topper_Eau_ClaireApp1_Config/
Figure 1: XML code that specifies the color, selected census Block Points, and configuration of the specific fields. (Dr. C. Wilson, 2013)
 
The final task for this lab was to add and configure a custom widge directly in application builder. Using a topographic basemap, a detailed counties layer was added. Once this layer had been added, a thematic widget was added to show demographics of each county within the study area of northwestern Wisconsin. The application for this section of the lab can be viewed at: http://gistest/STUDENTS/GEOG455Fall13/toppernd/Topper_Thematic1/
Sources
1. http://sampleserver1.arcgisonline.com/ArcGIS/rest/services (Accessed October 2013)
2. Lab3data.zip (Provided by Dr. C. Wilson)
3. Wilson. C. (2013). Lab 3: ArcGIS Flex Viewer. GEOG 455: Web GIS, UW- Eau Claire.

Thursday, October 3, 2013

Lab 2: Geospatial Web Services


Goal and Background
To build upon the basics and fundamentals of web based maps learned in Lab 1, this week’s lab set out to expose us to processing geospatial data with the end goal of creating and hosting a geospatial web service via ArcGIS server and ArcGIS Online for Organizations. Included in this blog post will be technical report outlining the goal and background, methods, results, and sources used in the creation of the geospatial web service. Using ArcMap and ArcGIS Server to process, analyze and publish data provided by Dr. C. Wilson in the form of shape and Excel CSV files, the documentation of the skills learned to create a geospatial web service will be shown.
Methods & Results

To start, it was first necessary to download and unzip the Lab2_data.zip served to us by Dr. C. Wilson. Next, the Wisconsin Transit data was preliminarily viewed in ArcMap to become familiar with the four feature classes representing cities, interstates, highways and counties in Wisconsin. Once the data had been viewed, ArcMap was closed to allow for the data to be added to and published within ArcGIS.com. When publishing the data to create a data service of Wisconsin Transportation Data, specific tags were incorporated within the service to allow for the data to be searched for within ArcGIS online. The Tags used were ‘Cities’, ‘Interstate’, ‘US Highways’ and ‘City’. The map created can be found at: http://bit.ly/1btMflC

The second task of this lab was to publish a feature hosted service using a CSV file. Downloaded and unzipped in the same Lab2_data.zip was the data needed for this section. First the data needed to be opened in Microsoft Excel and then saved as a CSV file with the name ‘WI_fire_occ_2004.csv’. Next, the fire occurrence csv file was input into ArcGIS Online and was assigned two relevant tags. After configuring the attributes to only show the date of fires in the pop-up window, the data was ready to be published. The map created can be found at: http://bit.ly/1btNlho

The third task of this lab was to publish a feature hosted service using an ArcMap document. Again using the data served by Dr. Wilson, the ‘Rivers_and_streams_and_Lakes.shp’ needed for this task were input to and ArcMap session. Next, the input features were shared through the file share as service within Arc. After following the sequence of pop-up windows that allowed for certain parameters such as service editor, capabilities, and feature access to be manipulated, the data was analyzed to expose any errors, and then published. Once published, the map was then shared to allow for it to be viewed freely by certain ArcGIS Online Groups. The map created for this section can be found at: http://bit.ly/1btObe5

The final task of this lab was to publish a tiled map service using ArcGIS Server. To begin, it was first necessary to connect to our personal SDE database on ArcGIS server. Once connected, land use land cover data of the lower Chippewa River near Eau Claire, WI was added in the form of a raster image. After reclassifying the classes of land use land cover to include agriculture, forest, green vegetation, other urban, residential, and water, the map was published using the publish a service tutorial within ArcMap. The map created for this section can be found at: http://bit.ly/1aOFpTx
Sources

Environmental Science Research Institute, ArcMap USA geodatabase, Wisconsin Department of Natural Resources, Wisconsin Lakes.shp created by Dr. C. Wilson (2013), Rivers and streams.shp- United States Geological Surveys (USGS, 2008), Earth Resources Observation and Science Center (EROS). 2011. Processed by Dr. C. Wilson. 2012.