POST
|
Why though would the same image with same extent loaded into a new project print seamlessly? Is it the inclusion of the legend items and that conversion process that creates the issue? I don't see the blocks in a new map with same extent and imagery.
... View more
06-09-2021
11:25 AM
|
0
|
2
|
1752
|
POST
|
Please see Image. For some reason Sentinel 2 - Views basemaps are exporting blocky to PDFs. What I've tried in terms of debugging: 1. Opened same Image Service in new project and exported 2. Turned off all other layers and exported 3. Deleted and replaced Image Service in original project and exported In case 1, with Sentinel 2 View loaded and exported as new layout in new project --> no problem Cases 2 and 3 where operating in current project --> problem So it's NOT with the imagery itself. Something with the Map. Ideas?...
... View more
06-09-2021
11:07 AM
|
0
|
7
|
1759
|
POST
|
Interesting. I started up with my company a year ago and our licenses are sprawled out everywhere - I'm sure half are checked out but not used or barely used. Something I want to clean up. I'm branching off topic here, so I'll save a Question your response piqued for a later post - preview: floating licenses between occasional users. That would be nice...Thanks Josh!
... View more
06-04-2021
07:16 AM
|
0
|
0
|
2653
|
POST
|
Thanks Josh (googling location of Kendal County out of curiousity...guessing WI...Close! - Illinois! Or San Antonio-ish!). Pro is MUCH nicer than Desktop. I really like the Views and multiple map documents I can set up in a project. The Jupyter Notebook functionality is a huge timesaver and important tool to teach others Python and share functionality and develop scripts. So Dynamic Tabs are highlighted - Check. Already stumbling through the new layout. It's weird how I can edit layers withOUT being prompted to consider starting an edit session. I imagine there is some way to lock editing by default. The ONLY hesitancy I have with Pro is how it appears reliant on internet access - at least to check licenses. I imagine I can set it up to work offline - haven't tried...
... View more
06-04-2021
07:05 AM
|
1
|
2
|
2230
|
POST
|
Hey Dan. Now that you mention it - perhaps unnecessary? Using Calculate Field and just a habit when I actually make a selection (not ALL).
... View more
06-03-2021
07:15 AM
|
0
|
1
|
2676
|
POST
|
Thanks Josh. I honestly am not that familiar with the differences between ribbons, sections, tabs, etc. Needless to say I don't have or am unable to locate Table or Data. I've just recently switched to Pro. WAY more productive so far, particularly toggling between layouts and maps and developing workflows in Notebooks. Adding your solution to my To Do List.
... View more
06-03-2021
07:13 AM
|
1
|
6
|
2252
|
POST
|
nice hack! My solution for the next 3 years until I finally get around to implementing @jcarlson more elegant solution...
... View more
06-03-2021
07:09 AM
|
1
|
0
|
2255
|
POST
|
Title says it all! In Desktop there was a select all option in drop down. Not seeing that in Pro? Seems peculiar...anybody have workarounds not involving sql queries? Thanks! Zach
... View more
06-02-2021
08:07 AM
|
0
|
17
|
4994
|
POST
|
Hi William. Thanks for the response. I'm slowly transitioning to Pro, and Dan indicated that ArcMap (as opposed to Pro and separate IDEs) is notorious for nefarious locks. Once I'm working on a less consequential dataset I will attempt the File Explorer --> delete lock file route, but for now that scares me. So I'll continue to open new map and reopen prior map without closing the program. That DOES work, just seems silly. Didn't realize the orphan ArcMap Processes situation - thanks for that tidbit! I'll keep my eyes out for that...
... View more
05-11-2021
01:24 PM
|
0
|
0
|
2577
|
POST
|
I was in a flow updating metadata for feature classes within a file geodatabase. In this process I renamed and moved multiple feature classes either within a gdb or from one gdb to another. Now I am updating the Item Description using ElementTree and Python, BUT for some reason multiple feature classes are missing every xml element except "ESRI". IN particular "dataIdInfo" is what I have updated successfully many, many times. I will attach some code to show my methodology, but the issue is that multiple feature classes have no metadata basically - "refSysInfo", "mdLang", mdChar" - literally every core metadata item is missing from the xml tree save for the "ESRI" Parent (??). 1) BAD XML 2) NORMAL XML (notice dataIdInfo and everything that follows) Here is an example of my workflow BUT it's not my problem - above screenshot is the issue - script just for context if interested. import xml.etree.ElementTree as ET
import arcpy
import copy
# 1) get xml from fcs
fp_fcs = 'path/to/gdb/feature_class'
temp_path = copy.copy(fp_fcs)
tgt_item_md = arcpy.metadata.Metadata(fp_fcs)
fp_xml = arcpy.CreateScratchName('.xml', workspace = arcpy.env.scratchFolder)
# copy xml of feature class -- next up - update it
tgt_item_md.saveAsXML(fp_xml, 'EXACT_COPY')
# 2) Update tree with new metadata
tree = ET.parse(fp_xml)
root = tree.getroot()
# Always in xml file - until today? This will return a NONE object
dataIdInfo = root.find('dataIdInfo')
# This will fail --> "None object does not have method find"
purp = dataIdInfo.find('idPurp')
# BUT when it's working I do this:
# update purpose subelement
el = ET.SubElement(dataIdInfo, 'idPurp)
el.text = 'my new purpose text block'
# write to scratch xml
ET.dump(dataIdInfo)
tree.write(fp_xml)
# 3) Apply updated xml to orig fcs and save
# Apply to fcs
# now that xml is updated, pull new xml
src_template_md = arcpy.metadata.Metadata(fp_xml)
# add updated xml to feature class xml
tgt_item_md.copy(src_template_md)
tgt_item_md.save() I'm hoping there is a tool/function that can update BAD to NORMAL xml - like an update gdb metadata. Help is ABUNDANTLY APPRECIATED! Thanks...
... View more
05-11-2021
11:54 AM
|
0
|
0
|
677
|
POST
|
If a tree in the falls in the forest and no one's around to hear it in practice: Well, I figured it out. Should have read the ArcPro docs more thoroughly because they have basically simplified (in my view) the syntax and process to copy metadata in the updating xml from gdb process (arcpro docs ). Instead of referencing an xslt file ('exact copy of.xslt') in the bowels of the ArcPro folder structure as an argument in the Desktop XSLTransformation_conversion function , they replaced it with an argument in the Pro version of the function called arcpy.saveAsXML in which you pass a string argument - in this case 'EXACT COPY' which performs the same purpose of `exact copy of.xslt'. 'EXACT COPY' most likely transforms your metadata using that same xslt without having to explicitly pass the file path. from arcpy import metadata as md
fp_fcs = 'path/to/fcs'
tgt_item_md = md.Metadata(fp_fcs)
xml_file = arcpy.CreateScratchName('.xml', workspace = arcpy.env.scratchFolder)
tgt_item_md.saveAsXML(xml_file, 'EXACT_COPY')
# From here - update the xml_file and then update the target: Update xml file using xml.etree.ElementTree protocol - examples all over the internet - in this case to update my Item Description 'idPurp' or 'idAbstract'
src_template_md = md.Metadata(xml_file)
tgt_item_md.copy(src_template_md)
tgt_item_md.save() Someday in four years somebody will stumble across this and hopefully not get dumber...
... View more
05-05-2021
12:14 PM
|
3
|
0
|
1194
|
POST
|
Hi everybody. Trying to "stamp" (term I made up - makes sense?) metadata in feature classes within file geodatabase utilizing arcpy functionality in Pro - looping through an entire gdb, so many fcs. I am cannibalizing pieces from this script: . esri forum metadata post. Note that I am NOT interested in the Thumbnail portion, just basic workflow to update Item Description via: 1) pull xml from feature classes within gdb 2) update a handful of xml elements (abstract, purpose, credits, etc.) in xml 3) update xml in gdb. I am utilizing xmltree and pandas dataframes in Python scripts for the workflow FYI. My dumbed-down pseudocode is as follows: fcs = 'path/to/feature_class'
# below line yields - 'C:\Program Files\ArcGIS\Pro'
dir = arcpy.GetInstallInfo('desktop')['InstallDir']
# but exact copy of.xslt is NOT here - can be found in desktop folder
copy_xslt = r'{0}'.format(os.path.join(dir,'Metadata\Stylesheets\gpTools\exact copy of.xslt'))
# temporary XML file
xml_file = arcpy.CreateScratchName('.xml',workspace=arcpy.env.scratchFolder)
xml_file = 'name.xml'
XSLTransform_conversion(fcs, copy_xslt, xml_file,'')
arcpy.MetadataImporter_conversion(xml_file, fcs) The main thing confusing me is that dir = arcpy.GetInstallInfo('desktop')['InstallDir'] YIELDS: C:\Program Files\ArcGIS\Pro\Resources\Metadata\Stylesheets but does NOT have the "exact copy of.xslt". If I go 'C:\Program Files (x86)\ArcGIS\Desktop10.6\Metadata\Stylesheets' then it exists. However the online documentation indicates that the Pro file ...Stylesheets subdirectory should have that file. Any idea why I don't have it and should I be concerned? I will basically just hardcode the file path the xslt file while running scripts via Pro.
... View more
05-05-2021
09:55 AM
|
0
|
1
|
1299
|
POST
|
Hi Pete. Glad it worked out. We can add those lines. First though, here is a quick demo hopefully illustrating a few of the tougher tricks and functionality in that original code. Run this using a Notebook in Pro. Just cut and paste this into a cell and hit the Run arrow - see what prints. player = ['Steve Nash','Steph Curry', 'Kawhi']
stat = ['Assists','Threes','FG pctg']
num = [11,500,60]
apex_statistics = []
# zip basically runs a for loop with multiple lists simultaneously
for player, stat, num in zip(player, stat, num):
# different formatting for fg pctg
if stat in ['FG pctg']:
num = '{}%'.format(num)
# note this syntax (.format)is for more current Python versions.
# Google / StackExchange from older posts will be similar but different
# each {} will be populated by locationally matched item in ()
str = '{} master of {}:\n{} per year!'.format(player, stat, num)
# add str to list one at a time each iteration of for loop
apex_statistics.append(str)
# creates single string from the 3 strings in the list apex_statistics
full_str = '\n\n'.join(apex_statistics)
print(full_str) So to get the width string formatted, replace existing lines in if statement block for width with those shown below. Note use either Option A or B (delete the other). if [WIDTH] not in (None, "<NULL>", "0"):
# option A basic
width_str = 'Width: {}'.format([WIDTH])
# option B - add units if you want too
width_str = 'Width: {} Feet'.format([WIDTH])
str_list.append(width_str) let me know if that works.
... View more
04-22-2021
07:30 AM
|
0
|
1
|
2624
|
POST
|
Hi Pete. I took a different approach with your desired outcome. Let me know if this displays what you wanted (it worked for me with NAME and ALT_NAME type = string, and WIDTH type = int (or single?): def FindLabel([NAME],[ALT_NAME],[WIDTH]):
# initiate empty list to append to if val == NULL
str_list = []
if [NAME] not in (None, "<NULL>", "0"):
str_list.append([NAME])
if [ALT_NAME] not in (None,"<NULL>", "0"):
str_list.append([ALT_NAME])
if [WIDTH] not in (None, "<NULL>", "0"):
str_list.append(str([WIDTH]))
# create one string from all non-NULL values with "\n" in between
label_str = '\n'.join(str_list)
return(label_str) My understanding is that you ONLY want to display labels for values that do NOT == 0, NULL, etc. If that's not the case, we can adjust logic. I honestly don't do fancy label action often, so thanks for showing me the "<NULL>" syntax. Just curious, the "0" in (None, "<NULL>", "0") is actually a string not the integer 0. If you want to hunt for the integer, then remove the "". If you want both string and int, just add a comma and 0 within the parenthesis constructing your tuple. Let me know if that worked for you...Zach
... View more
04-21-2021
03:00 PM
|
1
|
3
|
2655
|
POST
|
Running the code in the Python (aaaaahhh, about to butcher the terminology!) Console (Window?) directly in ArcMap. After this mxd project I'm moving to Pro. I think turning on and off is honestly my quickest solution. Other solutions I've found are more time-consuming than on/off. File Geotabase Compacting seems to be an option - which I really need to do anyways. Seems going into File Explorer and deleting locks within the gdb folder is more risk than it's worth. For shapefiles I don't care. Well, thanks Dan.
... View more
04-21-2021
09:55 AM
|
0
|
2
|
2683
|
Title | Kudos | Posted |
---|---|---|
1 | 3 weeks ago | |
1 | 02-16-2023 10:34 AM | |
1 | 03-04-2024 10:19 AM | |
1 | 02-21-2022 02:03 PM | |
1 | 09-14-2023 12:58 PM |
Online Status |
Offline
|
Date Last Visited |
Wednesday
|