POST
|
Greetings, Is Psycop2 the best Python module for PostgreSQL and PostGIS with SDE?? Like to hear your feedback. Regards, Clive
... View more
12-13-2020
04:01 PM
|
0
|
0
|
671
|
POST
|
Greetings, I found this link that solves the problem. Short simple and does what needs to be done. https://developers.arcgis.com/documentation/core-concepts/security-and-authentication/accessing-arcgis-online-services/
... View more
11-30-2020
09:13 AM
|
1
|
0
|
2414
|
POST
|
Hi Joshua, The client is a Webapp URL: https://company.cloud.esriuk.com/ The code is: ###### username = 'me' password = 'my password referer = "https://company.maps.arcgis.com" portalUrl = "https://company.cloud.esriuk.com/portal" tokenURL = "https://company.cloud.esriuk.com/portal/sharing/rest/generateToken" print("START Generate Token") def generateToken(user_name, pass_word, portalUrl): # Retrieves a token to be used with API requests. headers = {'content-type': 'application/x-www-form-urlencoded'} parameters = {'username': username, 'password': password, 'client': 'referer', 'referer': portalUrl, 'expiration': 60, 'f': 'json'} url = 'https://eiffagekier.maps.arcgis.com/sharing/rest/oauth2/token' response = requests.post(url, data=parameters, headers=headers) #print(response) ### >>>> ### GET error try: jsonResponse = response.json() print(jsonResponse) if 'token' in jsonResponse: return jsonResponse['token'] elif 'error' in jsonResponse: print (jsonResponse['error']['message']) for detail in jsonResponse['error']['details']: print (detail) except ValueError: print('An Error occurred.') print(ValueError) token = generateToken(username, password, tokenURL) #### portalUrl print(token) print("END Generate Token") Thanks, Clive
... View more
11-30-2020
08:26 AM
|
0
|
0
|
2415
|
POST
|
Hi David, Thanks for the response. I am getting a HTTP:400 error now, stating that the client_id is not specified?? I have hardcoded the client/client_id/referer as company name and/or the base URL. But still keep getting the 'client_id 'not specified' error message?? Odd. Thanks, Clive
... View more
11-30-2020
06:27 AM
|
0
|
3
|
2423
|
POST
|
Greetings I am working on an ESRI Hosted site. I am trying to automate the ESRI token web page Generate Token form ie: I used a Python POST: user_name = 'me' pass_word = 'my password' referer = 'https://company.cloud.esriuk.com' referer_name = 'https://company.cloud.esriuk.com/portal/sharing/rest/generateToken' token = '' expires = 90 ##data = {username=user_name,password=pass_word, client=referer, referer=url, expiration=90, f=json} requests.post(user=user_name, password=pass_word, client=referer, referer=referer_name, expiration=90, f=json) print("Generating token") I also tried: gis_server = GIS(url=f"server_base_url/web_adaptor/admin", token_url=f"server_base_url/web_adaptor/tokens/generateToken", username="admin_user", password="admin_password") print(token) I just get the process finished, no output?? Any suggestions? Regards, Clive
... View more
11-30-2020
03:20 AM
|
0
|
6
|
2444
|
POST
|
Greetings, I have an odd problem. I was able to export a Domain and associated subtypes to AGOL. When I export the same layer to Portal. I get the fields, but not the domain or subtypes. The import button, with append data is not present in Portal?? Am I really expected to manually type them?? Anyone come across this issue? Thanks, Clive
... View more
11-06-2020
07:13 AM
|
1
|
2
|
1490
|
POST
|
Hi Joshua, I updated the ESRI sample (Scripting with the ArcGIS REST API—Portal for ArcGIS | Documentation for ArcGIS Enterprise). I can log into our Portal, but not our AGOL?? I am getting the following error now, when trying to login to our AGOL?? Error: This site can’t be reached server IP address could not be found
... View more
10-29-2020
09:47 AM
|
0
|
2
|
3598
|
POST
|
Thanks for the input on the .encode(utf-8) I ran the code several times, nothing happened.. NOT even errors. Then I remembered to add: generateToken(username, password, portalUrl ) at the end of the code.
... View more
10-29-2020
08:59 AM
|
0
|
0
|
1821
|
POST
|
Greetings, I am using the ESRI sample code to generate a token (Scripting with the ArcGIS REST API—Portal for ArcGIS | Documentation for ArcGIS Enterprise ), getting an expected type error?? Error is Expected type 'Optional[bytes]', got 'str' instead?? I updated the code for Python 3. ### Python 3.8 def generateToken(username, password, portalUrl😞 '''Retrieves a token to be used with API requests.''' portalUrl = myurl username = myuser password = mypassword parameters = urllib.parse.urlencode({'username' : username, 'password' : password, 'client' : 'referer', 'referer' : portalUrl, 'expiration' : 60, 'f' : 'json'}) print("Read parameters") response = urllib.request.urlopen(portalUrl + '/sharing/rest/generateToken?', parameters).read() print("response") try: jsonResponse = json.loads(response) if 'token' in jsonResponse: return jsonResponse['token'] elif 'error' in jsonResponse: print(jsonResponse['error']['message']) for detail in jsonResponse['error']['details']: print(detail) except ValueError: print('An unspecified error occurred.') ## End All I get is the error message: Expected type 'Optional[bytes]', got 'str' instead Appreciate any assistance and pointers. Regards, Clive
... View more
10-29-2020
06:13 AM
|
0
|
2
|
1864
|
POST
|
I want to use the ArcGIS basemap with json as the format, so used the blank query. let Source = Json.Document((Web.Contents("https://www.arcgis.com/home/webmap/viewer.html?webmap=55ebf90799fa4a3fa57562700a68c405&f-pjson"))) in Source This returned an error: There are extra characters after the json ??
... View more
03-27-2020
07:28 AM
|
0
|
0
|
1560
|
POST
|
Greetings, I am trying to access an ARCGIS Server URL in Power BI. I read that you can use a Power BI query, would like some clarity on the query format. The query is: let Source =son.Document((Web.Contents("query&f=pjson&token=xxx"))) in Source I presume the token is from ArcGIS Portal Admin?? I copied the URL below from the ArcGIS Manager Query tool. https://<server>/server/rest/services/Nag/CCGPostcodeMap/MapServer/1/query?where=1%3D1&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&distance=&units=esriSRUnit_Foot&relationParam=&outFields=PostArea&returnGeometry=false&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=&havingClause=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&historicMoment=&returnDistinctValues=false&resultOffset=&resultRecordCount=&returnExtentOnly=false&datumTransformation=¶meterValues=&rangeValues=&quantizationParameters=&featureEncoding=esriDefault&f=pjson Do I need to copy the whole string?? Thanks, Clive
... View more
03-26-2020
09:56 AM
|
0
|
1
|
1781
|
POST
|
Error 6740: The machine was not reachable. The only error is a certificate issue. IIS Manager The default website has stopped. When restart get an error: Another website might be using the same port. I can load ArcGIS Server Admin/Manage Under home-machines-URL The status is started, but not reachable, when launch the REST URL. I opened arcgis/admin Then opened the Webadaptor details, saw the port number was 80 not 443. I found an article that provides information to update the Port number, will try this https://enterprise.arcgis.com/en/web-adaptor/latest/install/iis/configure-arcgis-web-adaptor-portal.htm
... View more
03-16-2020
12:42 PM
|
0
|
0
|
1214
|
POST
|
Greetings, Is it possible to post REST services to AGOL without ArcGIS Server?? I have posted to ArcGIS Server from ArcGIS Pro. How can you achieve this if the user doesn't have ArcGIS Manager only AGOL??
... View more
03-16-2020
03:08 AM
|
0
|
1
|
885
|
POST
|
Hi Michael, The client doesn't want to use Jypter Notebooks not ArcGIS Online assistant./external-link.jspa?url=https%3A%2F%2Fago-assistant.esri.com%2F/external-link.jspa?url=https%3A%2F%2Fago-assistant.esri.com%2F I eventually!!! found a Python script to update the Webmap URL: https://enterprise.arcgis.com/en/portal/latest/administer/windows/example-update-the-url-of-a-service-in-a-web-map.htm
... View more
02-14-2020
01:36 AM
|
3
|
1
|
2208
|
POST
|
Greetings, The fragment below works, cloning GIS content from Portal A to B. gis2.content.clone_items(data, copy_data=True, search_existing_items=True) However, the REST URL is copied across ie it has the wrong REST in Portal B. I read the ESRI article: https://developers.arcgis.com/python/sample-notebooks/using-and-updating-gis-content/ The web map has a number of "values" eg: id, title, url, etc. So I tried to use the method in updating GIS content: gis2 = GIS(target_portal, username=admin, password=passw, verify_cert=False) print("LOGGED IN TARGET") ####MAP ID #map id search_result = gis2.content.get('4aa844d480704a7392a1bc0b992dee2d') print("MAP") display(search_result) ##search_result.layers #MAP SEARCH search_result_json = gis2.content.search('title:LQSP', item_type="*") #display(search_result_json) #CREATE MAP OBJECT wm_item = search_result_json[0] from arcgis.mapping import WebMap web_map_obj = WebMap(wm_item) ## display(web_map_obj) ### prints map #DISPLAY JSON print("WEB MAP OBJ") web_map_obj.layers print("DISPLAYS JSON: ") #display(web_map_obj.layers) for lyr in web_map_obj.layers: print(lyr.title + " " + lyr.url) The section to update the url value is below, this fails?? web_map_obj.update(url='<server>arcgis/rest/services/<map>/MapServer') I want to update the url from: <DEV.gov.uk>arcgis/rest/services/<map>/MapServer TO: <TEST.gov.uk>arcgis/rest/services/<map>/MapServer I welcome any suggestions. Regards, Clive
... View more
02-13-2020
02:30 PM
|
0
|
3
|
2543
|
Title | Kudos | Posted |
---|---|---|
1 | 02-22-2021 04:17 AM | |
1 | 02-05-2021 07:18 AM | |
1 | 11-06-2020 07:13 AM | |
2 | 07-07-2021 04:20 AM | |
1 | 01-07-2021 02:53 PM |
Online Status |
Offline
|
Date Last Visited |
02-23-2024
07:07 PM
|