POST
|
Thanks Joshua! I forgot to mention that I had tried registering, but ran into errors when doing so. I just ran through the process again and I think my issue was that the shape field was set to be "not null". I set the shape field to be nullable and was able to register the table. Now that the table is registered the associated feature layer works fine in a dashboard. I wasn't sure if I needed to register the table, but it looks like that was the key. The steps I took were: Used SQL Server Management Studio to add and populate a geometry field in the table based on lat/long Used the Register with Geodatabase tool to register the table with the geodatabase, allowing the tool to create an ObjectID and using the geometry field for the shape Added spatial index Is that about right?
... View more
06-18-2020
06:41 PM
|
0
|
4
|
2902
|
POST
|
I have a point feature class with over a million records in an enterprise geodatabase (using Microsoft SQL Server). I have a Portal feature layer running off this data. When I need to update the data, I use ArcGIS Pro to delete the feature class and recreate it (either all at once or in chunks using append). When I'm in the office this takes about 3 hours to complete. Now working remotely, updating this feature class takes around 16 hours. Working with tables is quick in SQL Server Management Studio, so I'm wondering if I can update the table and create the geometry there rather than in ArcGIS Pro / ArcMap / ArcCatalog. I've seen some documentation that suggests this may be possible... Rules for creating spatial tables to be used with ArcGIS—Help | Documentation SQL Server spatial types and ArcGIS—Manage geodatabases in SQL Server | Documentation Register a table or view with the geodatabase—Geodatabases | Documentation I've had some success, but haven't quite gotten what I want. Using lat/long, I added geometry to a table in SSMS (and added an ObjectID and a spatial index) and was able to visualize the data in the associated feature layer in the Portal, but when I tried to filter the layer in a dashboard I got an error: "Geodatabase error: DBMS does NOT support this function". Is it possible to update a feature class in an enterprise geodatabase by creating the geometry in SSMS, rather than using ArcGIS desktop software? If so, what's the correct workflow?
... View more
06-16-2020
11:43 AM
|
0
|
6
|
3009
|
POST
|
The Explode tool might be what you're looking for: Separating a multipart feature (Explode)—Help | ArcGIS Desktop Explode a multipart feature—ArcGIS Pro | ArcGIS Desktop
... View more
07-01-2019
10:48 AM
|
2
|
1
|
917
|
POST
|
I've run into this issue before as well. It seems like changing the field names using the Make Feature Layer "field_info" parameter doesn't work. My solution was to use field mapping and the Feature Class to Feature Class tool instead. Here's an example that uses field mapping and the Feature Class to Feature Class tool to export and rename selected fields from one shapefile to another: dataset = r"C:\Users\username\Desktop\scratch\test_rename.shp"
out_path = r"C:\Users\username\Desktop\scratch"
out_name = "renamed"
# Define the field names (keys) and their replacements (values)
# Fields not included here will not be included in the exported dataset
rename_dict = {"GRIDCODE":"BATHYMETRY", "GRIDCODE_1":"WIND", "GRIDCODE_2":"WAVE"}
# Create a list from the keys in 'rename_dict'
rename_fields = list(rename_dict.keys())
# Create a FieldMappings object
fmappings = arcpy.FieldMappings()
# Populate FieldMap objects with the desired fields, then populate the
# FieldMappings object with FieldMap objects
for name in rename_fields:
fm = arcpy.FieldMap()
fm.addInputField(dataset, name)
fmappings.addFieldMap(fm)
# Store the list of FieldMap objects that make up the FieldMappings object
fmaps = fmappings.fieldMappings
# Get the length of the 'fmaps' list
fmaps_count = len(fmaps)
# Iterate through the FieldMap objects. Get the Field object returned from the
# outputField property, modify the object's name and aliasName properties, replace
# the existing outputField property, and replace the field map at the current index.
for i in range(fmaps_count):
out_field = fmaps[i].outputField
out_field.name = rename_dict[fmaps[i].getInputFieldName(0)]
out_field.aliasName = rename_dict[fmaps[i].getInputFieldName(0)]
fmaps[i].outputField = out_field
fmappings.replaceFieldMap(i, fmaps[i])
# Export the input dataset to a new dataset, using 'fmappings' to define the field
# map for the new dataset
arcpy.FeatureClassToFeatureClass_conversion(dataset, out_path, out_name, "", fmappings, "")
... View more
06-28-2019
04:48 PM
|
2
|
1
|
987
|
POST
|
I had this same question and got it to work using the getattr() function. if ms.enabled:
name_field = ms.pageNameField.name
for pageNum in range(1, ms.pageCount + 1):
ms.currentPageNumber = pageNum
pageName = getattr(ms.pageRow, name_field)
... View more
06-24-2019
05:24 PM
|
4
|
1
|
2520
|
POST
|
The entire layout should be exported if you uncheck "Clip to Graphics Extent" on the Export Layout dialog box.
... View more
06-17-2019
11:00 AM
|
0
|
0
|
1557
|
POST
|
One option might be to merge the two datasets, then use the Points To Line tool with a shared field as the "Line Field" parameter. This would generate lines between the points with the same value in the selected Line Field. You could then either use the Shape_Length field, or calculate the length of the line using another length unit.
... View more
06-14-2019
10:46 AM
|
0
|
0
|
405
|
POST
|
Are the aliases associated with the layer or the data source? Fields view: Current Layer drop-down menu Edit field aliases on the data source I just tested this and found that the modified field aliases were only printed if I changed the data source aliases. I think ListFields accesses the selected layer's source dataset, so changes to the layer's aliases aren't reflected in the result returned by the function.
... View more
04-17-2019
12:32 PM
|
1
|
0
|
2847
|
POST
|
It looks like your CSV should work as it is, but if you need to add and calculate new fields you can use the Table to Table tool to convert the CSV to a geodatabase table or dBASE table. These formats will allow you to add and calculate fields.
... View more
04-16-2019
04:12 PM
|
0
|
0
|
2590
|
POST
|
I think the only default basemaps that have a totally separate labels layer are "Terrain with Labels" and "Oceans". As you note, "World Light Gray Canvas Base" has some labels. There is a very similar layer that might provide what you're looking for, however. It's named "Light Gray Canvas Base" and it's available in the Living Atlas.
... View more
04-11-2019
04:03 PM
|
1
|
1
|
6591
|
POST
|
Maybe you could create a separate list of users by checking to see if they belong to the target group. Example: source_users = source.users.search('!esri_ & !admin')
group_name = "My Group"
users_subset = []
for user in source_users:
if len(user.groups) > 0:
for group in user.groups:
if group.title == group_name:
users_subset.append(user)
print(user.username + "\t:\t" + str(user.role))
... View more
04-11-2019
02:09 PM
|
2
|
1
|
2302
|
POST
|
You can check for nulls using the string-length function or by checking a value against an empty string. If you nest some "if" statements, the calculation will return once a condition is met. if(string-length(${NEOFormPHONENUMBER}) != 0, ${NEOFormPHONENUMBER}, if(string-length(${NEOFormMOBILENUMBER}) != 0, ${NEOFormMOBILENUMBER}, if(string-length(${NEOFormBUSINESSNUMBER}) != 0, ${NEOFormBUSINESSNUMBER}, if(string-length(${NEOFormEMERGENCYNUMBER}) != 0, ${NEOFormEMERGENCYNUMBER}, "NONE")))) if(${NEOFormPHONENUMBER} != "", ${NEOFormPHONENUMBER}, if(${NEOFormMOBILENUMBER} != "", ${NEOFormMOBILENUMBER}, if(${NEOFormBUSINESSNUMBER} != "", ${NEOFormBUSINESSNUMBER}, if(${NEOFormEMERGENCYNUMBER} != "", ${NEOFormEMERGENCYNUMBER}, "NONE")))) Documentation: Formulas—Survey123 for ArcGIS
... View more
04-08-2019
05:05 PM
|
4
|
0
|
1546
|
POST
|
Maybe you could use regular expressions to replace substrings based on the character index of the first number in the ###.### sequence. Get the index of that character, then use string slices to replace all text between the third character (assuming all the rows start with "NAP") and that index. Example in ArcGIS Pro using Python: def replace_substr(s, rte):
import re
# Set pattern to replace beginning section. Optional
# L or R and a space, then 3 numbers, a period, three
# numbers, a space, 1 or 2 letters, and a space.
ptn = re.compile("([LR] )?[0-9]{3}.[0-9]{3} [A-Z]{1,2} ")
# Match the pattern in the string
match = re.finditer(ptn, s)
# Get the first match
m = next(match)
# Get the index where the match started
idx = m.start()
# Create new string by concatenating string slices and route
new_str = s[:3] + rte + s[idx:]
# Set pattern to replace the 'DH ##.###' section
ptn = re.compile("DH [0-9]{2}.[0-9]{3}")
# Replace the 'DH ##.###' section with nothing
new_str = re.sub(" +", " ", re.sub(ptn, "", new_str))
return new_str
... View more
04-08-2019
02:14 PM
|
1
|
1
|
1050
|
POST
|
Looking at that attachment, regular expressions might be useful. If you're looking to get rid of all text matching the pattern "DH ##.###", for example: What I know of Python has been self-taught, but I did have a baseline established from studying other programming languages. I took a handful of programming classes in college, then started tinkering with Python when I was studying GIS. I've been able to continue tinkering in my job, using it to automate processes and try to solve problems.
... View more
04-04-2019
05:02 PM
|
0
|
1
|
2149
|
POST
|
Dictionaries are collections of key:value pairs, for example: d = {"NAP NAP R": "NAP-029-R", "DH 00.334": ""} Using this dictionary, d["NAP NAP R"] would give you the value "NAP-029-R", and d["00.334"] would give you an empty string. Using a dictionary you could loop through the rows and do replaces based on dictionary values. Using the field calculator in ArcGIS Pro, for example: Expression: mod = mod_substr(!orig!) Code Block: import re
def mod_substr(orig):
d = {"NAP NAP R": "NAP-029-R",
"DH 00.334": "",
"NAP NAP 0": "NAP-121-0",
"NAP YNTV 0": "NAP-121-0",
"NAP R 006": "NAP-121-R 006"}
tmp_str = orig
# Replace substrings if they exist as a key in the dictionary
for key in d.keys():
if key in tmp_str:
tmp_str = tmp_str.replace(key, d[key])
# Remove duplicate spaces
tmp_str = re.sub(' +', ' ', tmp_str)
return tmp_str May not be feasible though, since you'd have to define each substring and its replacement.
... View more
04-04-2019
11:29 AM
|
1
|
3
|
2149
|
Title | Kudos | Posted |
---|---|---|
1 | 11-02-2018 05:55 PM | |
1 | 10-30-2018 01:58 PM | |
1 | 01-07-2019 11:49 AM | |
1 | 01-07-2019 12:27 PM | |
1 | 03-25-2019 01:33 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|