|
POST
|
in the Widget.js for Query Widget, I made some changes to the _showResultLayerInfo function, and it seems working: _showResultLayerInfo: function(resultLayerInfo){
this._hideAllSingleQueryResultDijits();
var singleQueryResult = resultLayerInfo.singleQueryResult;
var resutlLayer = null;
if (singleQueryResult) {
html.setStyle(singleQueryResult.domNode, 'display', 'block');
var currentAttrs = singleQueryResult.getCurrentAttrs();
resutlLayer = lang.getObject("query.resultLayer", false, currentAttrs);
}
if (resutlLayer) {
this._activeLayerId = resutlLayer.id;
this._hideAllLayers(resutlLayer);
resutlLayer.show();
//now show in at widget
var layerInfo = this.layerInfosObj.getLayerInfoById(resutlLayer.id);
this.publishData({
'target': 'AttributeTable',
'layer': layerInfo
});
}else{
this._activeLayerId = null;
this._hideAllLayers();
}
}, Hope it helps.
... View more
02-21-2019
04:16 PM
|
1
|
0
|
1218
|
|
POST
|
Good point. It's not only ESRI examples, haven't we seen enough useless error messages in all sorts of software applications (Some of the Microsoft error messages are particularly irritating...)? I think the discussion should really boil down to this question: Does ESRI provide good Exception classes in its APIs? If it does, then it's done its due diligence, and it's up to the developers to capture the more informative Exceptions. If it does not, there are not much a developer can do about it, then the API is not good enough in terms of elegancy. I personally don't have much problem with ESRI exmaple codes, most of them are just code spinets to demonstrate a particular functionality of the API, and I guess their focus is not on the exception part. Having said that, I have to confess I often copy and paste the example without refining the exception handling, it would be nice if they did that for me
... View more
02-21-2019
03:46 PM
|
0
|
0
|
3772
|
|
POST
|
Thank you Dan. I upgraded to ArcGIS Pro 2.3.0. and surprisingly, the ArcGIS Python API in my Pro 2.3 is 1.5.1 not 1.5.2. The reason I cloned the environment to upgrade is the default environment doesn't allow modification. Please see the snipped screenshot below
... View more
02-13-2019
03:36 PM
|
0
|
1
|
2867
|
|
POST
|
No worries Dan. It's working now. The problem was in my cloned environment, not the default environment. I have to delete the flawed env and re-clone the default Pro 2.3 env, and consequently the problem is gone.
... View more
02-13-2019
03:16 PM
|
0
|
2
|
1969
|
|
POST
|
import arcpy ---------------------------------------------------------------------------ImportError Traceback (most recent call last)<ipython-input-3-5467a3dc9fe3> in <module>()----> 1 import arcpy C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\__init__.py in <module>() 70 import _initagsenv 71 ---> 72 from arcpy.geoprocessing import gp 73 from arcpy.geoprocessing import env 74 from arcpy.geoprocessing._base import gptooldoc as _gptooldoc C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\__init__.py in <module>() 12 # 13 #email: [email protected]> 14 from ._base import *C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py in <module>() 12 # 13 #email: [email protected]> 14 import arcgisscripting 15 import functools 16 ImportError: DLL load failed: The specified procedure could not be found.
... View more
02-07-2019
10:25 PM
|
0
|
4
|
3180
|
|
POST
|
After upgrading my ArcGIS Pro to 2.3, the python environment I previously cloned and then modified stopped working because of the "version mismatch": When I list the arcgis related packages I find the arcgispro package version is still 2.2, but the latest version should the be 2.3, and I believe that's why ArcGIS Pro reported "verion mismatch". So I tried to install arcgispro 2.3 in my environment, but this seems not allowed, because there were conflicts.Please see below: Since I have installed many other third-party packages, I don't want to give up my current environment until I run out of options. I have cloned the default env of the new ArcGIS Pro 2.3, and successfully upgraded the ArcGIS Python API to 1.5.3, this re-assures that ArcGIS Python API 1.5.3 is compatible, it's the arcgispro 2.2 python package which is causing the problem. Anyone has the same issue?
... View more
02-07-2019
04:27 PM
|
0
|
3
|
3844
|
|
POST
|
Not sure I correctly understand what you mean 'a cleaner method'. It seems to me you have to check the status manually to make sure the creation of the replica is completed before you can use it. The status are quite specific to replica creation in ArcGIS: "status": "<Pending | InProgress | Completed | Failed | ImportChanges | ExportChanges | ExportingData | ExportingSnapshot | ExportAttachments | ImportAttachments | ProvisioningReplica | UnRegisteringReplica | CompletedWithErrors>" It's similar to submitting an asynchronous Geoprocessing request, so you can use the following code to get a jump start if you like. import urllib, json, time
# the response of an asynchronous request is an url, now start checking the status
submitJson = json.loads(submitResponse.read())
if 'jobId' in submitJson:
jobID = submitJson['jobId']
status = submitJson['jobStatus']
jobUrl = taskUrl + "/jobs/" + jobID
while status == "esriJobSubmitted" or status == "esriJobExecuting":
print "checking to see if job is completed..."
time.sleep(1)
jobResponse = urllib.urlopen(jobUrl, "f=json")
jobJson = json.loads(jobResponse.read())
if 'jobStatus' in jobJson:
status = jobJson['jobStatus']
if status == "esriJobSucceeded":
if 'results' in jobJson:
resultsUrl = jobUrl + "/results/"
resultsJson = jobJson['results']
for paramName in resultsJson.keys():
resultUrl = resultsUrl + paramName
resultResponse = urllib.urlopen(resultUrl, "f=json")
resultJson = json.loads(resultResponse.read())
print resultJson
if status == "esriJobFailed":
if 'messages' in jobJson:
print jobJson['messages']
else:
print "no jobId found in the response" Note: The above code snippet is from ESRI help: Using a geoprocessing service in Python scripts—Documentation | ArcGIS Enterprise Hope this is helpful
... View more
02-03-2019
03:40 PM
|
0
|
1
|
1451
|
|
POST
|
Hi Vaibhav, Glad to know it works. If you agree that this is the solution, can you please mark it as the correct answer so it can help people with the same questions.
... View more
02-03-2019
01:45 PM
|
0
|
0
|
1326
|
|
POST
|
Like you can't really delete the services on the federated servers in the portal web interface, you can't delete a service using the GIS module in the ArcGIS Python API, Because, GIS module is the equivalent to your Web GIS (Portal or AGOL). To delete a service, you mean manage the ArcGIS server, you need the following python modules: arcgis.gis.server module — arcgis 1.5.2 documentation arcgis.gis.admin module — arcgis 1.5.2 documentation I did a quick test in my environment, and it seems working fine: from arcgis.gis.server import Server
# this is NOT your portal url, it's your server admin url
gis_server = Server(url="https://your_server_name:6443/arcgis/admin",username="site admin name",password="admin password")
service_manager = gis_server.services
# list the services in the test folder, make sure you see the service your want to delete
test_services = service_manager.list(folder="test")
print(test_services)
# for example, it's the 3rd item in the list
test = test_services[2]
# this will work, and return "True"
test.delete() Please reference the aforementioned document to find the detailed the syntax for the construction of the Server instance Hope it helps
... View more
01-31-2019
11:15 PM
|
1
|
4
|
4988
|
|
POST
|
I see. There is a method called upload for the FeatureLayerCollection class. arcgis.features module — arcgis 1.5.2 documentation but the append function for FeatureLayer does not have a upload_id parameter, and in the source code I can see the upload_id was intentionally set to None. So I assume the upload_id was deliberately disabled for the function.
... View more
01-30-2019
08:12 PM
|
0
|
0
|
1982
|
|
POST
|
Hello Simon, It seems we have to do it in two steps: Step 1: update the File Geodatabase item Step 2: use the File Geodatabase item to update the Feature Service via append function which supports upsert. I did a quick test here, and it seems works fine. It would be good if we can update the feature service using zipped FGDB directly. and I don't know why the API doesn't. Hope someone from the development team can comment on this. But we can workaround it by delete the zipped FGDB item after the update. I am just guessing, it really depends on your own workflow Cheers
... View more
01-29-2019
11:58 PM
|
1
|
2
|
1982
|
|
POST
|
Hi Simon, Is this what you are looking? arcgis.features module — arcgis 1.5.2 documentation Or you can use edit_features(adds=None, updates=None,....) arcgis.features module — arcgis 1.5.2 documentation There is an example for it updating_features_in_a_feature_layer | ArcGIS for Developers Hope these information are useful for you Cheers
... View more
01-29-2019
06:05 PM
|
0
|
4
|
1982
|
|
IDEA
|
This makes sense when your web app covers a wide audience base and you only provide the common tools and data in the web app with the assumption that the users will add their own data... It makes it easy for the developer but for the users, it's annoying that they have to add the same data every time they fire up the application ! Some users have to keep their application alive for days which annoys the ICT people in the department
... View more
01-28-2019
09:05 PM
|
0
|
0
|
1565
|
|
POST
|
Thank you for the code, and you are spot on. It certainly looks like a deepcopy quirk for pandas.Series.copy (Joshua you pointed to the pandas.Dataframe.copy document, but a row is actually a pandas.Series. Nevertheless, copy(deep=true) behaves the same way in both Series and DataFrame. ), It is important to know, so I am sort of repeating it here: pandas.Series.copy — pandas 0.24.0 documentation When deep=True , data is copied but actual Python objects will not be copied recursively, only the reference to the object. This is in contrast to copy.deepcopy in the Standard Library, which recursively copies object data As to the question you asked Oisin Slevin: All previous rows or just the previous row, or maybe the first row? My answer is, it would be the first row and and all the appended rows. Why? because for all these records, the following key (a variable) is pointing to the same memory address. record_to_append.SHAPE['rings'] In you experiment, the second row will not be affected from the other rows, as its SHAPE['rings'] is pointing to a different address. Oisin does not have a second initial row, so for him, the SHAPE['paths'] for all the records will be the same. I think you also provided the solution in your code: rec.SHAPE = {"rings":[[...]]} copy.deepcopy() might work as another solution as well.
... View more
01-28-2019
06:04 PM
|
0
|
0
|
2877
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-28-2019 05:13 PM | |
| 1 | 02-25-2019 04:54 PM | |
| 1 | 03-05-2019 02:08 PM | |
| 1 | 03-12-2019 10:20 PM | |
| 1 | 11-27-2024 04:36 AM |
| Online Status |
Offline
|
| Date Last Visited |
01-17-2025
07:39 AM
|