Closed MikeMillerGIS closed 7 years ago
This is a bit tricky since the files need to be relative to a folder. It's easy in the case where the files are in the same folder or sub-folder beneath a project, which will be the normal case. If that cannot be accessed when the tools are run on another project folder, the code will attempt to find the files/data relative to the Xml config file folder. If neither of those 2 cases work then an error will be raised.
for the Data Mapping part of it, can you do like what the map doc does when it can't find a layer, just make the textbox with a red outline exclamation mark and force the user to select the source and target.
Also need to handle the new file names in .NET for domain loading and anything else that relies on it.
When you make a new config, it defaults the project name to:
If I change the Project tag to read
Start Time: Friday, March 17, 2017 2:10:21 PM
Running script AppendData...
Data Assistant
Appending Data
Configuration file: C:\Solutions_UtilityNetwork\workfiles\DataAssistantFIles_EGDB\transformer_to_ElectricAssembly.xml
C:\Users\Win10\Documents\ArcGIS\Projects\MyProject\UtilityNetwork_AssetPackage.aprx does not exist, continuing
C:\Solutions_UtilityNetwork\SourceData\Electric\NapervilleElectric.gdb\E_Distribution\Transformer
C:\Solutions_UtilityNetwork\workfiles\PostgreSQL - db_naperville_electric.sde\db_naperville_electric.un.UN_Naperville_Electric\db_naperville_electric.un.ElectricAssembly
Data previously staged, will proceed using intermediate dataset
Appending TRANSFORMER_ELECTRICASSEMBLY TO ELECTRICASSEMBLY
Rows appended
1340 features in source dataset
1340 features in target dataset
Start Time: Friday, March 17, 2017 2:10:37 PM
Row Count = 1340
Succeeded at Friday, March 17, 2017 2:10:38 PM (Elapsed Time: 0.96 seconds)
Staging element removed from config file
Data Assistant - Append Data
Process completed with 1 errors
When any errors are encountered tools will report a general failure - even though the results may be still be satisfactory.
Check the Geoprocessing log and errors reported along with the output data to confirm.
Completed script AppendData...
Failed to execute (AppendData).
Failed at Friday, March 17, 2017 2:10:38 PM (Elapsed Time: 17.17 seconds)
where it does not file my Proj project in the default c:/users/win10 folder. The loading still seems to work fine even though it says fail to execute. Perhaps just suppress that error.
After looking at this further, I will only use a relative path to the Xml file, and if source/target are in that folder or a subfolder of that then the tools will use the relative path. Otherwise they will always use the full path to the file on disk.
In many cases the xml file will be in a project folder, in that case and other cases this appears to be the desired behavior.
On Fri, Mar 17, 2017 at 5:33 PM, Previn Wong notifications@github.com wrote:
When you make a new config, it defaults the project name to: MyProject.aprx and it seems to be looking for that in this location: C:\Users\Win10\Documents\ArcGIS\Projects\MyProject even though my project is located here: C:\Solutions_UtilityNetwork\
If I change the Project tag to read UtilityNetwork_AssetPackage.aprx Then when I run the append data it throws this error
Start Time: Friday, March 17, 2017 2:10:21 PM Running script AppendData... Data Assistant Appending Data Configuration file: C:\Solutions_UtilityNetwork\workfiles\DataAssistantFIles_EGDB\transformer_to_ElectricAssembly.xml C:\Users\Win10\Documents\ArcGIS\Projects\MyProject\UtilityNetwork_AssetPackage.aprx does not exist, continuing C:\Solutions_UtilityNetwork\SourceData\Electric\NapervilleElectric.gdb\E_Distribution\Transformer C:\Solutions_UtilityNetwork\workfiles\PostgreSQL - db_naperville_electric.sde\db_naperville_electric.un.UN_Naperville_Electric\db_naperville_electric.un.ElectricAssembly Data previously staged, will proceed using intermediate dataset Appending TRANSFORMER_ELECTRICASSEMBLY TO ELECTRICASSEMBLY Rows appended 1340 features in source dataset 1340 features in target dataset Start Time: Friday, March 17, 2017 2:10:37 PM Row Count = 1340 Succeeded at Friday, March 17, 2017 2:10:38 PM (Elapsed Time: 0.96 seconds) Staging element removed from config file Data Assistant - Append Data Process completed with 1 errors When any errors are encountered tools will report a general failure - even though the results may be still be satisfactory. Check the Geoprocessing log and errors reported along with the output data to confirm. Completed script AppendData... Failed to execute (AppendData). Failed at Friday, March 17, 2017 2:10:38 PM (Elapsed Time: 17.17 seconds)
where it does not file my Proj project in the default c:/users/win10 folder. The loading still seems to work fine even though it says fail to execute. Perhaps just suppress that error.
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/Esri/data-assistant/issues/112#issuecomment-287476760, or mute the thread https://github.com/notifications/unsubscribe-auth/AEh3BOrp4d32sCe3CmFlQCgAxlELwaB4ks5rmvwcgaJpZM4L0N1h .
Verified.
verified:
looks good, closing
Can we expose an option to store relative path option in the source-target map so the layers are relative to the project so we can share a project with configurations with another machine