POST
|
If nothing evaluates from the query and the result is [] sdf then there is no spatial reference and nothing to join. It must be that I get a result from 1 of the portal items and the other i do not!
... View more
02-16-2024
11:46 AM
|
0
|
0
|
263
|
POST
|
We're doing a simple query of 2 portal feature layers and performing a spatial join on the 2 sdf representations. It looks like the error complains "Difference Spatial References, aborting operation" when a Left/Right join is attempted, so I checked each sr for each sdf and sure enough one of them is []! This issue appears to only occur on 1 of our enterprise portals (we have a test and prod version of each site). When I check the item properties it does show the correct spatref so I'm not sure where to check next! Code executed on it's comparable items across both portals produces what we expect: {'wkid': 2881, 'latestWkid': 2881} The other portal produces: [] targetFSet = scratchLayer.query(where=qryStr,out_sr=2881)
targetDF = targetFSet.sdf
df1SR = targetDF.spatial.sr
print(df1SR)
... View more
02-16-2024
11:23 AM
|
0
|
1
|
269
|
POST
|
Hey there David! Great to hear from you again. The directory levels all look correct, there's no duplication on the deployed resources. This issue only appears when we navigate to the index.html of the deployed app. I'm wondering if this is an IIS/domain setting thing? We ran into this issue a couple of years ago but didn't document the fix and just re-investigating.
... View more
01-05-2024
09:14 AM
|
0
|
0
|
145
|
POST
|
We have developed an ExB with Developer edition v1.12 and seeing 404 error when attempting to navigate to the index.html of the deployed ExB. From the dev tools console (header tab): Index.html Request URL: https://ourdomain.com/somefoldername/index.html Status Code: 200 Ok init.js Request URL: https://ourdomain.com/somefoldername/cdn/1/cdn/1/jimu-core/init.js Status Code: 404
... View more
01-05-2024
08:03 AM
|
0
|
2
|
206
|
POST
|
Sounds like your portal is connected to your active directory accounts maybe? If that's the case, what we do is create a new portal account that doesn't use AD to authenticate and this is the account used for authentication within any scripting. Also: if you have ArcGIS Pro open and you are logged into the portal, does your script run successfully then to create the GIS object?
... View more
11-09-2023
09:16 AM
|
0
|
1
|
370
|
POST
|
Hi Katherine! What is the output parameter of your GP tool? I'm unsure what the application is expecting to render it as or what would be appropriate. I think my comments above to the original post were more about generating an output of a zipped up kml that would end up in a the user's downloads folder. If that's the case, your python script source would need to execute the "Layer To KML" tool then implement code to zip that up and send via the output parameter.
... View more
09-25-2023
07:00 AM
|
0
|
0
|
879
|
POST
|
Oh. the updates parameter is supposed to be a list in edit_features() method: edit_result = layer.edit_features(updates=[editFeature])
... View more
08-14-2023
07:14 AM
|
2
|
0
|
316
|
POST
|
This is supposed to be simple but running into issues attempting to submit updates to a feature service layer. Forever I have simply used the REST api (ie. "applyEdits") on a service layer and always works as expected but now I'm converting some of that code over to the python API to work directly on the portal items themselves. Anyway, this is somewhat close to THIS example but getting this error "object of type 'Feature' has no len()" on the edit_features() method. #set layer
portalItem = gis.content.get('9cb6469e3d3e43379551abbb1b74a284')
for layer in portalItem.layers:
if "Final" in layer.properties.name:
#check if there is a matching appId
checkSet = layer.query(where='objectid={}'.format(oid), return_count_only=True)
if checkSet == 1:
#get the row to edit using the oid value
fset = layer.query(where='objectid={}'.format(oid))
editFeature = [f for f in fset.features if f.attributes['OBJECTID']==oid][0]
editFeature.attributes['PERMIT_ID'] = inputPermitId
editFeature.attributes['PERMIT_NO'] = inputPermitId
edit_result = layer.edit_features(updates=editFeature)
... View more
08-14-2023
07:10 AM
|
0
|
1
|
319
|
POST
|
If you go the gp service route and implement python api to I guess access a FeatureLayerCollection, there may be something there to go at it in one shot but I'm not sure what is under the hood behind that operation (ie, maybe it just makes all 100 requests too). Also, this seems overly complex for such a simple request to get feature counts! Anyway -- sorry no real good answer for you just a quick comment and will get notified of any other answers you may get, I am curious myself!
... View more
08-11-2023
09:34 AM
|
0
|
1
|
577
|
POST
|
Printing params value and sending same exact request/post using Postman succeeds.
... View more
07-13-2023
06:25 AM
|
0
|
0
|
280
|
POST
|
I have had a py 2.7 script running for years that makes requests to the ESRI route service at https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World/solve Converting to requests library. It supplies a token and pre-built input params and makes the post request: {'f': 'json', 'stops': {'features': [{'geometry': {'x': 863532.1692919674, 'y': 1030860.3483306282, 'spatialReference': {'wkid': 2881}}, 'attributes': {'CurbApproach': 'null', 'TimeWindowStart': 'null', 'TimeWindowEnd': 'null', 'Attr_Minutes': 0, 'Attr_TravelTime': 0, 'Attr_Miles': 0, 'Attr_Kilometers': 0, 'Attr_TimeAt1KPH': 0, 'Attr_WalkTime': 0, 'Attr_TruckMinutes': 0, 'Attr_TruckTravelTime': 0, 'Name': 'permitAppBoundary'}}, {'geometry': {'x': 623453.099237, 'y': 136924.166006, 'spatialReference': {'wkid': 2881}}, 'attributes': {'CurbApproach': 'null', 'TimeWindowStart': 'null', 'TimeWindowEnd': 'null', 'Name': 'MARATHON FS'}}]}, 'token': '7a6sZjdk8Xiit1VUsERtOGf4tEHskFAyZky3_LP8J1yggoKtkpp2cvFFDo5WP3bg6imUNra7cLZZ2B9yyKhJTnRl-fe0qxcD73vL_58lLSytF00nfhoXM6K0mbp7Vt2OISbhzTfjLlpa3Y2tI5K2j17Qq5o-JXO16Bcmx7KKlgpyhDlfxnhX34umWPIi2hEr', 'returnDirections': 'false'} Same request made in Postman successful. I am running into a new error with the input above: {'error': {'code': 400, 'extendedCode': -2147024809, 'message': 'Invalid or missing input parameters.', 'details': ['Invalid input coordinates [features].']}} Only difference is that now all input coordinates you see above are in WKID 2881 (whereas before all were supplied in 102100 Complete def: def routeRequest(permitX, permitY, scX, scY, serviceCenter):
routeQueryURL = 'https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World/solve'
params = {'f':'json',
'stops':{'features':[{
'geometry':{
'x':permitX,
'y':permitY,
'spatialReference':{
'wkid':2881
}
},
'attributes':{
'CurbApproach':'null',
'TimeWindowStart':'null',
'TimeWindowEnd':'null',
'Attr_Minutes':0,
'Attr_TravelTime':0,
'Attr_Miles':0,
'Attr_Kilometers':0,
'Attr_TimeAt1KPH':0,
'Attr_WalkTime':0,
'Attr_TruckMinutes':0,
'Attr_TruckTravelTime':0,
'Name':'permitAppBoundary'
}
},
{
'geometry':{
'x':scX,
'y':scY,
'spatialReference':{
'wkid':2881
}
},
'attributes':{
'CurbApproach':'null',
'TimeWindowStart':'null',
'TimeWindowEnd':'null',
'Name':serviceCenter
}
}
]},
'token':tokAGO,
'returnDirections':'false'}
r = requests.post(routeQueryURL, data = params, verify=False)
dataM = json.loads(r.content)
print (dataM)
stopName = dataM['routes']['features'][0]['attributes']['Name']
miles = dataM['routes']['features'][0]['attributes']['Total_Miles']
driveTime = dataM['routes']['features'][0]['attributes']['Total_TravelTime']
return miles, driveTime, stopName
... View more
07-12-2023
12:45 PM
|
0
|
1
|
347
|
POST
|
Thanks for the response! I wasn't very clear on our usage specifically, my fault. We used to have all of our AGS published data in webmercator Aux Sphere and so anything programmatically we would run geometries thru projection to our local planar system (WKID 2881) -- ultimately using the calculation for sqFt in the document I originally referenced. that was all fine! I was just curious if there's any updated calculation method as I am currently rebuilding many of our Geoprocessing tools and services for our updated Enterprise/Pro environments. I like having specific ESRI reference to point to, especially as it relates to calculating acreage!
... View more
07-10-2023
01:25 PM
|
1
|
0
|
434
|
POST
|
We have long used THIS recommended conversion calculation to determine acreage within our python implementations when working with SHAPE@AREA for any geometries in webmercator/sq meters or stateplane/sq feet. Is there any updated documentation or ESRI recommendations? It can be a touchy subject and since the above resource is quite old for previous versions of Desktop, I'm just looking to keep current as we migrate to python 3.x and/or the Python API. Thanks!
... View more
07-10-2023
06:40 AM
|
0
|
3
|
466
|
POST
|
Ok looks like the geometries input parameter is not expecting loaded json objects. The solution is to pass in the json.dumps() of the geometries: paramsBuff = {'f': 'json',
'geometries': json.dumps(geomInput),
'inSR': 2881,
'outSR': 2881,
'bufferSR': 2881,
'distances': 250,
'unit': 9003,
'unionResults': 'true',
'geodesic': 'false',
'token': tok
}
... View more
06-19-2023
08:50 AM
|
0
|
0
|
493
|
POST
|
Having some difficulty with a post request to our ArcGIS Server buffer utility endpoint and coming up with this response when executing in python requests, but running the same exact input parameters on the Utilities/Geometry/GeometryServer/buffer REST page it works. Error message: {'error': {'code': 400, 'extendedCode': -2147024809, 'message': 'Invalid or missing input parameters.', 'details': []}} Python script / code: #create 250ft buffer for ROW canal selections
geomInput = {"geometryType": "esriGeometryPolygon", "geometries": [{"rings": ringFeat['rings']}]}
print (geomInput)
queryURL_buff = 'https://somedomain.com/servername/rest/services/Utilities/Geometry/GeometryServer/buffer'
paramsBuff = {'f': 'json',
'geometries': geomInput,
'inSR': 2881,
'outSR': 2881,
'bufferSR': 2881,
'distances': 250,
'unit': 9003,
'unionResults': 'true',
'geodesic': 'false',
'token': tok
}
reqBuff = requests.post(queryURL_buff, data = paramsBuff, verify=False)
responseBuff = json.loads(reqBuff.content) Here's the input Geometries parameter "geomInput", that comes from an initial request to a service layer on published on the same ArcGIS Server site, SR 2881: {'geometryType': 'esriGeometryPolygon', 'geometries': [{'rings': [[[495575.2709925808, 885508.40553274], [495550.90457149595, 882849.2146569043], [494801.263026163, 882859.831105493], [494741.2670831606, 882860.6811694056], [494559.8045195788, 882863.2520304099], [494349.84627807885, 882866.2267619893], [494140.0382987447, 882869.1978846565], [493930.3799254112, 882872.1686792374], [493720.87575124577, 882875.1355368197], [493511.52183924615, 882878.1017382368], [493302.3175332472, 882881.0643307418], [493082.0259790793, 882884.1853874922], [492918.59684399515, 882886.4980469048], [492922.98856749386, 883580.9809099063], [492889.98830541223, 883581.418573074], [492893.9925624952, 884214.7765583247], [492860.99295657873, 884215.2056913227], [492810.41759841144, 884215.8598894924], [492562.22616566345, 884219.0767465755], [492395.6389004141, 884221.2348787412], [492229.02637274563, 884223.3933389932], [491895.8219866641, 884227.7141964883], [491562.6179286614, 884232.0347259045], [491229.4181357473, 884236.3516464084], [491022.93068782985, 884239.0265098214], [490563.0139567442, 884244.9890963212], [490228.3850328289, 884249.3266860768], [489896.68097182736, 884253.6265462413], [489730.08091132715, 884255.7850064933], [489563.4769138284, 884257.9474037364], [489568.5769692473, 884889.7184499055], [489574.1684934944, 885582.6845836565], [492902.3800129108, 885541.4887999073], [495575.2709925808, 885508.40553274]]]}]}
... View more
06-19-2023
05:56 AM
|
0
|
1
|
507
|
Title | Kudos | Posted |
---|---|---|
1 | 08-08-2022 01:40 PM | |
1 | 02-15-2019 08:21 AM | |
2 | 08-14-2023 07:14 AM | |
1 | 07-10-2023 01:25 PM | |
1 | 05-19-2023 08:38 AM |
Online Status |
Offline
|
Date Last Visited |
02-16-2024
07:47 PM
|