POST
|
Beautiful progressive city. Awesome GIS team. Supportive, fun coworkers! The City of Bellingham has a regionally recognized local government GIS known for innovative work and collaborative projects. As an employer, the City offers generous benefits, work/life balance, health insurance and retirement programs. We are looking to fill an additional position located within the IT department. This position will support City-wide applications and be responsible for the maintenance and upkeep of ArcGIS Enterprise, as well as working to move us forward in the ESRI universe! GIS is integrated widely into our various department business processes. We develop with Python, VertiGIS/Geocortex, and Portal maps and apps. We are looking for a creative, positive individual with a team player attitude to join our team! View the full announcement and apply here: https://www.governmentjobs.com/jobs/4085344-0/senior-gis-analyst
... View more
06-30-2023
12:01 PM
|
0
|
0
|
569
|
POST
|
We have many scripts that use PyODBC. Once we upgraded beyond ArcGIS Pro 2.6, these have stopped working. When I try to import PyODBC into a script, it fails. When I roll back to 2.6, everything works fine again. To clarify: we are not using these scripts in ArcGIS Pro. We are running them as stand alone from scheduled tasks. The install process for versions after ArcGIS Pro 2.6 seems to be breaking PyODBC specifically. We have tried versions 2.7 and 2.8 with the same results. The scripts are unable to find the PyODBC module. It seems an install path has changed? To restate above, once we downgrade to 2.6, changing nothing else, all works fine again. We do not use cloned environments, in fact, PYODBC is not installed with ArcGIS Pro. I'm specifically saying that in a stand alone script, outside ArcGIS Pro, PYODBC stops working when we upgrade. Goes back to working when we downgrade. Does anyone know what changed and how to repair so PyODBC works again?
... View more
09-08-2021
03:10 PM
|
0
|
2
|
641
|
POST
|
Thank you for posting your solution to this! Saved me time and bruises on my forehead from banging it on my desk.
... View more
05-04-2021
03:37 PM
|
0
|
0
|
1213
|
POST
|
Here's another way with python from arcgis.gis import GIS
gis = GIS("https://<your portal URL>/portal", "<your username>","<your password>")
oneUser = gis.users.search("<username>")
for i in oneUser:
print(i.groups)
# or you can get multiple users# myUsers = gis.users.search("*")# then list the groups for those users# for i in myUsers :# print(i.username, " ", i.groups)
# see https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#user
# for other things you can print out for each user
# see https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#usermanager
# for ways to search and sort users
... View more
02-11-2020
04:06 PM
|
0
|
1
|
1276
|
POST
|
Using the ArcGIS API for Python: from arcgis.gis import GIS
# replace the your URL, your username and your password with the relevant
# information for your organization
# you must use an admin account to generate users
gis = GIS("https://<your URL> /portal", "<your username>","<your password>")
users = gis.users.search("*")
for i in users:
print(i.username, " " , i.email)
# see https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#user
# for other things you can print out for each user
# see https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#usermanager
# for ways to search and sort users
... View more
02-11-2020
03:40 PM
|
1
|
0
|
1684
|
POST
|
I jsut worked through Esri support for your "a push is not a function" issue. In my case, the problem came from publishing a form publicly but hosting the data on our ArcServer internall, even though it was publicly accessible. It is a bug in the software. Right now there is no work around. You must use ArcGIS online hosted data to have a publicly accessible form. The bugs: BUG-000108008 - A survey created in Survey123 Connect for ArcGIS using an existing ArcGIS Server secured feature service gives an error, "a.push is not a function" when data is collected using a web form. " http://support.esri.com/en/bugs/nimbus/QlVHLTAwMDEwODAwOA== " That bug is marked as a duplicate of the following bug: BUG-000103232 - Data submitted using the Survey123 for ArcGIS web client is not stored for surveys created using the submission URL for non-federated feature services. " http://support.esri.com/en/bugs/nimbus/QlVHLTAwMDEwMzIzMg== "
... View more
01-03-2018
02:30 PM
|
2
|
1
|
334
|
POST
|
Hi I am publishing this example script even though the question is marked answered because as a novice python programmer I needed the full complete picture to help me understand what is happening. It's true that the issue above is that the group layer file cannot be treated as the individual layer files. The answers above addressed that issue - I just had a hard time understanding how to handle it differently. In this script, the group layer file is identified and then the layers inside it are handled as a new layer object. This is the script I used to process a directory of folders and layer files numbering over 700 when we switched SDE servers. The script fails on some things (it doesn't like representations, and a few other odd ducks) but it processed well over 90% just fine, and that was good enough for us. The remaining will be dealt with individually. This script also incorporates logging which reports actions to the screen and to a log file, so that you have a record of what was processed and what failed. I then wrote another script which read the log file and pull out into a summary page what failed. That is optional obviously. I do not take credit for coming up with this myself. I found another post at gis.stackexchange.com that got me quite far by Tim Barnes, also located here: replaceDataSource for layers within a group layer The zip file attached contains the logging config file referenced in the script below. "Logging" is a standard python module. #!/usr/bin/env python
#********************************************************************************************************************
# Name: FixLayerFileSourcePaths.py
# Created: 3/10/2016
# Version: ArcGIS 10.4
# Author: Ann Stark, City of Bellingham
# Modifications:
# Dependencies: logging config file
# Description: Reads a directory and all sub directories, replacing the source data path for layer files.
# In the example below an SDE connection was being moved from one server to another server.
# Richmond
# Called by:
# Arguments: None
#*********************************************************************************************************************
# to use this script
# 1. copy this script and the logging config file to a location
# 2. modify the logging file config path to point to your config file.
# 3. modify the "sourceString" and "replacementString" variables to be the old and new paths you want to replace.
# 4. modify the "folder" variable to be the highest level folder that you want to search for .lyr files. This script runs through the folder listed and all folders within it.
#*********************************************************************************************************************
import time
tic = time.clock()
import os, sys, string, logging
import arcpy
import arcpy.mapping
from arcpy import env
import logging
import logging.config
# Where is the logging config file.
logging.config.fileConfig(r"N:\scripts\arcgis\speedsongPathFixes\logging\logging.conf", disable_existing_loggers=False) #modify this path to point to your config file.
logging.info('--> STARTED Script')
# Folder- the folder where you want to search for the layer files
folder = r"N:\LayerFiles_Speedsong\water utilities" #directory to search for lyr files
logging.info('PROCESSING {}'.format(folder))
#folder = arcpy.GetParameterAsText(0)
sourceString = r"Richmond_" #oldpath
replacementString = r"Speedsong_" #newpath
logging.info("Replacing {} with {}".format(sourceString, replacementString))
for path, dirs, files in os.walk(folder): #walk through all sub folders
logging.info(" Now processing {}".format(path))
arcpy.env.workspace = path
try:
for layerFile in arcpy.ListFiles("*.lyr"):
try:
# find the actual layer files in the folder
lyr = arcpy.mapping.Layer(path + "\\" + layerFile)
# make layer object from layer file
for lyrObj in arcpy.mapping.ListLayers(lyr):
try:
# a layer file may have multiple layers within it so work through those...
if lyr.isGroupLayer:
#logging.info(layerFile + " is a group layer.")
#arcpy.AddMessage(layerFile + " is a group layer.")
#arcpy.AddMessage(lyrObj.longName +":"+ lyrObj.name)
if lyrObj.name.find('Build') >= 0:
pass #this skips our buildings representation
elif lyrObj.longName !=str(lyr.name):
# just update the layers within the group layer
#arcpy.AddMessage(layerFile + " contains a layer object named: " + lyrObj.name)
logging.info(layerFile + " contains a layer object named: " + lyrObj.name)
newWS = lyrObj.workspacePath.replace(sourceString, replacementString)
newSource =lyrObj.dataSource.replace(sourceString, replacementString)
if arcpy.Exists(newSource):
#arcpy.AddMessage("Updating " + lyrObj.name + " with replacement GDB.")
#lyrObj.replaceDataSource(newWS, "FILEGDB_WORKSPACE")
lyrObj.findAndReplaceWorkspacePath(sourceString, replacementString, True)
lyr.save()
logging.info(" Updated " + lyrObj.name)
else:
logging.info(newSource + " DOES NOT exist. Will not update this layer.")
elif lyr.isGroupLayer == 0:
newWS = lyr.workspacePath.replace(sourceString, replacementString)
newSource = lyr.dataSource.replace(sourceString, replacementString)
if arcpy.Exists(newSource):
logging.info("Updating {} with replacement source path.".format(lyr.name))
#lyr.replaceDataSource (newWS, "FILEGDB_WORKSPACE") #use this when changing source types (shp to fgdb for example.)
lyrObj.findAndReplaceWorkspacePath(sourceString, replacementString, True)
lyr.save()
else:
logging.info(newSource + " DOES NOT exist. Will not update this layer.")
except Exception as e:
logging.error(str(e))
except Exception as e:
logging.error(str(e))
except Exception as e:
import traceback
map(arcpy.AddError, traceback.format_exc().split("\n"))
arcpy.AddError(str(e))
logging.error(str(e))
del arcpy, os, sys, lyr
logging.info("--> FINISHED script")
toc = time.clock()
ElapsedTime = round((toc - tic)/60, 2)
logging.info(" ElapsedTime is {0} minutes\n\n".format(ElapsedTime))
# uncomment the last two lines if you want to open the log file automatically after the script runs.
# change the path to your log file.
#import webbrowser
#webbrowser.open(r"c:\your\path\to\the\SpeedsongPathFix.log")
... View more
03-10-2016
02:43 PM
|
2
|
1
|
318
|
POST
|
Just wanted to chime in that we are having the same issue with MakeTableView not working in 10.3.1 environments but the same exact script running just fine in 10.2 environment (we store the scripts on a network drive so it is the same script in each instance that is run). We tried adding the OBJECTID to the table (in this case a SQL View), based on comments in this post, but that did not solve the problem for us. Our python statement looks like this arcpy.MakeTableView_management(UTILITY_BILLING_CUSTOMERS, Utility_Billing_Customers_View, "", "", "OBJECTID OBJECTID VISIBLE NONE;...<many fields here>") in case that's of interest to anyone. No WHERE clause is used. It sounds like a bug and hopefully will be addressed in 10.4.
... View more
02-17-2016
04:10 PM
|
1
|
0
|
613
|
POST
|
I am having the same issue. Is this a new bug that a previously working script now fails?
... View more
01-11-2016
02:35 PM
|
0
|
0
|
961
|
Title | Kudos | Posted |
---|---|---|
1 | 02-17-2016 04:10 PM | |
1 | 02-11-2020 03:40 PM | |
2 | 03-10-2016 02:43 PM | |
2 | 01-03-2018 02:30 PM |
Online Status |
Offline
|
Date Last Visited |
12-06-2023
06:24 PM
|