Thursday, October 17, 2013

GEOG.455 LAB 4 ArcGIS Flex API


Goal and Background

This lab is an introduction to using ArcGIS Flex application programming interface for developing Web GIS applications. With proper knowledge, the Flex API can be used to develop custom widgets for applications built with the Flex Application Builder.

Methods

The beginning of this lab deals with adding maps and layers through the Flex API. Once a new Flex project has been created in Adobe Flash Builder, we can then add the Flex API library. Currently, our Flex project is blank, but in order for map components to operate, we need to reference the ArcGIS Flex API that contains all the data required for the application.

In order to display geographic information in our new application we will use a web map. The Flex API provides us with a user interface map component that lets us display content by working with layers that reference web services, preconfigured web maps, or personal on-premise ArcGIS portals. In order to add a map user interface component to the project, we will work with a markup language called MXML.

The following set of code exists to reference the ArcGIS API for Flex library.


Once the reference is added to the markup we can begin to add map components to the application’s user interface. The first component we will construct will act as a placeholder for content later in the lab. The red text in the screenshot below represents this placeholder.




Finally, we will add two map components to the code. The two components include an ArcGIS Tiled Map Service Layer and an ArcGIS Dynamic Map Service Layer. The components are represented below in red text.





After all permutations and additions, the final code is displayed below.





Any errors will appear as red exclamation marks on the left side of the editor screen and will need to be adjusted in  order for the code to run properly. After running this code, the new application will open in a web browser.




The second part of this lab focuses on adding a web map to a Flex application. After referencing the Flex library and namespace, ActionScript can be added to the code in order to access and display a web map by its unique identification number. The code below contains the script which will display the web map. The long red code is the identification number. This code can be replaced by any other identification number from an ArcGIS Online web map url.





Next we will add a declaration. This code will declare the non-default and non-visual properties of the web map function that we entered in the script earlier.





The last component that we will add to this application is a title, which can be found in the code below.





The finished application will display an interactive map of the United States with pop-up information for each county.





In Part 3 of the lab, a pre-written code was opened that launched a web map application for the state of South Carolina. In order to customize the Event Handler graphic listener to display the state of Wisconsin, all that needs to be done is editing every instance of “South Carolina” to “Wisconsin”. After adjusting the zoom values, the web map application now displays data for Wisconsin instead of South Carolina.





Sources

Thursday, October 10, 2013

GEOG.455 LAB 3 ArcGIS Flex Viewer


Goal and Background

This lab is an introduction to creating web based GIS applications. The primary platform for application construction will be the ArcGIS Flex Application Builder. The ArcGIS Application Builder is great for creating easy to use and highly customizable web map applications. The lab will demonstrate how to configure Flex XML and custom web widgets using XML scripting.

Methods

By using ArcGIS Flex Viewer, it is easy to create an application and start configuring immediately. As soon as the application is given a name and save location, the builder displays many options for applying basemaps, operational layers, and map extent. These three features will create the backbone for our web application and will influence how the application will operate.


After the basemap is chosen, operational layers can be added to display different types of data. These operational layers can be further configured so that only certain fields are displayed in the application. In this example, our map will be displaying census block data from 2000, but only data for population, households, and housing units will be shown in the pop-up windows for the operational layer.




By previewing our application inside of the ArcGIS Flex Viewer, we can determine that the process was successful since the pop-up window only displays data for the three specified fields.




In order to add more functionality and interactivity to the map application, widgets can be added. ArcGIS Flex Viewer provides us with a catalog of widgets, but it is also possible to edit and even create our own. In this example, we added the locator widget which pinpoints locations after the address has been typed in the search bar. We also configured the draw tool so that it can perform measuring operations when a line is drawn over a distance.






Widgets can also be added and customized by altering the configuration files of the ArcGIS Flex Application Builder. In this case, we are going to create an xml configuration file for a chart widget that will display census data in a bar graph. Using Notepad++, we can construct the following script for the widget.




The final step for adding the widget is to open the configuration files for the application and insert a code that will reference the new script for the widget. When executed correctly, the chart widget will appear in the map application and follow the rules that were written in the script. By using the draw tools to select census blocks, the tool will then calculate and compare the data for population, households, and housing units.




The last portion of this lab demonstrated how to create a widget from within the Flex Application Builder. As long as you have the proper configuration files and logo images compressed in a folder, the application builder makes it very simple to import data for constructing widgets. The configuration files can be found at the bottom of the widgets page and can be edited by selecting the pencil icon below each widget. Once the desired preferences are fine-tuned, the widget will become usable under the preview tab.

Sources




Thursday, October 3, 2013

GEOG.455 LAB 2 Geospatial Web Services


Goal and Background

The purpose of this lab is to introduce students to the process of creating and hosting geospatial web services via ArcGIS Online for Organizations and through ArcGIS servers. Students will be introduced to numerous methods and techniques in which geospatial services can be successfully published to the web.

Methods

The first section of this lab shows us how to publish a shapefile in ArcGIS.com. ArcGIS Online allows us to upload our own data and adjust the file type and other parameters before it is published. We can also add tags during this step, which will help users find this document if they are searching online for data.


Once the shapefile is published, it is easy to edit features and adjust nearly all aspects of the map. Altering the transparency of the basemap, varying the color scheme, and thickening state and county boundaries all help to create a cartographically pleasing map. The data that we published includes information for highways, interstates, cities and counties.



The next section of the lab focused on publishing a feature hosted service using a CSV file. This process was similar to the shapefile publishing process, except this time we are only starting with a Microsoft Excel document. The first step is to open the document in Excel and save it as a comma separated value file. Now when we add the CSV file using the Add Item prompt, we want to select “Locate features using Latitude/Longitude”. This will allow us to set the POINT_X data from the document to Longitude and the POINT_Y data from the document to Latitude.



We can now publish the CSV file to ArcGIS.com. This particular data displays fires in 2004 in the state of Wisconsin. The data has been added to the map from the previous step.



In the third section of the lab, we learned how to publish a feature hosted service using an ArcMap document.  By clicking on “Share As” -> “Service” on an ArcMap document, a wizard will appear and give us many options for how we would like to publish the service. After using the wizard to add item descriptions, tags, credits, and other information, you can use the Service Editor to analyze the service. Any errors will become visible and will require assistance before the service can be published.

The next section of the lab demonstrated how to publish a tiled map service using ArgGIS Server. This process is similar to the previous process but this time we start with a raster and we will publish the service to my personal SDE Database. The raster is opened in ArcMap and shared as a service like the previous step. After completing the wizard and selecting all of the desired preferences, the service is published to my personal SDE database.



The final section of the lab addresses land use identification. The map that was created from the step above displays the different types of land use in the Chippewa Valley. By examining the legend, we can evaluate the infrastructure of the city and discover patterns that weren’t visible before.





Sources