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
|
475
|
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
|
476
|
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
|
4799
|
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
|
447
|
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
|
4653
|
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
|
1635
|
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
|
3370
|
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
|
667
|
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
|
1815
|
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
|
293
|
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
|
1684
|
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
|
1684
|
POST
|
I have a script which searches subdirectories for mxds and reports on them. Nothing new, except that I am having trouble with memory management. There seems to be a memory leak, although I have tried hard to del variables as I go, and separate the MXD parsing to a separate function in the script so that they are all local variables although I hold a reference to the logging and reporting text files as globals. This has been working well, until I hit a certain MXD in my test folders (I just grabbed a handful of folders off our network drives, so they are real MXDs). This MXD is 2MB in size and has nothing wrong with it that I can see, although it has a number of broken links it opens fine in ArcMap, and I can access it fine from the python window using "current", but when I access it with arcpy from my script, memory use jumps up 300-400MB for a moment (peaking at 600MB+). This usually crashes the process even though I have 16GB of RAM. The python process is 32bit. The MXD in question has a broken events layer at the top of the TOC, but I can access it OK from PyScripter (with the same memory jump) if I do so directly and before accessing any other MXDs. If I open the MXD and use Arcpy in the python window I have no trouble accessing it either. If I have already processed an MXD and am using around 300MB of memory then the spike often kills the python.exe process. Making a copy of the MXD with the events layer deleted seems to work OK in my script, even after processing with other MXDs, suggesting that the events layer itself may be the problem, but I am at a loss what to do about it. I cannot tell if there is a problem until I access it and I can't seem to catch it when there is (it skips my try block and windows reports that python has stopped working). Any ideas of what I can try?
... View more
08-12-2014
06:11 PM
|
0
|
14
|
7142
|
POST
|
updated link to our new viewer www.mymanatee.org/gisapps/mobile/index.html Hey Jeff, that looks great! Impressive work.
... View more
03-19-2014
09:27 AM
|
0
|
0
|
1067
|
POST
|
Hi, can anybody tell me how to access the ArcGIS Explorer AddIns, such as the Query Plus tool? I cannot find them and the links in http://blogs.esri.com/esri/arcgis/2010/05/04/add-in-updates-on-arcgis-explorer-labs/ tell me I do not have access (even while logged in). Are they gone/restricted in some way? The ArcGIS Explorer Desktop and Labs areas have mainly basemaps, I am looking for tools to extend the functionality, such as a select feature and buffer, or export selection to pdf/csv, or even a better print function. Is the only option to write my own now? Anyone want to share what they have made? I have a couple of basic tools that I wrote long ago
... View more
02-20-2014
01:46 PM
|
0
|
3
|
3924
|
Title | Kudos | Posted |
---|---|---|
1 | 12-22-2020 03:11 PM | |
1 | 03-14-2017 10:38 AM | |
1 | 07-07-2015 02:03 PM | |
1 | 12-04-2014 09:09 AM | |
1 | 06-26-2015 05:00 PM |
Online Status |
Offline
|
Date Last Visited |
3 weeks ago
|