|
POST
|
Another update. There is a known bug that is affecting this: NIM089163 Using the Import Metadata tool to import metadata from a feature class or shapefile into a layer file (.lyr) does not update unless the current metadata of the layer file is edited first. This also seems to affect the MetadataImporter tool as well. Workaround is the manual edit of the metadata in ArcCatalog. I have scripted automated importing of metadata from the data source, which works once the metadata has been manually edited.
... View more
07-20-2015
11:38 AM
|
1
|
2
|
2155
|
|
POST
|
Thanks for the reply, and an interesting approach there. I haven't had a chance to test it, but there is an ESRI bug affecting the metadata at present.
... View more
07-20-2015
11:34 AM
|
0
|
0
|
2155
|
|
POST
|
Update: If I programatically export the layers metadata to XML, I get the xml file of the underlying data. Similarly, making a change to that XML file and importing it to the layer file will update the metadata of the underlying data instead.
... View more
07-07-2015
02:03 PM
|
1
|
5
|
2155
|
|
POST
|
I have also used lyr.longName, as this has a slash between the group name and the layer name. While this isn't a safe character for output, it is a handy way to separate the names sometimes. for example, I have a script which creates layer files from an mxd, and to identify if a layer is in a group (rather than being a group layer) I use the following and change the output name accordingly (as I am outputting all layers - stand alone, group layers and sub layers and there is a high likelihood of duplicate names): if lyr.longName.find("\\") > -1: # change the name out_lyr = lyr.longName.replace("\\","_") # or, functionally the same out_lyr = arcpy.validateTablename(lyr.longName) GroupLayer\Layer becomes GroupLayer_Layer. For generating unique output names I do an Exists() check, and increment a counter at the end of the name as necessary.
... View more
06-29-2015
10:45 AM
|
1
|
0
|
807
|
|
POST
|
arcpy.ValidateTableName does a good job of removing problematic characters as well. ArcGIS Help 10.1
... View more
06-26-2015
05:00 PM
|
1
|
0
|
808
|
|
POST
|
I have a script which creates a layer file for every layer in an MXD, and I would like to copy the metadata (especially description and tags) from the source into the layer file. However it seems that importing metadata into a layer file using arcpy fails and nothing is visible in ArcCatalog. Even attempting to import it in ArcCatalog seems to fail, along with the metadata importing tools (Import Metadata and Metadata Importer) in the toolbox. However, if I export the layer file metadata to an XML file, I can clearly see under <dataIdInfo><idPurp> and <idAbs> etc the text that I want. For some reason this is not visible in ArcCatalog though. I can get it to update if I edit the metadata first in Catalog (putting some text in the summary for example and saving it), and then use the Metadata Importer. This doesn't seem feasible in code, as the only way to modify the metadata is to export it, modify it and import it again, and that last step fails! Anybody successfully managed this? ArcCatalog 10.3, Win 7
... View more
06-26-2015
10:16 AM
|
0
|
6
|
5729
|
|
POST
|
OK, after some time spent debugging this with the ESRI support team I can update this. The following works (may not be the only way to do it) arcpy.SetParameterAsText(1, resultMsg) does output the string message that I want to return, however, I was also raising an error via arcpy.AddError in the script (to log to Server logs) and that seemed to interfere with the result passed. If an error is raised then the message is hidden from view (only the "Unable to complete operation" text is shown in the output area in the Web App). Steps to fix: Remove AddError from script. Put the script tool in a model and set the output parameter to a model parameter. Republish GP service, set to synchronous. Update widget in Web App (add URL again). Confirm result string is now available in output area in widget. The result parameter is now available when the task is run. In the Web App json the GP service now has outputParams filled in: "outputParams": [ { "name": "ResultString", "dataType": "GPString", "description": "", "defaultValue": null, "category": "", "label": "ResultString", "visible": true, "required": false, "tooltip": "ResultString" } ], "shareResults": true, "layerOrder": [ "Operational Layers" ]
... View more
04-29-2015
12:57 PM
|
3
|
0
|
763
|
|
POST
|
I have a geoprocessing service accessed through a Web App Builder App that appends a parcel to a dataset. I have tried arcpy.AddMessage, print and returning a message through arcpy.SetParameterAsText() but I cannot get it to report that it is finished, or failed. It is currently asynchronous, and I think that may be why it doesn't return anything, but if I set it to synchronous on the server it fails (SubmitJob error). Using the ArcGIS Online Assistant I can view the JSON for the web app and I see a setting "isSynchronous": false however setting this to true doesn't fix it as it still tries to SubmitJob (rather than ExecuteTask?). How can I set up a synchronous service for use in a web app built with the Web App Builder? And how can I return messages to the Web App?
... View more
04-28-2015
09:49 PM
|
0
|
1
|
4969
|
|
POST
|
Web adapter advantages that seem relevant to you: Web Tier Authentication Block admin access to external users Hide port and site name Load balancing Will you or IT be doing the support and setup of the web adaptor and authentication? Do they prefer IIS? Because you should choose the one (IIS or Java) that the people doing the support and management are more comfortable with. As I use Windows servers I would choose IIS, for ease of management and setup (and probably easier to integrate with Active Directory), but more importantly because that is what will be easier to for me to manage and support. And I haven't seen any downsides to running the web adapter yet.
... View more
12-04-2014
09:09 AM
|
1
|
4
|
2666
|
|
POST
|
Hi, Is there an existing, working Draw tool for the 3.2 version of the ArcGIS Silverlight builder, targeting Silverlight 5? I have tried downloading the draw tool from here but can't seem to get it to work. I set the references to SIlverlight 5 and added back all the broken ones and the build succeeds, but when I go to upload the xap file from testAddin\Bin\Release I get "Object reference not set to instance of an object". Not even sure where to start looking, and it seems that this is a common tool as it appears in the samples, however I am not at a point where I could build this myself. And on that track, what tutorials would people suggest to learn to build SIlverlight Add-Ins for ArcGIS Silverlight Builder use?
... View more
11-25-2014
03:15 PM
|
1
|
0
|
3519
|
|
POST
|
Basically, if you have Query enabled you can always extract the data. The query results are returned to the requestor, so at that point there is nothing you can do to prevent them from getting access to them. If you don't want editing, turn off the Feature Service. You could also try creating a separate editing feature service for the data, and securing that. If you control the GeoCortex app you should be able to disable the Export To Shapefile functionality in your application.
... View more
11-13-2014
12:58 PM
|
1
|
1
|
1488
|
|
POST
|
Using the 2.0 Beta of the ArcGIS Web App Builder I created an application on my local machine using an ArcGIS Online web map and I can view this using the Launch button in the web builder. Then I download the application and deploy it on my local server, as per the documentation. Register the application with ArcGIS Online and share with my organization. Using the instructions I replace the appId in the config file with the newly registered appId. I can sometimes load the map from my local server, but the widgets fail to load. If I check the traffic I can see that launching the app from the builder uses /webappbuilder/apps/..., launching it from my site it uses /appbuilder/TestPCARViewer/.. which is the folder that I have it in. Except that some of the widget config files are still looking for the webappbuilder url. eg /appbuilder/TestPCARViewer/widgets/LayerList/LayerListView.html then a little later: /webappbuilder/apps/2/widgets/LayerList/config_LayerList.json And I cannot see my layer list. IE 11 and Chrome both exhibit the same behaviour. Unsure where to start debugging this, any suggestions?
... View more
10-03-2014
05:19 PM
|
1
|
0
|
1939
|
|
POST
|
Hi Sherrie, The problem occurs with the latest geocoder on the data disc and does not appear with older geocoders from earlier data discs. If you don't want to use the older geococder, the only workaround I could find is the same as you - export to shapefile. ESRI told me that they were phasing out the data discs so a fix would not be forthcoming.
... View more
08-19-2014
02:44 PM
|
0
|
0
|
598
|
|
POST
|
I agree that a validity check would be nice, but also have my suspicions that it would cause the same crashing issue. (EDIT: I used the MXD Doctor to check one of the MXDs and it had an invalid Page Layout, but another problem MXD came up clean). About the best I have come up with is wrapping it in a try: block, which at least catches the error, but I can't seem to prevent it from killing the process shortly afterwards (deleting the local mxd variable fails to help). I can report out what went wrong, and it seems to often be " 'NoneType' is not iterable ", from attempting to access the mxd object, but type(mxd) reports 'arcpy._mapping.MapDocument'.
... View more
08-13-2014
12:09 PM
|
0
|
0
|
2895
|
|
POST
|
Thanks for the quick replies. I also had to put all sorts of checks in place in the code, as I had MXD's reporting they didn't have a activeDataFrame one pass, then that they did when I queried them directly, and not showing the error when processed a second time and seemingly passing it on to another one further down. The issue I posted about occurs when you access the mxd object for the first time, mxd = arcpy.mapping.MapDocument(fullPath) does not cause a spike in memory, but df = mxd.activeDataFrame (for example) will, and it is at that point that python crashes, so I have no idea how to catch it. I will look into the multi-processing approach, thanks.
... View more
08-13-2014
08:19 AM
|
0
|
2
|
2895
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-29-2024 02:40 PM | |
| 1 | 12-22-2020 03:11 PM | |
| 1 | 03-14-2017 10:38 AM | |
| 1 | 12-04-2014 09:09 AM | |
| 1 | 07-07-2015 02:03 PM |
| Online Status |
Offline
|
| Date Last Visited |
09-02-2025
04:12 PM
|