Sample app demonstrating offline synchronization of geospatial data, spatial editing and mapping with Cloudant
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.bluemix
public
.cfignore
.gitignore
LICENSE.txt
README.md
admin.js
app.js
fieldwork-app-graphics.png
manifest.yml
mapconfig.json
package.json
testdata.js

README.md

Field Work

Field Work is a web application that supports offline editing and mapping of geospatial data. This app:

  • downloads and saves geospatial data locally for offline use by Cloudant Geo or Lucene Geo query
  • has a UI that supports editing of points, lines, and polygons
  • syncs locally-edited data back to an IBM Cloudant database

Many field-based industries whose personnel are disconnected from communications networks—often in remote areas or even underground—can benefit from this kind of offline-first mobile application. This demonstration is designed for utilities repair personnel who need to capture events in work orders.

Bluemix Deployments

Related Resources

Try it

Play with the live demo version of this app. To get started:

  1. Drag the map to an area you want to see.
  2. Click the Load Data button.
  3. On the upper right of the map, choose the data types you want to see.
  4. In the left pane, click the Edit Pins button. Pushpins appear on the map.
  5. On the left side of the map, use the controls that appear to edit and add pins. (Hover over a control for guidance.)

fieldwork demo

Architecture

field work architecture

This an architectural overview of the components that make this app run.

Deploy to IBM Bluemix

The fastest way to deploy this application to Bluemix is to click this Deploy to Bluemix button. If you prefer instead to deploy manually to Bluemix then skip ahead to the Manual Development section.

Deploy to Bluemix

Don't have a Bluemix account? If you haven't already, you'll be prompted to sign up for a Bluemix account when you click the button. Sign up, verify your email address, then return here and click the the Deploy to Bluemix button again. Your new credentials let you deploy to the platform and also to code online with Bluemix and Git. If you have questions about working in Bluemix, find answers in the Bluemix Docs.

(Optional) Customize the app URL

Bluemix creates a random, unique URL for your app, each time you deploy. If you want to customize and set a static URL, you can do so in the IBM Bluemix DevOps Services project created for you when you deployed.

  1. On the Bluemix Deployment Successful screen, click the Edit Code button.
  2. Find and open the manifest.yml file.
  3. Change the line random-route: true to host: my-unique-app-name

On the next deployment, the URL for your app will be my-unique-app-name.mybluemix.net

If you plan to modify the code for this app, and want to use GitHub's code repository (instead of IBM Bluemix DevOps Services), follow the instructions in the next section.

Manual Development

  1. Fork the repo Click the Fork button in the top right corner of this repository

  2. Create a Bluemix Account

    Sign up for Bluemix, or use an existing account.

  3. Download and install the Cloud-foundry CLI tool.

  4. Clone the app to your local environment from your terminal using the following command

git clone https://github.com/ibm-cds-labs/fieldwork
  1. cd into your newly created directory.

  2. Edit the manifest.yml file and change the <application-host> to something unique.

---
declared-services: 
  cloudant-fieldwork-db:
    label: cloudantNoSQLDB
    plan: Shared
applications:
  - name: fieldwork
    host: fieldwork-gr8one
    memory: 128M
    disk_quota: 512M
    path: .
    domain: mybluemix.net
    instances: 1
    services:
    - cloudant-fieldwork-db

The host you use determines your application url initially, e.g. <application-host>.mybluemix.net.

  1. Connect to Bluemix in your command-line tool and follow the prompts to log in.
$ cf api https://api.ng.bluemix.net
$ cf login
  1. Create the Cloudant service in Bluemix.
$ cf create-service cloudantNoSQLDB Shared cloudant-fieldwork-db

Manual deployment

To deploy to Bluemix, simply:

$ cf push

Privacy notice

The Field Work sample web application includes code to track deployments to Bluemix and other Cloud Foundry platforms. The following information is sent to a Deployment Tracker service on each deployment:

  • Application Name (application_name)
  • Space ID (space_id)
  • Application Version (application_version)
  • Application URIs (application_uris)

This data is collected from the VCAP_APPLICATION environment variable in IBM Bluemix and other Cloud Foundry platforms. This data is used by IBM to track metrics around deployments of sample applications to IBM Bluemix. Only deployments of sample applications that include code to ping the Deployment Tracker service will be tracked.

Disabling Deployment Tracking

You can disable deployment tracking by removing ./admin.js track && from the install line of the scripts sections within package.json.

License

Licensed under the Apache License, Version 2.0.

Field Work is a sample application created for the purpose of demonstrating an offline geographic data sync and editing application. The program is provided as-is with no warranties of any kind, express or implied.