POST
|
I failed to mention that this problem manifests only in ArcPro. When running in ArcMap, the cited code works. There is no question that this is a bug in ArcPro.
... View more
04-05-2019
05:12 AM
|
0
|
0
|
548
|
POST
|
Are the ArcPro SDK extensions available in an archive? I am in an airgap environment where I have no access to the internet.
... View more
04-04-2019
06:23 PM
|
0
|
0
|
201
|
POST
|
Thanks Dylan, I am printing debug statements out during the decompression. The path 'slashes' appear to be correct. I will try and use os.path.abspath etc again. V/R
... View more
04-04-2019
06:09 PM
|
0
|
0
|
548
|
POST
|
I continue to have problems writing an ArcPro ArcToolBox tool script that takes as input 'multiple' files to be geoprocessed. To get right to the point, here is a code snippet: def main(): gzipFiles = arcpy.GetParameterAsText(0) myGzipFiles = gzipFiles.split(';') for myGzipFileThatReallyExists in myGzipFiles: gz = gzip.open(myGzipFileThatReallyExists, 'r') <-------FileNotFoundError..blah...blah... gzContent = gz.read() doMyGeoProcessing(gzContent) gz.close() The script fails in the above "gzip.open" statement with: FileNotFoundError: [Errno 2] No such file or directory: "'C:\\MyFileReallyDoesExistHere.csv.gz'". Note, I realize that there might be an issue with formatting the path to the gzip file in the loop (gzipFile), but I have exhausted trying everything with string.format, pathlib, os.path, etc. Note 2, the code works when I deselect the File input parameter "Multiple values" and adjust the code to: def main(): gzipFile = arcpy.GetParameterAsText(0) gz = gzip.open(gzipFile, 'r') <------- WORKS !?!?!?!? gzContent = gz.read() doMyGeoProcessing(gzContent) gz.close() This problem is very similar to problems I encountered decompressing KMZ files IN A FOR LOOP using: zipfile..ZipFile(kmzFileThatReallyDoesExistVariable, 'r') <---------FileNotFounError...blah....blah Any suggestion is greatly appreciated. This shouldn't be this hard to do!!!! V/R
... View more
04-03-2019
10:48 AM
|
0
|
3
|
622
|
POST
|
I need to able to read multiple KMZs to read each doc.kml for ExtendedData/Data to populate the KMLToLayer Feature class's Attribute Table. I have wired up a 'File' control in my ArcToolbox and have it configured for multiple input. When I make the call zipfile.ZipFile(kmzFile, 'r') below: kmzInput = arcpy.GetParameterAsText(0) kmzFiles = kmzInput.split(';') for kmzFile in kmzFiles: <-----kmzFile is of type 'str' tempOut=tempfile.mkdtemp() zf=zipfile.ZipFile(kmzFile, 'r') <------ crashes here I get the an error: self.fp = io.open(file, filemode) OSError: [ Errno 22] Invalid argument: " 'C:\\work\\ArcpyTestData\foo.kmz' " Note, the path to the KMZ DOES EXIST. I am running ArcPro 2.0.1. Any help is much appreciated Thanks V/R
... View more
02-25-2019
09:19 AM
|
0
|
0
|
139
|
POST
|
I am reading in ExtendedData/Data from a KML to add additional data fields/data to a FeatureClass using ArcPRO 2.0.1. I am using a hashmap to store the key-value Data/value pairs. To set the data, I am making calls with arcpy.CalculateField_management. When I grab the data, I am prepending and appending double quotes " (ie. hashData = '"' + hashKMLData[hashKey] + "'" and thus making the call: arcpy.CalculateField_management(myfeature, hashKey, hashData) Some of the data are just numbers and ARE stored correctly. However, Strings/String mixed with numbers and List data (enclosed in '[ ]' brackets) are problematic. Only the first character is getting set in the corresponding fields. I have tried to coerce the data types based on the field types (ie. str(hashData)). I have even tried setting all fields to "Text" but still have troubles with string data (ie. "I say foo a lot" gets stored as "I" in our SDE). It's as though setting these values is truncated to the first character. I'm at a loss - any help is much appreciated. Thanks
... View more
02-21-2019
01:30 PM
|
0
|
1
|
229
|
Online Status |
Offline
|
Date Last Visited |
09-20-2021
10:28 PM
|