Skip to content

Instantly share code, notes, and snippets.

View garysheppardjr's full-sized avatar

Gary Sheppard garysheppardjr

View GitHub Profile
@garysheppardjr
garysheppardjr / StreamServiceListener.cpp
Created February 14, 2020 19:29
Stream service sample for the ArcGIS Runtime SDK for Qt
#include "StreamServiceListener.h"
#include <QEventLoop>
#include <QException>
#include <QJsonArray>
#include <QJsonDocument>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include "Geometry.h"
@garysheppardjr
garysheppardjr / StreamServiceListener.java
Last active February 4, 2020 17:46
Stream service sample for the ArcGIS Runtime SDK for Java
package com.esri.samples.realtime;
import com.esri.arcgisruntime.geometry.Geometry;
import com.esri.arcgisruntime.mapping.view.Graphic;
import com.esri.arcgisruntime.symbology.Renderer;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URI;
import java.net.URISyntaxException;
@garysheppardjr
garysheppardjr / Launcher.java
Last active January 30, 2019 16:50
A launcher class for JavaFX applications using Java 11. This avoids "Error: JavaFX runtime components are missing, and are required to run this application." Simply replace DisplayMapSample with your Application class name, import it, and run this Launcher class instead of your Application class. Inspired by https://stackoverflow.com/a/52654791/…
package com.esri.samples;
import com.esri.samples.map.display_map.DisplayMapSample;
public class Launcher {
public static void main(String[] args) {
DisplayMapSample.main(args);
}
@garysheppardjr
garysheppardjr / pom.xml
Last active January 30, 2020 15:54
Minimal POM file for running ArcGIS Runtime Java samples with Java 11 and Maven
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.esri.arcgis.runtime</groupId>
<artifactId>arcgis-runtime-samples-java</artifactId>
<version>0.1.0</version>
<packaging>jar</packaging>
<properties>
@garysheppardjr
garysheppardjr / OfflineBatchGeocodeSample.java
Last active May 25, 2018 17:00
A Java program that performs "batch" geocoding using an offline locator file with ArcGIS Runtime
package com.esri.samples.search.offline_geocode;
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
import com.esri.arcgisruntime.concurrent.ListenableFuture;
import com.esri.arcgisruntime.tasks.geocode.GeocodeParameters;
import com.esri.arcgisruntime.tasks.geocode.GeocodeResult;
import com.esri.arcgisruntime.tasks.geocode.LocatorTask;
import java.io.File;
import java.util.List;
import java.util.concurrent.ExecutionException;
@garysheppardjr
garysheppardjr / MainWindow.xaml.cs
Created August 22, 2017 20:20
ArcGIS Runtime 100.1: Create, load, and display a MosaicDatasetRaster in .NET
using Esri.ArcGISRuntime.Geometry;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Rasters;
using System;
using System.Windows;
namespace MosaicDatasetViewer
{
/// <summary>
/// Interaction logic for MainWindow.xaml
@garysheppardjr
garysheppardjr / ViewController.swift
Last active November 4, 2016 12:29
This ArcGIS Runtime Quartz (Beta 1) for Mac OS X app adds the layers of a mobile map package (MMPK) to a 3D scene and then attempts to zoom to the MMPK's initial extent. Unfortunately, getting the MMPK's initial extent returns nil. Similar code in Java and Android works properly with ArcGIS Runtime Quartz Beta. (Note: I am new to Mac OS X develo…
import Cocoa
import ArcGIS
class ViewController: NSViewController {
private let ELEVATION_IMAGE_SERVICE = "http://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"
private let MMPK_PATH = NSBundle.mainBundle().pathForResource("DC_Crime_Data", ofType: "mmpk")
@IBOutlet weak var sceneView: AGSSceneView!
@garysheppardjr
garysheppardjr / MainWindow.xaml.cs
Created October 21, 2016 19:22
Simple username/password authentication with ArcGIS Runtime Quartz for .NET. Don't actually hard-code your usernames and passwords!
using Esri.ArcGISRuntime.Security;
using Esri.ArcGISRuntime.Tasks.NetworkAnalyst;
using System;
using System.Windows;
namespace RuntimeAuthDotNet
{
public partial class MainWindow : Window
{
private const string ROUTE_TASK_URL = "https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World";
@garysheppardjr
garysheppardjr / SceneViewIdentifyApp.java
Last active October 19, 2016 16:31
ArcGIS Runtime Quartz Beta 2: Selecting features in 3D (doesn't highlight features; scheduled to work in Quartz Final)
package sceneviewidentify;
import com.esri.arcgisruntime.concurrent.ListenableFuture;
import com.esri.arcgisruntime.datasource.QueryParameters;
import com.esri.arcgisruntime.datasource.arcgis.ServiceFeatureTable;
import com.esri.arcgisruntime.geometry.GeometryEngine;
import com.esri.arcgisruntime.geometry.Point;
import com.esri.arcgisruntime.geometry.PointBuilder;
import com.esri.arcgisruntime.geometry.Polygon;
import com.esri.arcgisruntime.geometry.SpatialReference;
@garysheppardjr
garysheppardjr / MapViewIdentifyApp.java
Last active October 5, 2016 18:34
ArcGIS Runtime Quartz Beta 2: Selecting features in 2D (works)
package sceneviewidentify;
import com.esri.arcgisruntime.datasource.QueryParameters;
import com.esri.arcgisruntime.datasource.arcgis.ServiceFeatureTable;
import com.esri.arcgisruntime.geometry.GeometryEngine;
import com.esri.arcgisruntime.geometry.Point;
import com.esri.arcgisruntime.geometry.Polygon;
import com.esri.arcgisruntime.geometry.SpatialReference;
import com.esri.arcgisruntime.layers.FeatureLayer;
import com.esri.arcgisruntime.mapping.ArcGISMap;