|
BLOG
|
They are in the geodatabase still. I am guessing you want the images exported to the file system as a .jpg file old school style? If so there is no way to do that except for a script. See this post https://community.esri.com/groups/survey123/blog/2017/03/22/working-with-your-survey123-photos and this one https://support.esri.com/en/technical-article/000011912
... View more
03-28-2018
02:19 PM
|
0
|
0
|
24813
|
|
POST
|
I was afraid of that. Well my day just got longer. Thanks for the response BTW the kinda fix was to have my Domain codes and description the same. At least I did not have to start all over...so far.
... View more
03-28-2018
10:31 AM
|
0
|
0
|
1823
|
|
POST
|
I am passing fields from Collector to Survey123 using the URL format arcgis-survey123://?itemID={SoilStabilityForm}&field:Office={Office}&field:PlotID={PlotID}&field:PlotKey={PlotKey} The problem is that it is passing the Domain Description instead of the Domain Code for Office - which breaks all my constraints. Is there a way to pass the Domain Code instead of the Description? Thanks
... View more
03-28-2018
09:46 AM
|
0
|
3
|
1920
|
|
BLOG
|
Not sure what you mean by attribute my class? But you do need matching IDs in both FCs. Let me try a bit more. Collector FC - lets call it Plots - has a field called ID Survey123 FC - lets call it Plants - has a field called ID (or any name really just same data type) Both of these are in the same GDB Right click on gdb in Catalog and say New - Relationship class Give it a name Select the Collector FC in the Origin section and the Survey123 FC in the Destination Keep the defaults on the next few pages Give it a label for each direction (like Plots and Plants) Select 1 - M Set the two fields to join on You should now see the class in the gdb. At this point you can test it in ArcMap. Add ALL the layers to ArcMap then publish as a service In AGO create a new map and add the service you just published. Note you MUST re-ad the service after adding the relationship class or it will not work. You should now see the relate in the AGO map and also collector. To prefill the Form with the ID from collector use the URL thing like this arcgis-survey123://?itemID={PlotCharForm}&field:SiteKey={SiteKey}&field:PlotKey={PlotID} So you are manually setting the keys in both places - the relationship class just picks up on it. Hope that helps.
... View more
03-27-2018
01:29 PM
|
0
|
0
|
12430
|
|
BLOG
|
This happened to me at first and it was caching. The webmap was not updating the attribute table with out a shift refresh. It kept caching the attribute table on me. Start there. Then look to see if your survey123 form data is actually getting into the FC. If it is there then your relationship class may be off. That is all I can think of. I had trouble with the URL at first but I think you did it right. Did you republish after changing the URL? Are access rights to the new HFS correct? Rights on the form also.
... View more
03-27-2018
11:37 AM
|
0
|
0
|
12430
|
|
BLOG
|
Yes just go to the item page for the feature service and click Export Data (this is what the script simulates). If you do not see this button then go to Setting for the item and check Allow others to Export different formats.
... View more
03-27-2018
07:01 AM
|
1
|
0
|
24813
|
|
BLOG
|
I used this flow. Maybe it will work for you. Create the form and publish. Download the form feature service as a gdb. Create a new GDB in catalog - this holds your collector features. Add the FS that collector is going to use (point, line, whatever). Add a key field to the collector class then pass this value to Survey123 (like you have been doing). Copy the Survey123 FC you downloaded into the collector gdb. Create a Relationship class from the Collector FC to the Survey123 FC. Publish this gdb as a service. Go into the Survey123 form and set the submission_url to the new HFS you just published. Republish the form. Now you can add the collector service to a map and all the relationship classes come along. Now you have your collector features connected to your forms. Forms to lines or polygons or whatever does not matter. I have this working with 9 forms/9 relationships classes and works great. I can list all the forms for a feature or open a form and backtrack to the feature. Plus if you export the HFS to a GDB all the relationships classes come with it. They also works in ArcMap when connecting to the HFS directly. Oh and you can even see the linked forms in Collector - even other peoples forms! Also what I did was add a field called XForm and put the item id in that field. Then in the collector map I can use that field to construct the URL. It then launches and prefills in the "Key" field you decided to use. This way you can actually mix and match forms if you want. Say 2017 features link to the 2017 form but the 2018 features link to the 2018 form. Hope that makes sense and helps you.
... View more
03-26-2018
01:39 PM
|
0
|
0
|
12430
|
|
BLOG
|
Bret if you look above I had posted a way to download using ArcRest instead. It downloads a full gdb with all relationships classes and photos. Note you must install ArcRest python package first. What I left out was the code to rename the file after download. I also added code here to unzip the file downloaded and then you can rename the gdb (or just ask the zip file\os what it contains and use that - os.listdir - use this as your gdb name). this unzip code is a little diff due to .gdb file type. Hope it helps set the un and pass plus out dir ---download gdb import arcrest
from arcresthelper import securityhandlerhelper
from arcresthelper import common
import os, time
HFSScope=[]
def trace():
"""
trace finds the line, the filename
and error message and returns it
to the user
"""
import traceback, inspect, sys
tb = sys.exc_info()[2]
tbinfo = traceback.format_tb(tb)[0]
filename = inspect.getfile(inspect.currentframe())
# script name + line number
line = tbinfo.split(", ")[1]
# Get Python syntax error
#
synerror = traceback.format_exc().splitlines()[-1]
return line, filename, synerror
if __name__ == "__main__":
proxy_port = None
proxy_url = None
securityinfo = {}
securityinfo['security_type'] = 'Portal'#LDAP, NTLM, OAuth, Portal, PKI
securityinfo['username'] = "un"#<UserName>
securityinfo['password'] = "pass"#<Password>
securityinfo['org_url'] = "http://www.arcgis.com"
securityinfo['proxy_url'] = proxy_url
securityinfo['proxy_port'] = proxy_port
securityinfo['referer_url'] = None
securityinfo['token_url'] = None
securityinfo['certificatefile'] = None
securityinfo['keyfile'] = None
securityinfo['client_id'] = None
securityinfo['secret_id'] = None
# Assumes a config script that has FriendlyName, ItemID
path, script = os.path.split(os.path.realpath(__file__))
Config = path.replace('\Scripts','\Config')+'\\'+'BackupAllAGOHFS.txt'.replace("/", "\\")
# where to save the zip files
savePath = r"c:\save"
# read in the config file for list of HFS for Survey123
BackupAllAGOHFSConfigFile = open(Config, 'r')
HFSList = BackupAllAGOHFSConfigFile.read().splitlines()
BackupAllAGOHFSConfigFile.close()
for HFS in HFSList:
HFSname = HFS.split(",")[0]
itemId = HFS.split(",")[1] # this now comes from the main AGO page with all the settings.
# example itemId = "5a9ecdf30f53466bad14f5dbbedb1014" http://co.maps.arcgis.com/home/item.html?id=d92ed61e72cb49fd9142fc1817487379
if len(HFSScope)==0 or HFSname in HFSScope:
try:
shh = securityhandlerhelper.securityhandlerhelper(securityinfo=securityinfo)
if shh.valid == False:
print shh.message
else:
print HFSname
admin = arcrest.manageorg.Administration(securityHandler=shh.securityhandler)
item = admin.content.getItem(itemId)
user = admin.content.users.user(username=item.owner)
# use to set jsut some layers. NOT using this
## exportParameters = {"layers":[
## {
## "id": 0,
## "where": "OBJECTID = 1"
## }]
## }
# this version waits for the download so no pause needed
res = user.exportItem(title=HFSname,
itemId=itemId,
exportFormat="File Geodatabase",
exportParameters=None,
wait=True)
exportItemId = res.id
exportItem = admin.content.getItem(exportItemId)
itemDataPath = exportItem.itemData(f=None, savePath=savePath)
# Delete from AGO list to remove clutter
exportItem.userItem.deleteItem()
print "Backed up " + HFSname + " to " + itemDataPath
# rename file so it makes sense
renameFile = os.path.dirname(itemDataPath) + "\\" + HFSname + " Backup " + time.asctime().replace(':', '-') + ".zip"
os.rename(itemDataPath, renameFile)
except (common.ArcRestHelperError),e:
print "error in function: %s" % e[0]['function']
print "error on line: %s" % e[0]['line']
print "error in file name: %s" % e[0]['filename']
print "with error message: %s" % e[0]['synerror']
if 'arcpyError' in e[0]:
print "with arcpy message: %s" % e[0]['arcpyError']
except:
line, filename, synerror = trace()
print "error on line: %s" % line
print "error in file name: %s" % filename
print "with error message: %s" % synerror
----download -----unzip # use this to unzip a zip file that had a .gdb in it
def unzip(path, zipFile):
# If the output location does not yet exist, create it
#
if not isdir(path):
os.makedirs(path)
zip = zipfile.ZipFile(zipFile, 'r')
for each in zip.namelist():
print "Attempting unzip"
arcpy.AddMessage("Extracting " + os.path.basename(each) + " ...")
# Check to see if the item was written to the zip file with an
# archive name that includes a parent directory. If it does, create
# the parent folder in the output workspace and then write the file,
# otherwise, just write the file to the workspace.
#
if not each.endswith('/'):
print "Splitting files"
root, name = split(each)
directory = normpath(join(path, root))
if not isdir(directory):
os.makedirs(directory)
print "Writing files"
file(join(directory, name), 'wb').write(zip.read(each))
print "Successful Unzip"
outdir = r"C:\temp"
zipfile = r"C:\temp\file.zip"
unzip(outDir, zipfile)
... View more
03-14-2018
10:47 AM
|
1
|
0
|
24813
|
|
POST
|
Can you do any calculations in the Print Template? Or does any calc need to be in the form first? Mainly I want to do math across a repeat. Thanks
... View more
03-05-2018
01:45 PM
|
0
|
1
|
2642
|
|
POST
|
So i guess you cannot use Counts and Amounts symbology. Collector (and my esri stack app) can only render simple symbols. So I changed to a unique values list and then set the colors like a color ramp. My data is chunks so it worked but a bummer for sure. Does not look as nice.
... View more
12-15-2017
12:42 PM
|
0
|
0
|
1385
|
|
POST
|
My map looks like this But ALL points in collector are a light grey? Anyone know why? Note it is a Feature layer that was created by a AGO join. I then went into the created layer, went to the Visualization tab and changed it. Then added to a webmap. Webmap looks fine. Funny thing is my other program is doing the same thing. Thanks
... View more
12-15-2017
10:59 AM
|
0
|
3
|
1773
|
|
POST
|
The UI was just a text box that asked for a jobname and a drop down of map names. (It was actually just the Geoprocessing widget straight up with no code chance.) That jobname and mapname is sent to the server where it runs a python script. That script simply opens the map they asked for, calls ddp.exportToPDF(pdfName, "RANGE", str(i)) then sends a link to that pdf back to the user.
... View more
12-13-2017
04:13 PM
|
1
|
1
|
4270
|
|
DOC
|
My post is buried back from Jul 3 but have you tried this method? It has worked perfectly for me since July. This way is equivalent to doing a Export Data from the Item page in AGO (the one with all the settings and such). **So you may want to do the Export manually first to see if this works on your data. First you need the Item ID of the HFS - get this from the top of the Item page in AGO. You want the last part after id= URL looks like http://xxx.maps.arcgis.com/home/item.html?id=46954aa9bfb24c53bba320f363af8550 Then I slightly modified the ArcRest sample script called create_replica_portal_item.py (in other words some of this is not my code) ArcREST/create_replica_portal_item.py at master · Esri/ArcREST · GitHub LOOK for the caps on what to change Note the post messed up all the indents - i tried to fix but may be off import arcrest from arcresthelper import securityhandlerhelper from arcresthelper import common import os, time def trace(): """ trace finds the line, the filename and error message and returns it to the user """ import traceback, inspect, sys tb = sys.exc_info()[2] tbinfo = traceback.format_tb(tb)[0] filename = inspect.getfile(inspect.currentframe()) # script name + line number line = tbinfo.split(", ")[1] # Get Python syntax error # synerror = traceback.format_exc().splitlines()[-1] return line, filename, synerror if __name__ == "__main__": proxy_port = None proxy_url = None securityinfo = {} securityinfo['security_type'] = 'Portal'#LDAP, NTLM, OAuth, Portal, PKI securityinfo['username'] = "PUT USERNAME HERE" #<UserName> securityinfo['password'] = "PUT PASSWORD HERE" #<Password> securityinfo['org_url'] = "http://www.arcgis.com" securityinfo['proxy_url'] = proxy_url securityinfo['proxy_port'] = proxy_port securityinfo['referer_url'] = None securityinfo['token_url'] = None securityinfo['certificatefile'] = None securityinfo['keyfile'] = None securityinfo['client_id'] = None securityinfo['secret_id'] = None # where to save the zip files savePath = r"PUT OUTPUT DIR HERE" itemId = "PUT ITEM ID HERE" #sample itemId = "5a9ecdf30f53466bad14f5dbbedb1014" try: shh = securityhandlerhelper.securityhandlerhelper(securityinfo=securityinfo) if shh.valid == False: print shh.message else: admin = arcrest.manageorg.Administration(securityHandler=shh.securityhandler) item = admin.content.getItem(itemId) user = admin.content.users.user(username=item.owner) # use to set jsut some layers. NOT using this ## exportParameters = {"layers":[ ## { ## "id": 0, ## "where": "OBJECTID = 1" ## }] ## } # this version waits for the download so no pause needed res = user.exportItem(title=HFSname, itemId=itemId, exportFormat="File Geodatabase", exportParameters=None, wait=True) exportItemId = res.id exportItem = admin.content.getItem(exportItemId) itemDataPath = exportItem.itemData(f=None, savePath=savePath) # Delete from AGO list to remove clutter exportItem.userItem.deleteItem() # rename file so it makes sense #taken out for ease except (common.ArcRestHelperError),e: print "error in function: %s" % e[0]['function'] print "error on line: %s" % e[0]['line'] print "error in file name: %s" % e[0]['filename'] print "with error message: %s" % e[0]['synerror'] if 'arcpyError' in e[0]: print "with arcpy message: %s" % e[0]['arcpyError'] except: line, filename, synerror = trace() print "error on line: %s" % line print "error in file name: %s" % filename print "with error message: %s" % synerror Let me know how it goes.
... View more
11-30-2017
08:26 AM
|
0
|
0
|
18682
|
|
POST
|
Nope I just gave up on it. Never had much success with any Esri charts really.
... View more
10-12-2017
02:30 PM
|
0
|
1
|
1476
|
|
POST
|
First make sure it is WGS 84 Web Aux not one of the other 4 WGS 84s. I have a bug in on the Export Tile Cache tool. It messes up the .xml a bit. ArcMap can handle the issue but in my mobile app they do not work. For custom scales this is hard to get around. Maybe that is it?
... View more
09-29-2017
03:47 PM
|
0
|
0
|
1994
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-10-2026 08:18 AM | |
| 1 | 2 weeks ago | |
| 1 | 3 weeks ago | |
| 1 | 3 weeks ago | |
| 1 | a month ago |
| Online Status |
Offline
|
| Date Last Visited |
Thursday
|