This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arcpy | |
import os | |
outdir = r'C:\TEMP' | |
out_folder_path = outdir | |
out_name = 'test_connection.ags' | |
server_url = 'http://localhost:6080/arcgis/admin' | |
username = 'admin' | |
password = 'admin' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<!--The viewport meta tag is used to improve the presentation and behavior of the samples | |
on iOS devices--> | |
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> | |
<title>Create Map and add a dynamic layer</title> | |
<link rel="stylesheet" href="http://js.arcgis.com/3.11/esri/css/esri.css"/> | |
<style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arcpy | |
mxd = arcpy.mapping.MapDocument("./Legend.mxd") | |
df = arcpy.mapping.ListDataFrames(mxd)[0] | |
#Setup Legend | |
legend = arcpy.mapping.ListLayoutElements(mxd, "LEGEND_ELEMENT")[0] | |
styleItems = arcpy.mapping.ListStyleItems("USER_STYLE", "Legend Items") | |
for styleItem in styleItems: | |
if styleItem.itemName == "PATCH_Single": |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
import json | |
content = urllib2.urlopen("http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/layers?f=pjson").read() | |
service = json.loads(content) | |
for layer in service['layers']: | |
print layer['name'], ":", layer['type'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arcpy | |
import time | |
import os | |
mxd = arcpy.mapping.MapDocument(r'C:\<path>\<to>\<map>.mxd') | |
dfs = arcpy.mapping.ListDataFrames(mxd) | |
file_gdb = r'C:\<path>\<to>\<file>.gdb' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code goes here | |
(function() { | |
var createWorker = function() { | |
var workCount = 0; | |
var task1 = function() { | |
workCount += 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<meta name="viewport" content="width=1024, user-scalable=no"> | |
<style> | |
html { height: 100% } | |
body { height: 100%; margin: 0; padding: 0;} | |
#map{ height: 100% } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import tortilla | |
class AGOL: | |
""" A class for administering an ArcGIS Online account""" | |
def __init__(self, in_username, in_password, expiration=60): | |
self.agol = tortilla.wrap('https://www.arcgis.com') | |
self.username = in_username | |
self.password = in_password |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import time | |
import json | |
import os | |
import tortilla | |
from requests.packages import urllib3 | |
import arcpy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from: http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-data-access/searchcursor-class.htm | |
import arcpy | |
fc = 'c:/data/base.gdb/well' | |
fields = ['WELL_ID', 'WELL_TYPE', 'SHAPE@XY'] | |
# For each row print the WELL_ID and WELL_TYPE fields, and the | |
# the feature's x,y coordinates | |
with arcpy.da.SearchCursor(fc, fields) as cursor: |