A Time-aware Geo Data Bucket

A CSV spreadsheet file can become the basic building block of a Feature Service, capable of holding existing or inbound data.  Follow the steps below to create a simple time-enabled GIS feature service bucket for tracking the weather data you provide to it from users or sensors.

1. Log into your ArcGIS Online publisher account.

2. Upload the sample CSV (wx_start.csv):

  • Click “Content”.
  • Click button, “Add Item”. Select “From My Computer”.
  • Select the sample CSV and fill out metadata.
  • Click “Publish this file as a hosted layer”.
  • Select “Coordinates”.
  • Make sure the date field name shows date field type.
  • Make sure lat and long field names show latitude and longitude field types
  • Set the service to output to your local time zone. (In a later blog post, you will see the python script is set to send UTC time data to the feature class – which is converted to your local on map display).

3. View the feature service Overview page.

  • Find the “Layers” section. Click “Time Settings”.
  • In the pop-up window, click the checkbox, “Enable Time”. Select the first option, “Specific events in time”. Set pull down to “date”.

4. From the feature service Overview page, click “Open in Map Viewer”.

  • In the Change Style panel, make sure button 1 (Attribute to show) is set to “tempF”. Press Done.
  • Save your new map.
  • Hover over the new feature class layer name. Click the “View Options” button (ellipses). Select “Refresh Interval”. Enable the refresh and set to 1 minute (or whatever number makes sense to you).
  • Hover over the new feature class layer name. Click the “Cluster features” button. Enable or disable clustering to your preference. We recommend turning it off, initially.
  • Optional: You may also want to modify the transparency of the symbology, available under the “View Options” (ellipses) button. Select “Transparency”. Optionally, set to 50% initially.
  • Save your map edits.
  • Note: If new data are not showing on the map, click the layer’s “Show Table” button.If all the data is showing in the table, close it.  Then click the layer’s “Show Options” (ellipses) button and select “Disable Time Animation”. You can normally turn time animation back on and the data will appear.

ArcGIS on a Pi: Happy Pi Day!

This post describes how to install the ArcGIS API for Python on a Raspberry Pi 3 B+.
Document version: March 14, 2019. Version 1.1 – Tom Baker RPi-Logo

To learn more about the Raspberry Pi, visit http://raspberrypi.org.

Start with a clean installation of the Raspberry Pi’s Raspbian OS for best results.

Installations

  1. Install Berryconda

    Berryconda for Raspberry Pi is the conda environment for Pi. The installer includes Python 3.6.1 at the time of this writing and meets the minimum Python 3.5 requirement of the ArcGIS API for Python 1.6.0.

    1. Download the bash script (.sh file) for Berryconda3-2.0.0-Linux-armv71.sh from the bottom of the page: https://github.com/jjhelmus/berryconda
    2. With the file on your Pi, right-click and select Properties. Set permissions to “Only Owner” to execute. Press OK.
    3. Open a Terminal window in the current folder and run the bash script. Start the command with a period and paste the filename. Like (ignore indentation icon):
      • ./Berryconda3-2.0.0-Linux-armv71.sh
    4. Click through the Terminal prompts to install. Use default settings.
  2. Install Jupyter Notebook

    1. At a Terminal prompt, type:
      • conda install Jupyter
  3. Install the ArcGIS API for Python

    1. Check your python version. Use the Terminal window and type:
      • python –version
    2. Download the arcgis package from the anaconda repository for 32-bit Linux that matches your version of Python (e.g. 3.6). The file name should look something like: linux-32/arcgis-1.6.0-py36h39e3cac_1.tar.bz2
    3. Download from https://anaconda.org/Esri/arcgis/files
    4. Note: In our tests, the arcgis file cannot be directly downloaded using conda from any repository.The conda tool fails to find the required “linux-armv71” channel for arcgis.  However, downloading the file and installing from a local path negates the conda installer looking for the arm-specific version of arcgis.
    5. Right-click the package and select “Copy Full Path”.
    6. From a Terminal window, install the package like:
      • conda install /fullpath/arcgis-1.6.0-py36h39e3cac_1.tar.bz2
  4. Test the installation

    1. At a Terminal window, type:
      • jupyter-notebook
    2. When the notebook loads in a browser, create a new Python3 document.
    3. In the document’s first cell, enter the four-line test script below that will draw a map.
      • from arcgis.gis import GIS
      • gis=GIS()
      • map1 = gis.map(“Palm Springs, CA”)
      • map1

 

Raspberry Pi Models Tested

To date, we have used the following Pi models with the ArcGIS API for Python and Jupiter Notebooks. Brief comments follow.

Raspberry Pi 3 B+ – Quad-Core BROADCOM 64bit ARMv8 1.2 GHz 1 GB RAM

  • Demo installation above was conducted on this model.  Maps draw responsively with a slight lag on the first request.

Raspberry Pi Zero W v1.1-

  • It took about 5 minutes to run the four line script above.

Spatial Citizenship Education

I’m delighted to share a chapter with Curtis and Millsaps in this new book from Shin and Bednarz! sce_book

Spatial Citizenship Education: Citizenship through Geography (Shin and Bednarz, 2019) is the inaugural book exploring the contribution of geographic education (and geographic technologies and spatial thinking) to the development of the citizen.  It describes citizenship development through a rich understanding of spatial and geographic narratives. The book includes a history of geographic education as well as theoretical and conceptual elements of the work of geography education. Geography teachers, teacher educators, and GIS education researchers should consider this volume as a critical contribution to their well-rounded library.

 

Chapters include:

  • Conceptualizing spatial citizenship
  • Geography as a social study
  • Geography, capabilities, and the educated person
  • The spatial production and navigation of vulnerable citizens
  • Citizenship education in a spatially enabled world
  • Rediscovering the local
  • Cultivating student citizens
  • Geotechnologies and the spatial citizen
  • Informed citizenry starts in the preschool and elementary grades – and with geography
  • Spatial citizenship in the secondary geography curriculum
  • Spatial citizenship in the geography/social studies teacher education

 

Amazon link to the book.

 

 

GeoInquiries Map and Data Search

The experimental GeoInquiry search tool allows an instructional designer or advanced GeoInquiry user to search GeoInquiry maps and data for keywords (and optionally add that data to their own map).  The tool includes all Esri produced geoinquiries but also state GeoInquiries content.

For example, a search for “climate” will search the metadata (including title and description) of about 150 maps and nearly 1,000 data services while ignoring all non-GeoInquiry content in ArcGIS Online.

The database behind the tool is updated twice monthly to reflect the latest changes in map and data service metadata. Explore the tool at http://edgis.org/geoinquirysearch

screen+shot+2019-01-22+at+9.01.01+am

Harvesting ArcGIS Online Data and Maps Metadata

This short article describes a process where Python was used to harvest metadata from a list of identified ArcGIS Online maps and the maps’ data services. The data were logged to MySQL (with pymysql); a PHP web search and discovery page was created.  The process allows for keyword searching in titles and descriptions of maps and data layers.

Why harvest metadata?

This approach was used as our collection of 150 maps is housed in several AGO organizations with data services spread across even more.  These data and maps are designed for student use and vetted, making school curriculum authors interested in search and discovery of “good” data.  Essentially, we have a target population that is keenly interested in a subset of scattered data and maps.

Who might use this approach?

This article may be of interest to developers needing to create a search solution across a specific list of maps and constituent data services.

The Approach

Using the ArcGIS Python API 1.5.2 and a prebuilt list of mapIds, a script was built that iterates over the list, logging titles and descriptions for the maps.

with open('data/maps.csv') as f:
reader = csv.reader(f)
for map in reader:
result = gis.content.get(map[0])
web_map_obj = WebMap(result)
web_map_obj
web_map_obj.layers

Using the layers attribute now available for the map object, we then loop over all the layers in the map (above), also logging titles and descriptions.

We then log the data to a MySQL table (with a custom function), like:

dbwriter(
  objectType='Webmap',
  mapId=result.itemid,
  objectName=result.title,
  url='http://www.maps.arcgis.com/home/webmap/viewer.html?webmap=' + result.itemid,
  description=ssnippet
  )

Then loop over each layer and log to the table, slightly changing parameters as necessary.

You can access the script at GitHub below. The Python code, a sample CSV input file, and a sample SQL script for generating the MySQL table are included.

github  https://github.com/trbaker/mapHarvest