POST
|
We have a GP service where the last step is to add a field (DOUBLE, holds 2 decimal places) - and does a field calculation. It's going from feet to miles - we only want to display 2 decimal places - so .34 miles instead of .34125823672... for example. All works correctly running the tool in ArcMap - the output dataset is an in_memory feature layer, with the correct properties in the calculated miles field. Using the tool through a GP Widget in WAB (Portal, 10.6) - the field in question displays all of the decimal places - not respecting what was set in the script. Any way to enforce this in the Widget config (nothing obvious I could see) or tool config in arcmap? Thanks - Allen
... View more
06-12-2019
10:56 AM
|
0
|
2
|
462
|
POST
|
- We're using 10.6.1 - No trusted servers added - my understanding is that is only needed in cases where Portal needs to access map/feature services from ArcServer machines that use web-tier security, which is not in play here. Interesting development - when I share these layers that were throwing the 'layers cannot be added to map' errors in Portal (and showing the CORS blocking/Access-Control-Allow-Origin error in dev. tools) with everyone, they draw on the map. What's odd about this is that I am both the owner of these items in Portal as well as an administrator, so sharing shouldn't make a difference in what I can and can't access for these particular layers - they are in my content after all. This makes me think it's an issue with security, and passing credentials between the federated/hosting server and the Portal server. This is frustrating because typically I have seen that federation should handle this seamlessly. Thanks Angus and Randall for your input.
... View more
05-30-2019
08:02 AM
|
0
|
1
|
2687
|
POST
|
This @#$# issue is making me crazy. We have a Portal instance, using the distributed model: 1 Portal machine, with Web Adaptor 1 Federated and hosting server with Web Adaptor. - the federation validates successfully, and I see items published there directly in my content in Portal) 1 server for Datastore (not really in play for this issue, I don't think) I published a bunch of layers as REFERENCED feature layers through the hosting server (we need the data to be live). These layers will not draw on a map - 'Access-Control-Allow-Origin' has no value. So, on the Portal server, I go in to IIS, at the web adaptor level, and add 'Access-Control-Allow-Origin' with a value of * - it then says this is not allowed either if credentials are being passed (I think that's what the message means) - I'm about to give up, move to the country, make an honest living. The Access Control Allow Origin issue comes up from time to time, and I simply cannot find a real solution. I have tried adding the header at all levels of IIS (default website, web adaptor level, machine name level) - currently, for testing, there are no entries on IIS on either the hosting server or the Portal server, and no custom headers in the webconfig file at wwwroot. We are enforcing HTTPS only in the portal site, certificates all in place and bound in IIS, plus the root/intermediate ones uploaded into Portal/Server Admin pages, and neither Portal nor Server are using the default self-signed certs - both using the same wildcard domain certs that are our standard. I'm at a complete loss to make this work, much less know where to look for what the best practice is. Any insight is hugely appreciated. Thanks - Allen
... View more
05-28-2019
10:23 AM
|
2
|
5
|
3551
|
POST
|
We have a public-facing app that uses the Screening Widget - up to 5 layers are available to download. All is good in Chrome + IE - automatically downloads all of the layers available as individual CSVs. In Firefox however, it seems the only option is to download one layer. Understanding that dealing with browser variability is not an ESRI problem, I'm curious if anyone else has seen this behavior and found any way around it. http://tucsondelivers.tucsonaz.gov/ App is embedded, the first one you come to as you scroll down. Thanks - Allen
... View more
05-01-2019
09:25 AM
|
0
|
0
|
274
|
POST
|
Our organization is working with a 3rd party vendor on an enterprise application that has some GIS integration (city government asset tracking system) - this application basically consumes simple map/feature services. However, due to a limitation on their end, we need to provide our imagery as a cached Map Service. This was simple pre 10.5 - that's how all of our aerial imagery was served up. Now, with new Enterprise model, we have an Image Server licensed and working great (10.6.1) - but we can't use it in this case because of the vendor requirements (their mapping component also uses ancient technology...) - I can't seem to publish an aerial as a Map Service on the Image Server (by design, I believe) or on any of our other ArcServer machines (all at least at 10.5.1) - those say we don't have the Image Server Extension. We have an ELA, but I don't see extensions on our My ESRI pages that I can activate. So, I'm wondering if there is a way to still publish mosaic datasets (aerial imagery) as an old-fashioned cached Map Service on ArcServer 10.5+. Thanks - Allen
... View more
04-23-2019
03:00 PM
|
0
|
1
|
354
|
POST
|
The works perfectly - Thanks Stephen. The only odd thing I'm running up against is that the group of users we are 'cloning' has 83 people - under the default limit of 100 that the user search returns. However when I run my modified version of your code above along with the Copy_users function, it stops after creating the first 60 users. I thought at first this was due to some bad data or similar related to the account of the next (61st in this example) user causing the function to stop, but actually the user search is just returning 60 users. Here's my final code using yours (slightly modified for our organization) and also a modified version of the copy_users function found in the Python API examples (https://developers.arcgis.com/python/sample-notebooks/clone-portal-users-groups-and-content/) NOTE: we use Active Directory security, so this example is set up for that - our username syntax is 'ADUSERNAME@DOMAIN' - so we split the user name on the '@' sign and use the first list item from that split to feed into the IDP_USERNAME input required for AD-level security: Copy_users function for Active Directory (I took out some name validation and user updating code as it was not needed for us - the 'adname' variable is the active directory username generated later): NOTE - the order of these items in the target_portal.users.create function DOES seem to matter. Also, obviously you need to define source_portal and target_portal using the URLS for each. Also note that here these are level 2 users, so that simplifies the function because we hard-code that value for 'level'. Here's where I used Stephen's code to get users only in the desired group, then generate the AD Name, and call the copy_users function - after running a user search creating the 'source_users' object: Thanks - Allen
... View more
04-15-2019
09:07 AM
|
3
|
0
|
1985
|
POST
|
Thanks Egge-Jan - This looks great - I'm still working through it, but essentially I'm modifying your script to append the group 0 or 1 flag to the user list and use that flag as a filter to only run the 'copy_users' function on those where the flag = 1. I'll follow up with results and any useful code blocks. Allen
... View more
04-11-2019
02:16 PM
|
2
|
0
|
1985
|
POST
|
We have a new Portal site, need to copy users from an existing Portal, but only a subset of users, who belong to a specific group in the existing Portal. Using the code samples provided, I have it mostly ready to run in Jupyter Notebooks (figured out how to make it work for Active Directory accounts), but I can't seem to have the users.search be filtered/queried for a specific group. The example I'm working from has a query to filter out certain users, which is nice, but I'm not sure how to/if you can change that filter to reference a group: source_users = source.users.search('!esri_ & !admin')
for user in source_users:
print(user.username + "\t:\t" + str(user.role))
So what I'd like is to have something like (i know 'groupname' is not a real thing, this is just get the idea across):
source_users = source.users.search('groupname: My Group')
for user in source_users:
print(user.username + "\t:\t" + str(user.role)) Thanks - Allen
... View more
04-10-2019
02:09 PM
|
0
|
4
|
2321
|
POST
|
We have a new Portal site, need to copy some content, while keeping it in the old ('source') Portal as well. This script looks worth investigating: http://enterprise.arcgis.com/en/portal/latest/administer/windows/example-copy-content.htm Wondering about setting the variables - can't quite figure that out from the example page. It lists what you are required to provide, but how that maps to variables I'm not sure - the script doesn't seem to have and dummy variables set up for you to modify for your own organization. Anyone used this script and have feedback? Thanks - Allen
... View more
04-04-2019
03:17 PM
|
0
|
0
|
352
|
POST
|
In a python script to be published as a GP service, I'm making a call to a Locator Service, getting results back - plan is to use the X & Y values from the locator return as input variables for some intersects etc. as part of the overall tool. The call/return from the locator is working, now I'm investigating the python json library to figure out how the extract just X & Y values into variables. My question is about whether/how you can use the json library to parse through the json and return the 2 attributes (the X and Y in my case) so they can be plugged into python variables.. Results example: {u'candidates': [{u'attributes': {u'Y': 446768.471952, u'X': 992202.058741}, u'score': 100, u'location': {u'y': 446768.47195232206, u'x': 992202.0587409921}, u'address': u'201 N STONE AV, TUCSON'}], u'spatialReference': {u'wkid': 2868, u'latestWkid': 2868}} Alternately, after simply converting the Results to a string: { "spatialReference": { "wkid": 2868, "latestWkid": 2868 }, "candidates": [ { "address": "201 N STONE AV, TUCSON", "location": { "x": 992202.0587409921, "y": 446768.47195232206 }, "score": 100, "attributes": { "X": 992202.05874100002, "Y": 446768.47195199999 } } ] } Anyone been through this before? Thanks - Allen
... View more
03-21-2019
10:36 AM
|
0
|
2
|
662
|
POST
|
Looks like in order to specify multiple attributes using the format here, you just need your attributes to be in a comma-separated list, in DOUBLE quotes So, full code being used to call a locator service and get the X,Y attributes returned - may vary depending on the configuration of the locator service you are hitting - but essentially the 'data' variable here is what gets put in the URL query to the locator so you can try submitting a request directly from the REST endpoint of the locator and see how that looks in the URL to determine what you want in the 'data' parameters. import arcpy,os import urllib import json arcpy.env.overwriteOutput = True address = '201 N Stone Av' data = {'SingleLine': address, 'maxLocations': 1, 'outFields': "x,y", 'f': 'pjson'} URL = 'https://gis.tucsonaz.gov/public/rest/services/Geocoders/CENTERLINE_LOCATOR_WEB/GeocodeServer/findAddressCandidates' result = urllib.urlopen(URL, urllib.urlencode(data)).read() print json.loads(result)
... View more
03-21-2019
08:42 AM
|
0
|
0
|
410
|
POST
|
Ok - sometimes it takes putting it out to there to see what's right in front of you - Got it to return a single record (maxLocations): data = {'SingleLine': address, 'maxLocations': 1, 'f': 'pjson'} What I'm stuck on now is getting the 'outFields' portion to be X and Y - simple formatting issue I think, as far as how to properly write out multiple fields to the 'outFields parameter - it works as below, returning the X attribute - now just need to add the Y attribute - have tried a bracketed lists: ('x','y'), ['x','y'], {'x','y'}, - no luck, and simply putting a comma between: 'x','y', reads as invalid in the IDE for example: data = {'SingleLine': address, 'maxLocations': 1, 'outFields': 'x', 'f': 'pjson'}
... View more
03-20-2019
03:15 PM
|
0
|
1
|
410
|
POST
|
Working on a GP tool that will be published as a GP service for use in a GP Widget/WebApp. User will need to enter an address OR click on a map to kick of the tool, then a bunch of other things happen. Basically, I want the input parameters for the tool to be X/Y - so I'm calling one of our locator services to handle the scenario where user inputs an address. All is working fairly well - can hit the locator, and get results. However, there a few steps I'm fuzzy on as far as working with the results that come back from the locator. 1 - how to specify that we only need 1 result from the locator (the first one) - typically we are getting at least 2 results. 2 - how to specify that really all I want is the X and Y back I think once I'm just getting a single result back, and then only the X/Y values, I can go forward. Code is below, for just the call and return to/from the Locator service(locator should be publicly accessible) - the 'address' variable will be converted to a GetParameterAsText variable to allow user input, just hard-coded currently for development: import urllib import json import arcpy,os arcpy.env.overwriteOutput = True address = '201 N Stone Av' data = {'SingleLine': address, 'f': 'pjson'} URL = 'https://gis.tucsonaz.gov/public/rest/services/Geocoders/CENTERLINE_LOCATOR_WEB/GeocodeServer/findAddressCandidates' result = urllib.urlopen(URL, urllib.urlencode(data)).read() print json.loads(result) Thanks - Allen Scully
... View more
03-20-2019
01:59 PM
|
0
|
2
|
504
|
BLOG
|
Thanks Adam - So, the combination of setting the data type on the Input connector to Date (default is Double for this type of data in the generated GeoEvent Definition) - you need to multiply the date field in question by 1000 in a field calculator, due to GeoEvent expecting milliseconds, not seconds. This worked for me. For reference: StackExchange - How can I convert a UNIX timestamp to a datetime format within the GeoEvent Note: The above reference from Stack Exchange is a little dated (2016). Please also consider updated documentation for GeoEvent Server which shows how an expression toString( ) used in a Field Calculator can be used to obtain a String representation of a Date ... works if you need a String representation of a Geometry as well. toString(fieldName) Returns: string Example: toString(Geometry) Example: toString(Epoch) Returns a string representation of the value in the specified event attribute field. These functions are intended to allow string representations of Date and Geometry attributes to be nested within other functions such as substring, so that real-time analytics can extract information from the higher-order data type. Result: "{""x"":32.125,""y"":-117.125,""spatialReference"":{""wkid"":4326}}" Result: "Fri Nov 03 17:07:56 PDT 2017" See Also: https://community.esri.com/community/gis/enterprise-gis/geoevent/blog/2019/03/14/what-time-is-it-well-that-depends?sr=search&searchId=0bf7ad2b-8cec-477a-8472-d09c1e402b13&searchIndex=0
... View more
03-12-2019
02:26 PM
|
0
|
0
|
23940
|
BLOG
|
Sorry to bug you - one more question though, about dealing with the UNIX formatted dates. A little unsure how to handle the 'Expected Date Format' for these dates (sent in 'seconds since 1970' format). HAve you been able to crack that one? - thinking it's a field calculation in GEP but haven't found the right syntax.
... View more
03-01-2019
02:14 PM
|
0
|
0
|
23940
|
Title | Kudos | Posted |
---|---|---|
1 | 08-13-2019 04:21 PM | |
1 | 09-12-2019 01:30 PM | |
1 | 05-21-2020 12:11 PM | |
1 | 05-07-2020 03:20 PM | |
2 | 05-28-2019 10:23 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|