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
<!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 | |
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
''' | |
==Inputs== (starting at line 95) | |
server --> AGS machine name - (string) | |
port --> AGS port - (string) | |
adminUser --> administrator or publisher user - (string) | |
adminPass --> administrator or publisher password - (string) | |
service --> name of service starting with folder (if applicable) <name>.<type> notation - (string) | |
full_service_path --> path to the .ags connection file and the service folder and <name>.<type> notation - (string) | |
scales --> semicolon delimited list of scale values - (string) |
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 arcpy import da | |
import os | |
inTable = r'Database Connections\[email protected]\GISDB.SDE.Canada__ATTACH' | |
fileLocation = r"C:\Users\AMarinelli\Downloads\blob" | |
with da.SearchCursor(inTable,['DATA','ATT_NAME']) as cursor: | |
for row in cursor: | |
binaryRep = row[0] |
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
require(["dojo/request/xhr"], function(xhr){ | |
var category | |
feat = //code to get selected feature element | |
fcName = feat.attributes.Name; | |
fcType = feat.attributes.Type | |
//The following if statement does not cover all feature cases | |
//such as Ruins and Towns... | |
if (fcType == "City") { | |
category = "GoTCities" | |
} else if (fcType == "Castle") { |
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 | |
in_raster = r"C:\gisworkspace\CASES\_DEVELOPMENT\156950\47_072.tif'" | |
out_folder = r"C:\gisworkspace\CASES\_DEVELOPMENT\156950" | |
desc = arcpy.Describe(in_raster) | |
for band in desc.children: | |
indiv_band = os.path.join(in_raster, band.name) |
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 | |
streets = [] | |
# | |
#Search cursor code here to get list of streets | |
# | |
arcpy.MakeFeatureLayer_management("<file path>","roads_lyr") | |
arcpy.MakeFeatureLayer_management("<file path>","points_lyr") |
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 | |
point = arcpy.Point(592326.779, 6241287.454) | |
ref = arcpy.SpatialReference(26708) #SRID | |
ptGeometry = arcpy.PointGeometry(point, ref) | |
conn = r'Database Connections\[email protected]' | |
layer = "polygon" |
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
# Recording Daily Commute History | |
# West Queen West <----> North York | |
# Approx Route: Gardiner eastbound - D.V.P. northboutd - Eglinton Ave. E. | |
# Google Distance Matrix API | |
# https://developers.google.com/maps/documentation/distancematrix/ | |
'''The departure time may be specified by Google Maps API for Business customers | |
for to specify the departure_time to receive trip duration considering current | |
traffic conditions. The departure_time must be set to within a few minutes of the current time.''' |