|
POST
|
You can’t submit from a single form to multiple feature services, so you can either: 1. Add the project-specific fields to the feature service and create your new survey in Survey123 Connect, pointing the Submission URL to your existing service, but you said you didn’t want to do that, so you could also: 2. Put the project specific fields in a related table or layer within the existing service and put the project-specific fields in a repeat, setting the repeat_count to 1 to disallow multiple submissions. If you like, you can replicate Existing 1-4 in the related table or layer by using calculations within the form. Not ideal, but possible. Or: 3. Write submissions to a new feature service and use the Python API to copy features with just Existing 1-4 back over to your current feature service.
... View more
10-26-2022
10:00 PM
|
1
|
2
|
713
|
|
POST
|
I've configured an ExB app with a search widget that allows users to search for a property development by name or permit number, then populate a Feature Info widget with the popup for the selected result, using a data view for the developments so the map features don't get filtered. Everything works great, except I had to set the search suggestions to 0 because when the user starts to enter another search term, the suggestions immediately show "No results found...", because the layer source has been filtered by the widget. If they press Enter or click the search icon, the correct results are returned because this clears the filter and initiates a new query. Am I just out of luck if I want to have suggestions enabled for successive searches? Users can click the X to clear the results, but this is unintuitive and user testing has shown that they usually don't think to do this, they just highlight the text in the box and start typing a new search term. We basically just want it to work like the WAB search.
... View more
10-23-2022
12:39 PM
|
6
|
11
|
5922
|
|
POST
|
We are trying to publish from crf rasters derived from the grib2 scientific data using arcpy.md.subsetMultidimensionalRaster (subsetting to individual vairables from the grib2).
... View more
06-24-2022
10:17 AM
|
0
|
0
|
1623
|
|
POST
|
Chiming in as the developer working with @JohnLucotch2 on this. We've been successfully publishing several grib2 files twice per day as hosted tiled imagery layers for months, using arcgis.raster.analytics.copy_raster. Since the update last night, publishing is failing with "Generic Server Error". Publishing from grib2 through the ArcGIS Image GUI is also failing with a generic "An error has occurred".
... View more
06-23-2022
10:27 AM
|
0
|
0
|
1708
|
|
POST
|
This is an old thread, but in case anyone comes across it, you can visualize vector field rasters this way in the new Map Viewer and 4.x-based apps, along with Beaufort scale arrows and the flow renderer.
... View more
05-11-2022
12:13 PM
|
0
|
0
|
1534
|
|
POST
|
Shan, Unfortunately, your response did not address my need. The post you linked to is regarding removing attribution on a web app. My question is regarding removing attribution from exported static maps.
... View more
02-24-2022
09:50 AM
|
0
|
0
|
1520
|
|
POST
|
How can I remove attribution from maps exported using the print method in the arcgis.mapping module of the Python API? If you can't do with the Python API, is there a way to do it with ExportWebMap in the REST API? Thanks!
... View more
02-12-2022
12:26 PM
|
0
|
3
|
1592
|
|
POST
|
Just wanted to let you know that this was a huge help to me today. Thanks!
... View more
08-04-2021
03:26 PM
|
0
|
0
|
5222
|
|
POST
|
I'm noticing that my surveys aren't submitting when using a callback to Field Maps, unless I return to Survey123 and let it finish sending. When I tap Send Now, it immediately takes me back to Field Maps but doesn't send the survey. When I return to Survey123, even after several minutes, it sends the survey. So it's like it "pauses" until Survey123 is once again the active application. I'm using the following callback link on iOS. Is there something I'm missing? arcgis-survey123://?itemID=12345678901234567890123456789012&field:site_id={site_id}&field:incoming={parentglobalid}&field:work_request_id={work_request_id}&field:request_date={request_date}&field:revisit_reason={revisit_reason}&callback=https://fieldmaps.arcgis.app
... View more
07-05-2021
06:20 PM
|
0
|
3
|
1745
|
|
DOC
|
Hey Doug, I just used this trick for a project I'm working on. Thanks!
... View more
05-28-2021
12:15 PM
|
0
|
0
|
8467
|
|
POST
|
Revisiting with another potential solution in case anyone stumbles on this. I've been having success creating replicas in "chunks" and exporting the service in smaller pieces, then merging them back together in Pro. import arcgis.features
from arcgis import GIS
import urllib
import json
import wget #you could also use requests if preferred
import sys
###### USER VARIABLES ######
org_url = 'https://your_org.maps.arcgis.com'
username = 'your_username' #admin
password = 'your_pa$$word' #admin
save_directory = "C://pyTest//"
item_ids_to_chunk = ["e9bec92473644fe0b95f2779b9cd5b15",
"e9bec92473644fe0b95f2779b9cd5b15"]
chunk_size = 1000 #adjust as appropriate for your data
############################
feature_iterator = chunk_size
replace_list = [r' ', r'/', r':', r';', '\\', '*', '[', ']', '`', '~', '|', ',', '"', '.']
try:
gis = GIS(org_url, username, password)
print(f"Authenticated for {org_url}")
except:
print(f"Could not authenticate for {org_url}. Check credentials.")
sys.exit()
def sendRequest(request):
response = urllib.request.urlopen(request)
readResponse = response.read()
jsonResponse= json.loads(readResponse)
return jsonResponse
#enable sync and/or extract if necessary so replica can be created
def enableSyncExtract(itemFLC, token):
_item_id = itemFLC.properties.serviceItemId
_item = gis.content.get(_item_id)
_item_url = _item.url
capabilities_initial = itemFLC.properties.capabilities
adm_url = _item_url.replace("/arcgis/rest/services/","/arcgis/rest/admin/services/")
update_url = adm_url.replace("/FeatureServer","/FeatureServer/updateDefinition")
rest = f"{update_url}?token={token}"
if not itemFLC.properties.syncEnabled and not "Extract" in itemFLC.properties.capabilities:
print("Enabling sync and extract")
capabilities = f"{capabilities_initial},Sync,Extract"
syncEnabled = "true"
info = {"updateDefinition": {"capabilities" : capabilities,
"syncEnabled" : syncEnabled},
"f": "json",
"async": "false",
"token": token}
data = urllib.parse.urlencode(info).encode()
req = urllib.request.Request(rest, data=data)
response = sendRequest(req)
return capabilities_initial
elif not itemFLC.properties.syncEnabled and "Extract" in itemFLC.properties.capabilities:
print("Enabling sync")
capabilities = f"{capabilities_initial},Sync"
syncEnabled = "true"
info = {"updateDefinition": {"capabilities" : capabilities,
"syncEnabled" : syncEnabled},
"f": "json",
"async": "false",
"token": token}
data = urllib.parse.urlencode(info).encode()
req = urllib.request.Request(rest, data=data)
response = sendRequest(req)
return capabilities_initial
elif itemFLC.properties.syncEnabled and not "Extract" in itemFLC.properties.capabilities:
print("Enabling extract")
capabilities = f"{capabilities_initial},Extract"
syncEnabled = "true"
info = {"updateDefinition": {"capabilities" : capabilities,
"syncEnabled" : syncEnabled},
"f": "json",
"async": "false",
"token": token}
data = urllib.parse.urlencode(info).encode()
req = urllib.request.Request(rest, data=data)
response = sendRequest(req)
return capabilities_initial
else:
return
#reset sync and/or extract
def inlineSyncExtractReset(capabilities_initial, _id):
_item = gis.content.get(_id)
resetFLC = arcgis.features.FeatureLayerCollection(_item.url, gis)
update_dict = {"capabilities": capabilities_initial}
resetFLC.manager.update_definition(update_dict)
def generateToken():
url = "https://arcgis.com/sharing/rest/generateToken"
data = {'username' : username,
'password' : password,
'referer' : "https://www.arcgis.com",
'f' : 'json'}
request = urllib.request.Request(url, urllib.parse.urlencode(data).encode("utf-8"))
jsonResponse = sendRequest(request)
token = jsonResponse['token']
if token:
print("Token successfully obtained")
return token
else:
print("Could not obtain token. Exiting.")
sys.exit()
token = generateToken()
for _id in item_ids_to_chunk:
item_layers = []
item = gis.content.get(_id)
print(f"\n-------------------------------------------\nStarting chunked backup for {item.title} ({item.id})")
itemFLC = arcgis.features.FeatureLayerCollection(item.url, gis)
try:
capabilities_initial = enableSyncExtract(itemFLC, token)
except:
print(f"Could not verify or enable sync/extract for {item.title} ({item.id}). Exiting.")
sys.exit()
for l in itemFLC.layers:
item_layers.append(l.properties.id)
for t in itemFLC.tables:
if not t.properties.name == 'GDB_ServiceItems':
item_layers.append(t.properties.id)
for layer in item_layers:
chunk = 1
start_record = 0
chunk_size = feature_iterator
get_feature_count_url = f"{item.url}/{layer}/query?where=1%3D1&returnIdsOnly=true&f=pjson&token={token}"
request = urllib.request.Request(get_feature_count_url)
jsonResponse = sendRequest(request)
oid_list = jsonResponse.get('objectIds')
count = max(oid_list)
chunk_mod = count % chunk_size
rest_of_chunks = count - chunk_mod
if chunk_mod == 0:
chunk_count = rest_of_chunks/chunk_size
else:
chunk_count = (rest_of_chunks/chunk_size) + 1
print(f"Exporting {int(chunk_count)} chunks for Layer {layer} of {item.title} ({item.id})\n-------------------------------------------")
while chunk <= chunk_count:
print(f"Exporting Chunk {chunk}: ObjectID {start_record} through {chunk_size}")
layer_query = r'{"' + f'{layer}' + r'":{"where":"OBJECTID BETWEEN' + \
f' {start_record} AND {chunk_size}' + r'"}}'
replicaURL = f"{item.url}/createReplica"
data = {'f': 'json',
'replicaName': item.title.replace(" ", "_"),
'layers': layer,
'layerQueries': layer_query,
'returnAttachments': 'true',
'syncModel': 'none',
'dataFormat': 'filegdb',
'async': 'true',
'token': token}
request = urllib.request.Request(replicaURL, urllib.parse.urlencode(data).encode("utf-8"))
jsonResponse = sendRequest(request)
if not jsonResponse:
print(f"Request for ObjectIDs {start_record} to {chunk_size} failed. Trying again.")
jsonResponse = sendRequest(request)
if not jsonResponse:
print(f"Replica creation failed for {item.title} ({item.id}).\n")
continue
responseUrl = jsonResponse['statusUrl']
url = f"{responseUrl}?f=json&token={token}"
request = urllib.request.Request(url)
jsonResponse = sendRequest(request)
while not jsonResponse.get("status") == "Completed":
if not jsonResponse.get("status") == "Failed":
request = urllib.request.Request(url)
jsonResponse = sendRequest(request)
else:
print(f"Replica creation failed for {item.title} ({item.id}).\n")
continue
jres = jsonResponse['resultUrl']
url = f"{jres}?token={token}"
item_title = item.title
for r in replace_list:
if r in item_title:
item_title = item_title.replace(r, '_')
save_dir = f"{save_directory}{item_title}_{item.id}_layer{layer}_chunk{chunk}.zip"
wget.download(url, save_dir) #you could use requests if preferred
start_record = (chunk * feature_iterator) + 1
chunk_size = (chunk * feature_iterator) + feature_iterator
chunk += 1
if capabilities_initial:
try:
inlineSyncExtractReset(capabilities_initial, _id)
print(f"Capability reset successful")
except:
print(f"***Capability reset failed for {item.title} ({item.id}). Reset manually (original capabilities: {capabilities_initial})***")
... View more
01-20-2021
01:45 PM
|
0
|
0
|
2117
|
|
IDEA
|
We have a Backup Utility desktop application for Windows with a growing customer list, including several large organizations. We don't mind at all giving you a trial even if you don't plan to buy it, and you can at least get a current archive of your org. Hit us up on the ArcGIS Marketplace!
... View more
09-17-2020
10:27 AM
|
0
|
0
|
6166
|
|
POST
|
Oops, I mean Line 8 should be: download_size = requests.get(replica_url, stream=True).headers['Content-length']
... View more
09-15-2020
10:52 AM
|
0
|
0
|
2186
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-24-2024 12:44 PM | |
| 1 | 08-13-2024 11:31 AM | |
| 1 | 02-06-2023 05:52 PM | |
| 1 | 09-05-2020 01:13 PM | |
| 2 | 12-24-2024 11:19 AM |
| Online Status |
Offline
|
| Date Last Visited |
09-16-2025
04:51 PM
|