POST
|
Hello, I am using AGOL's new Notebook feature, and while trying to install the client library psycopg (PostgreSQL + Python | Psycopg ) via !conda install psycopg the Python Kernal starts to act up, and will disconnect. I can open a sample notebook and save it into my session and the sample loads just fine. On load however, the session freezes each time using my notebook user account. I have created a video that illustrates this behaviour. Is psycopg supported on this platform?? Is it possible to reinitialize the notebook environment?? Can I overwrite the default notebook with one that works?? Youtube Video Link: AGOL Notebook Failure 2019-10-24 - YouTube
... View more
10-24-2019
03:05 PM
|
0
|
2
|
592
|
POST
|
Hello, I'm trying to create a function that leverages the auto increment function which is provided as a field calculator example in ArcGIS Pro's Calculate Field Python examples. The auto increment function is pretty straight-forward however, I'm looking to increment based on the attributes of another field. I've attached an example of the desired output. Below I've provided a snippet of the code where I've attempted to create a function that does what I've described but it doesn't seem to be working and I'm probably missing some important information about how field calculator works with tables. In the autoincrement function, you set the initial value to 0. But in an attempt to keep my function generic, I want to set the initial value to whatever is passed in when the function is called, then keep comparing. new = ''
def autoIncrementbyAttr(attribute):
global new
exist = attribute
if (exist == new):
return autoIncrement()
else:
new = attribute
rec=0
rec=0
def autoIncrement():
global rec
pStart = 1 #adjust start value, if req'd
pInterval = 1 #adjust interval value, if req'd
if (rec == 0):
rec = pStart
else:
rec = rec + pInterval
return rec
... View more
05-31-2018
03:24 PM
|
0
|
4
|
4463
|
IDEA
|
When ArcGIS.com displays metadata with multiple keywords, users viewing the metadata see a simple, non-repeated list of the keywords only when using FGDC CSDGM Metadata. Switching to any of the other metadata styles results in all keywords being repeatedly displayed. For instance, if there are five keywords entered for a resource and the metadata style is changed from FGDC CSDGM to any other style, the metadata is displayed with all five keywords on five different keyword lines. I am not suggesting that all metadata styles be displayed the same, each style comes with its own groupings, display order, and information gathered. My idea is to ensure that ArcGIS.com handles the translation of metadata from one style to another consistently and does not result in unnecessary replication of information if an organization changes the metadata style they want to use.
... View more
03-23-2018
11:04 AM
|
2
|
0
|
364
|
IDEA
|
ESRI allows the entry of very detailed metadata for the resources provided through ArcGIS.com but clicking on the metadata button returns only a subset of the metadata, regardless of the metadata style. ESRI, rightfully so, promotes the use of metadata to explain what a resource means, where it came from, how it was processed, etcetera yet leaves most information out when displaying the metadata. A specific example is the Resource Constraints section of the ArcGIS.com metadata editor. It offers tabs for general, legal, and security constraints, yet ArcGIS.com only displays general constraints when displaying metadata. We have a number of resources with both general and legal constraints and users only see the general constraints and not the constraint related to our legal liability for the use of the resource. True, one could just place all constraints in the general section (we have a couple resources with more than one general constraint and both appear in displayed metadata, but then why offer different constraint categories? There are other sections that also fail to display when a user views the metadata online, I just chose one as an example. My suggestion is to update ArcGIS.com so that the full metadata is displayed when a user clicks the metadata button, regardless of metadata style chosen. ESRI recognizes the importance of metadata and we take the time to fill it out as completely as we can, should not the viewer be able to see all the information that was provided?
... View more
03-23-2018
10:47 AM
|
5
|
0
|
349
|
POST
|
Hey Micah, Thanks so much for your reply! I took a look at your example but ended up going another way. For the most part, the two input feature classes that I wanted to merge had the same field names. It occurred to me that by leveraging the fieldmappings and fieldmap object, I could avoid associating each field from each input feature class with the destination field since identical fields would just be merged without my intervention (at least that seems like how it works...) Here's what I did: 1) Created an empty FieldMappings object 2) Added tables from both input feature classes to the empty FieldMappings object 3) Created arrays of fields to be mapped from both input feature classes, careful to ensure that the index of the input field name was the same index as the input field name which it would be mapped to 4) Created a fieldmap dictionary object 5) Iterated over the objects keys/values, found the field map in the field mappings object via field name added my input field updated field mappings object removed field map of input field was mapped 6) Created a temp table to store feature class reference 7) Merged feature classes w/ updated field mapping Let me know what you think! Script below: #This script should be run within the ArcGIS Pro Python window
import arcpy
outfc = r"TPA_Eligible_Transit_Stops_2017_test3"
# Merge the following two feature classes together - map fields with the same content to single field
# Each of the FC below were added to the project from MTC Organization ArcGIS Online
railfc = r"TPA_Non_Bus_Eligible_Stops_2017"
busfc = r"High_Frequency_Bus_Stops"
# Create a new fieldmappings object and add the two input feature classes
fieldmappings = arcpy.FieldMappings()
fieldmappings.addTable(railfc)
fieldmappings.addTable(busfc)
#Get fieldmap for two fields in rail dataset which bus values will be merged into
# - Create array of bus fields which are to be mapped (input fields)
# - Create array of rail fields which bus fields will be mapped to (destination fields)
# - Create dict using zip methold - ensure order of fields matches map - to order within array
busfields = ["stop_id","lgcl_adjacent_hf_routes"]
railfields = ["agency_stop_id","Distance_Eligible"]
fieldmapdict = dict(zip(busfields,railfields))
# - iterate over dictonary
# - find field map for each rail field (destination field)
# - add input field to fieldmap object (input field)
# - replace field map (destination field map) within fieldmappings object with updated field
# - remove bus field map from fieldmappings object (input field)
for busfield, railfield in fieldmapdict.items():
fieldmap = fieldmappings.getFieldMap(fieldmappings.findFieldMapIndex(railfield))
fieldmap.addInputField(busfc, busfield)
fieldmappings.replaceFieldMap(fieldmappings.findFieldMapIndex(railfield), fieldmap)
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex(busfield))
#create temp value table and store fc paths as rows
vTab = arcpy.ValueTable()
vTab.addRow(railfc)
vTab.addRow(busfc)
#merge
arcpy.Merge_management(vTab, outfc, fieldmappings)
... View more
08-14-2017
03:06 PM
|
1
|
1
|
1043
|
POST
|
I'm working to develop a python script which merges two feature classes into one. I found the following arcpy example quite helpful, however it's only provides an example of how you might approach the problem of mapping input fields with different names and logically similar content for 1 input field from the 2 feature classes. My issue is that I have many fields from both input datasets which contain logically similar content. Example from ArcPy docs: import arcpy
outfc = "C:/data/CityData.gdb/AllBlocks"
# Want to merge these two feature classes together. Have a field
# that has the same content but the names are slightly different:
# Blocks1 has TRACT2000 and Blocks2 TRACTCODE. Name the output
# the same as Blocks1.
#
fc1 = "C:/data/CityData.gdb/Blocks1"
fc2 = "C:/data/CityData.gdb/Blocks2"
# Create a new fieldmappings and add the two input feature classes.
#
fieldmappings = arcpy.FieldMappings()
fieldmappings.addTable(fc1)
fieldmappings.addTable(fc2)
# First get the TRACT2000 fieldmap. Then add the TRACTCODE field
# from Blocks2 as an input field. Then replace the fieldmap within
# the fieldmappings object.
fieldmap = fieldmappings.getFieldMap(fieldmappings.findFieldMapIndex("TRACT2000"))
fieldmap.addInputField(fc2, "TRACTCODE")
fieldmappings.replaceFieldMap(fieldmappings.findFieldMapIndex("TRACT2000"), fieldmap)
# Remove the TRACTCODE fieldmap.
#
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("TRACTCODE"))
# Create a value table that will hold the inputs for Merge.
#
vTab = arcpy.ValueTable()
vTab.addRow(fc1)
vTab.addRow(fc2)
# Run the Merge tool.
#
arcpy.Merge_management(vTab, outfc, fieldmappings) Does my question make sense?
... View more
08-11-2017
05:03 PM
|
0
|
4
|
2879
|
POST
|
I encountered this issue as well in ArcGIS 10.3.1 While the Help documentation for Facilities Classes and Fields does not explicitly say only the point geometry type can be loaded, the Load Locations UI still allows selection of non-point geometry types. Furthermore, there is a check box underneath that restricts the drop down to only point layers, which implies that non-point geometries are valid locations. Both the documentation and UI should explicitly express application logic. The error message says "the input features must have the correct geometry type". The documentation should state the "correct geometry type".
... View more
03-16-2016
11:02 AM
|
0
|
0
|
232
|
Title | Kudos | Posted |
---|---|---|
1 | 08-14-2017 03:06 PM | |
5 | 03-23-2018 10:47 AM | |
2 | 03-23-2018 11:04 AM |
Online Status |
Offline
|
Date Last Visited |
06-15-2022
10:27 AM
|