Assignment 3
Create your own geographic information and map it
Geographic information is the foundation of Web GIS. In this exercise, create your own simple datasets of geographic information following a standard data format and display them on a web map.
Contents
Data
Your datasets will consist of a CSV point layer and a GeoJSON polygon layer or line layer, though this tutorial uses polygons. Here are some ideas:
- Favorite restaurant locations (point layer) and parking areas (polygon layer)
- Boundaries of national/state/local parks you’ve visited or want to (polygon layer) and a point of interest in each (point layer)
- Trails or paths you’ve hiked/walked/run (line layer) and the starting point of each (point layer)
Elaborating on the restaurant example, you could choose four you like in a city you’ve visited and record each restaurant’s location and available parking. In this case, your layers would be a combination of:
- non-spatial data (restaurant name, description of the food and atmosphere)
- spatial data (latitude and longitude location, boundary of parking area)
You may use the restaurant example or choose your own topic. This tutorial uses four landmarks in Baton Rouge as an example, with placeholder text and images from Wikipedia.
We will use a spreadsheet to create the CSV point layer and Geojson.io to draw the polygon or line layer. We will then use ArcGIS Online to create a web service a Story Map.
Steps
After you decide on a topic and pick out your locations of interest, follow the steps below, substituting your own locations for the Baton Rouge examples.
Part 1: Prepare the CSV
Your first dataset will be in the simple comma-separated values (CSV) file format and will contain the names and descriptions of several places of interest along with their latitude and longitude coordinates (points).
To see a completed CSV for reference you can download this example CSV.
-
Open a blank spreadsheet (Excel, Google Sheets, etc.).
- Type an attribute name in each column on the first row, using the attribute names specified and described below:
name
- a short, descriptive title for the locationdescription
- a sentence or a few describing the locationicon_color
-R
,G
,B
, orP
lat
- the location’s latitude in decimal degrees (e.g., 30.12345)long
- longitude in decimal degrees (e.g., -90.12345)pic_url
- The web address of an image you want to represent the location.thumb_url
- The web address of a smaller preview image. Can be the same aspic_url
.
-
Choose at least four places to use for this exercise and research enough about them to fill in the name and description in the CSV.
-
Locate the places on Google Maps. Right-click the map at the location to get the coordinates. Click the coordinates to copy, then paste into the
lat
andlong
fields in the CSV. You will have to separate latitude (the first number) and longitude (the second) and delete the comma.
The latitude and longitude of a location can be copied from Google Maps by right-clicking the map. -
Find a picture of each location or upload your own photos online. You can host images in ArcGIS Online by clicking
Content
>Add Item
>From my computer
.
How to add an image to your ArcGIS Online content page. -
To get the URL to paste into your CSV, see the picture’s Item Details page shown after uploading. Click
Share
and chooseEveryone
, then at the bottom of the Item Details page, a public URL will appear that you can copy and paste in the CSVpic_url
field.
Share an item to get the public URL to the item. -
Optionally, you can also upload thumbnails—smaller, faster-loading preview versions of each image—and put their URLs in the
thumb_url
field. Otherwise, just use the same URL forpic_url
andthumb_url
. - After completing the spreadsheet, save it as a CSV.
- Excel:
File
>Save as
and for the file type selectCSV (Comma delimited)
. - Google Sheets:
File
>Download
>Comma-separated values
.
The completed spreadsheet might look something like this in Excel:
And in a text editor it would look like this:
- Excel:
That completes the point layer.
Part 2: Prepare the GeoJSON
In this part you will draw your own features on a map and save the layer as a GeoJSON file.
-
Go to geojson.io and pan and center the map on the place you chose for your dataset.
-
In the drawing tools, click the
Draw a polygon
,Draw a rectangle
, orDraw a polyline
tool. Draw shapes on the map to complement your point layer, e.g., park outlines. As you draw, the GeoJSON code will appear in the code pane to the right of the map. These instructions will assume you drew polygons. Save your work often in case the site crashes!
-
After drawing your features, you can edit the attributes by either clicking the features on the map or clicking the
Table
tab on the top menu.
-
Create a new column called “name” and on each row in the table, type/paste the names of each location from your CSV.
-
Go to
Save
>GeoJSON
and the file will download to your computer.
That completes the polygon layer.
Part 3: Create a web service
Next we will create a web service so that web mapping applications can access the GeoJSON layer we just created. However, unlike the Node.js assignment on CodeSandbox, we will not do any coding to create the web service. Instead, we will use the web interface of ArcGIS Online to automatically set up a web service when we upload our GeoJSON file.
(The CSV file will be added later)
-
Sign into ArcGIS Online using the details provided by your instructor.
- In ArcGIS Online, go to your Content page to upload your GeoJSON file. Click
New item
>Your device
and browse the files on your computer for the.geojson
file you saved in the previous section. -
For
How would you like to add this GeoJSON?
, choose the option tocreate a hosted feature layer
and clickNext
,Next
,Save
. This will create a web service. - After adding, you will be shown the Item Details page. Click the
Share
button and chooseEveryone
to make your layer public. Also scroll down the page to see your web service’s URL. This is the URL that applications can use to request data from your web service. Keep this tab open; soon you will come back to copy this URL.
You now have a web service that will give applications access to your polygon layer. The data is completely self-contained within ArcGIS Online, and any changes you make to the GeoJSON file on your computer will not affect the layer in ArcGIS Online.
Part 4: Create the App
- Go to https://storymaps-classic.arcgis.com/en/app-list/map-tour/ and click
Build a map tour
. - At the welcome page, click the gears icon for advanced options, then
Import Tour data from a CSV file
, then select the CSV file from your computer and clickImport
. - The app should now display your points on the map, the captions, and a photo for the first tour location. Optionally, you can click a map marker to change its color.
- Edit the title at the top from
Edit me!
to something appropriate for your tour, such asBaton Rouge Tour
. - Click the button in the top left to save the app. This will save a new
Web Mapping Application
item andWeb Map
item on your Content page using the title you just specified in the previous step. - Go to Content to see the new items.
Part 5: Edit the Map
-
In Content, click on the new
Web Map
item, then on the Item Details page clickOpen in Map Viewer Classic
. Your point layer from the CSV will already be in the map’s table of contents. -
Click
Add
>Add Layer from Web
and paste the URL for your polygon layer’s web service (the URL from Part 3 Step 4).
So far, the course lessons have stated many, many times that applications request data from web services through a URL. Well this is it! It’s happening! We are creating a map application and telling it the endpoint URL from which it can get data to display on the map.
There are other ways to add layers to maps in ArcGIS Online, but this explicit use of a URL demonstrates that the map is using a web service endpoint. -
Change the polygon layer symbols by clicking the
Change Style
icon, and in theChoose an attribute to show
dropdown, selectname
. ClickDone
. This gives the layer a unique color and shows each feature’s name in the legend. Optionally, you could choose your own styles, such as removing the fill color so that only your polygon outlines are visible. You can see your symbols in the contents pane.
-
Click the
More Options
button under the polygon layer and chooseCreate Labels
thenOK
.
The More Options icon (three blue dots) gives you access to more settings, including the option to turn on labels.This will display text on the map for each feature. The text comes from the layer’s attributes. In this example, choose the
name
attribute. -
If the layers need to be renamed to something more descriptive without underscores, click the
More Options
button again on each layer and chooseRename
. -
For both layers, click
More Options
once more and underSet Visibility Range
move the sliders to the far ends of the bar. This keeps your layer visible no matter how far in or out the map is zoomed.
For the Story Map Tour template to work in the next steps, the layers need to be visible at all scales. -
Choose a basemap that suits your operational layers. The basemap is supposed to provide a reference background for users. I used a plain gray basemap in the example. A downtown tour might go well with the detailed street basemap, while a map of state park campsites might be better complemented by the topographic basemap. Whatever you choose, make sure the operational layers are still clearly visible against the basemap.
-
Finally, zoom and pan the map to fit your features into the viewer. The view you see now will be the default for apps you create with this map.
-
Click the
Save
button.
Part 6: Metadata
-
Go to your Content page to see that you have new
Web Map
andWeb Mapping Application
items.
-
Click on the item for your
Web Mapping Application
to see its Item Details page. The URL of the Item Details page is what you will submit for the assignment.
Example of an Item Details page in ArcGIS Online: https://www.arcgis.com/home/item.html?id=cc2a69a4e6784a2baa203fec4fbc4f5c. - The green progress bar on the right side of the page indicates how many of the metadata fields you have completed. Complete these fields:
- Summary - a short sentence saying what your app shows and does
- Description - a more detailed explanation of the purpose of your app and the content of your layers
- Thumbnail - if you are not satisfied with the default thumbnail, you can upload a screenshot or other graphic
- Terms of Use - typically “None” in our case or a Creative Commons license such as CC BY-SA
- Credits (Attribution) - similarly, give credit for any images or layers used in your map
- At the bottom of the Description field, add the URL to your web service (the endpoints you added to the map). It should look like this, above the Terms of Use section:
https://services2.arcgis.com/ABC123/arcgis/rest/services/YourLayer1/FeatureServer
From this page you can click View Application
to launch the app, or click Configure App
to make further changes to the app.
Submit
- Copy the URL to the Item Details page of your Story Map. Make sure the description section has the URL to your web service at the bottom and your app is shared publicly. An Item Details page URL should look something like
https://www.arcgis.com/home/item.html?id=ABC123
orhttps://arcg.is/123ABC
.
- Open an incognito/private browser window and paste your Item Details page URL. Click
View Application
. - If you can view your app and Item Details page in the incognito window, then submit the Item Details page URL on Moodle.
If you cannot view your app and are instead prompted to sign in, or just get an access error, make sure every component of your web app is shared with “Everyone”, including both feature layers, the map, and the app. You can check and share them all at once on your Content page.
Top