Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Geographic Approach to Android Development

Geographic Approach to Android Development

The Geographic Approach provides a new way of thinking about problem solving by including geographic analysis into the process. Leveraging some of the Android Location framework classes and ArcGIS Android API's we can show how the Geographic Approach helps developers empower Android apps to make better decisions.

Dan O'Neill

October 17, 2014
Tweet

Other Decks in Technology

Transcript

  1. Agenda • GIS and the Geographic Approach • Geographic Analysis

    ▪ Location and Routing ▪ Measure • Maps App • Offline Patterns ◦ Basemaps ◦ Custom Tiles ◦ Geographic Spatial Analysis • ArcGIS Android Tools
  2. GIS and the Geographic Approach • Ask ◦ Spatial Data

    adds value - question location perspective • Acquire ◦ Service or local based ◦ Acquisition API’s • Examine ◦ How data is organized ◦ Does it correspond to rules of physical world (topology) • Analyze ◦ Geographic Analysis ◦ API Patterns • Act ◦ Publish web maps ◦ Consume in Android
  3. Geographic Analysis • Convert data into information • Add value

    ◦ Answer questions ◦ Points on a map • Analytic services • Hardware analytics
  4. Geographic Analysis - Location • ArcGIS Geocoding Service ◦ Global

    Coverage ◦ Geosearch ◦ Reverse Geocoding ◦ Batch Geocoding • ArcGIS Runtime Locators ◦ Locator package on device ◦ Offline Search and Routing
  5. Geographic Analysis - Routing • Routing developer pattern ◦ Create

    a RouteTask ◦ Set up Parameters ◦ Set Stops ◦ Calculate Route ◦ Get Results ◦ Display route ◦ Get Directions
  6. GA - Calculate Route RouteTask mRouteTask = new RouteTask.createLocalRouteTask(networkPath, networkName);

    RouteParameters params = mRouteTask.retrieveDefaultRouteTaskParameters(); params.setOutSpatialReference(mapRef); mStops.setSpatialReference(mapRef); // Set the stops and since we want driving directions, params.setStops(mStops); params.setReturnDirections(true); // Perform the solve RouteResult results = mRouteTask.solve(params);
  7. GA - Display Route // Grab the results Route result

    = results.getRoutes().get(0); // Add the route shape to the graphics layer mGraphicsLayer.addGraphic(new Graphic(geom, new SimpleLineSymbol(0x99990055, 5))); // add the route graphic layer to map mMapView.addLayer(mGraphicsLayer);
  8. Geographic Analysis - Measure • Self contained using CAB pattern

    • Easy to integrate • Customizable MeasureTool MapFragment strings.xml actions.xml
  9. GA - Customize Measure Units // initialize some resources for

    the measure tool: optional. Unit[] linearUnits = new Unit[] { Unit.create(LinearUnit.Code.CENTIMETER), Unit.create(LinearUnit.Code.METER), Unit.create(LinearUnit.Code.KILOMETER), Unit.create(LinearUnit.Code.INCH), Unit.create(LinearUnit.Code.FOOT), Unit.create(LinearUnit.Code.YARD), Unit.create(LinearUnit.Code.MILE_STATUTE) }; SimpleMarkerSymbol markerSymbol = new SimpleMarkerSymbol(Color.BLUE, 10,com.esri.core.symbol.SimpleMarkerSymbol.STYLE.DIAMOND); SimpleLineSymbol lineSymbol = new SimpleLineSymbol(Color.YELLOW, 3); SimpleFillSymbol fillSymbol = new SimpleFillSymbol(Color.argb(100,0, 225, 255)); fillSymbol.setOutline(new SimpleLineSymbol(Color.TRANSPARENT, 0));
  10. GA - Customize Measure Tool // create the tool: required.

    MeasuringTool measuringTool = new MeasuringTool(MapFragment.mMapView); // customize the tool: optional. measuringTool.setLinearUnits(linearUnits); measuringTool.setMarkerSymbol(markerSymbol); measuringTool.setLineSymbol(lineSymbol); measuringTool.setFillSymbol(fillSymbol); // fire up the tool: required. startActionMode(measuringTool);
  11. Maps App • Map navigation centric app • ArcGIS Android

    SDK https://github.com/Esri/maps-app-android
  12. Offline Patterns • Take map offline ◦ Edit Features ◦

    Sync Features back to service • Perform Offline Analysis ◦ Routing & Geocoding ◦ Line of Sight - Viewshed • Create your own layer ◦ Define layer and symbology ◦ Persist to device
  13. Offline Sync Pattern • API to support large number of

    users • Use map extent to limit features/tiles to take offline
  14. Offline Patterns - Custom Tiles • Base Abstract Class -

    TiledServiceLayer ◦ Implemented by ▪ ArcGISTiledMapServiceLayer ▪ BingMapsLayer ▪ OpenStreetMapLayer • Fetch Tiles ◦ Implement abstract getTile() method
  15. Geographic Spatial Analysis • Line of Sight ◦ A line

    from an observer’s view to a distant point • ViewShed ◦ Area visible from a specific location
  16. Geographic Spatial Analysis • Viewshed Developer Pattern ◦ Create a

    ViewShed from a raster image file ◦ Set an observer point location ◦ Calculate the ViewShed ▪ results in a raster image ◦ Create a RasterLayer from resulting Viewshed ◦ Add RasterLayer to a Map
  17. GSA - Calculate ViewShed ViewShed viewShed = new ViewShed(raster); viewshed.setObserver(mapPoint);

    FunctionRasterSource functionRS = viewshed.getOutputFunctionRasterSource(); RasterLayer viewShedLayer = new RasterLayer(functionRS); mMapView.addLayer(viewShedLayer);
  18. ArcGIS Android Tools • ArcGIS Android SDK ◦ https://developers.arcgis.com/android/ ▪

    Eclipse plugin • https://developers.arcgis.com/android/eclipse/updatesite/ • EAP ◦ ArcGIS Android API Lib Module ▪ https://github.com/Esri/arcgis-android-api-lib-module ◦ ArcGIS Android Gradle Samples ▪ https://github.com/Esri/arcgis-android-sdk-gradle-samples
  19. Agenda • GIS and the Geographic Approach • Geographic Analysis

    ▪ Location and Routing ▪ Measure • Maps App • Offline Patterns ◦ Basemaps ◦ Custom Tiles ◦ Geographic Spatial Analysis • ArcGIS Android Tools