|
POST
|
When I've had issues of fields being deleted/reset, I've found the issue in the JSON file using the REST API. Typically, when you change the feature type (the symbology), it will follow a template prototype in the "types" section of the JSON file. Often a field using a domain will be set to some value instead of being inherited. In the example below, line 7 and 8, DomainOne and DomainTwo should be inherited. Instead, if the feature type is changed from FeatureTypeTwo to FeatureTypeOne, the template section replaces certain attributes with the values shown in lines 17 through 21. If the value of the attribute is null such as FieldOne and FieldTwo, line 17 and 18, the value of those fields should retain the previous value. For the fields using DomainOne and DomainTwo, lines 19 and 20, the value will be changed to a space in this example, thus deleting the previous value. Changing the "double quote, space, double quote" to the word "null" should allow a previous value in that field to be properly inherited. If such an issue is causing your problems, you can update the JSON file. Should you need to update the file, I can share some tips. "types" : [
{
"id" : "FeatureTypeOne",
"name" : "Feature Type Name",
"domains" :
{
"DomainOne" : {"type" : "inherited"},
"DomaineTwo" : {"type" : "inherited"}
},
"templates" : [
{
"name" : "Feature Type Name",
"description" : "",
"drawingTool" : "esriFeatureEditToolPoint",
"prototype" : {
"attributes" : {
"FieldOne" : null,
"FieldTwo" : null,
"DomainOne" : " ",
"DomainTwo" : " ",
"MyFeature" : "FeatureTypeOne"
}
}
}
]
},
{
"id" : "FeatureTypeTwo",
....
... View more
06-25-2015
02:27 PM
|
2
|
0
|
1035
|
|
POST
|
As a short follow up, I copy the text file created by the python script into jsonlint.com and verify the code. If it checks out, I will then use it to update my feature with the REST API.
... View more
06-25-2015
12:04 PM
|
1
|
0
|
1447
|
|
POST
|
RTC, Thanks for the javascript link. I started looking for a python method of sorting the 'types' section of the JSON file and updating it using the REST API. The python code is here: Feature type sort order in REST API using Python I think using the REST API is the best solution to this issue, and python can help.
... View more
06-25-2015
11:57 AM
|
0
|
2
|
2925
|
|
POST
|
I have been working on an issue with Collector and the dropdown box that changes the feature type. Although I carefully sort the domain used for feature types, it always seems to get published with a jumbled order. This can be corrected using the Manage New Features section of AGOL, but this can be tedious and can cause other problems. My best solution was to update the REST API JSON file. See discussion here: Feature type sort order in drop-down list I have since been working on a python script to extract the "types" section of the JSON file, reorder the section and print a text file that can be used in the process. The following script does that. I was just wondering if others had worked on this problem and what solutions they came up with. Any comments on the script are also appreciated (since I'm still learning python). import json
import collections
# set up input and output files
# input comes from ArcGIS Online REST API JSON file
input_file=open('unordered_types.json', 'r')
output_file=open('ordered_types.json', 'w')
# read 'types' section of input file
# UTF-8 BOM: file starts with \xef\xbb\xbf
# Windows may add BOM, which needs to be removed
result = json.loads(input_file.read().decode("utf-8-sig").encode("utf-8"),
object_pairs_hook=collections.OrderedDict)[u'types']
# sort result dictionary by 'id' key
ordered = sorted(result,key=lambda x:x['id'])
# if console output is desired, uncomment next line
# print json.dumps(ordered, indent=4, sort_keys=False)
# convert ordered dictionary back to JSON
back_json=json.dumps(ordered)
# add 'types' to make completed JSON file for REST API
output_file.write('{ "types" : ' + back_json + ' }')
# close output file
output_file.close()
print 'Done.'
... View more
06-25-2015
11:53 AM
|
0
|
1
|
5505
|
|
POST
|
Matthew: It might be possible to just renumber, but the numbers you would be changing are the coded values. If you are thinking of editing the JSON file here are my suggestions. Work with a copy of your data and back up your original. Work with only sections of the JSON file. There is a bug when making changes to the drawingInfo section; the contentType gets set to null. Use jsonlint.com to check validity. Since I have not used subtypes, I cannot advise on this point. For the types section, copy this to a text editor. Enclose the section with curly brackets for valid JSON. I would probably move sections, but you may try renumbering if the types are fairly simple. There will be an ID which is the number you are thinking of changing. There will be a related template section and you will see the same number there. The template section controls what happens when you change types. Values here that are null are inherited; other values may interact with subtypes. You will also see your coded value in this section. Again, test on a backup copy before changing your original data. Hope this helps.
... View more
06-18-2015
09:30 AM
|
0
|
0
|
833
|
|
POST
|
RTC, Sounds like we are using the same basic approach. I haven't explored subtypes yet. Ben in his comment mentioned using the domain sorting tool, and I highly recommend using it. I had been looking for the easiest spot to fix the sorting in regards to adding new features. It seems to me that using the REST API is the best place to do it. Your link to jsfiddle looks like an interesting tool to help sort the Types section of the JSON file. And before making updates, I recommend jsonlint.com for JSON validation. When I used the Manage New Features in ArcGIS Online, I found that the contentType in the drawingInfo section was being changed from image/png to null. When contentType gets set to null, the layer is no longer downloadable in Collector for off-line use. The layer will still work in Collector for on-line use. ESRI support is aware of this issue; their response: " This anomaly can be classified as an ArcGIS Online where the AGOL changes the "contentType" in the symbology description to <null>. Essentially, this leads to the symbology contentType defined as null in the offline geodatabase and as such the Collector for ArcGIS fails to read and assimilate the features." For fixing the feature template order, I would recommend using the REST API and just updating the Types section only. Using the whole JSON file, particularly the DrawingInfo section, has, in my experience, causes the contentType null problem, which you would want to avoid. Experimenting with a copy of your layer and making backups is also recommended. RTC and Ben, I appreciated receiving your comments. Thank you.
... View more
06-11-2015
12:44 PM
|
0
|
6
|
2923
|
|
POST
|
Here's a possible fix for you. In AGOL My Content, go to your map and open it in ArcMap. This should bring in your map with symbols in desktop. It seems that only the Collector off-line database is affected. Click on a your layer and save is as a layer file. We're saving the symbols here. Export your layer to a local geodatabase. You can bring it into the map just to see if the points line up, if you like. Open an new map, without saving any changes. Add the layer that was just exported. Open the layer properties and import the symbology that was exported as a layer file. It should now look similar to your original map but without any background. Publish it is as a new service, and replace your old layer in your online map with this one. You may wish to create a new map instead, so the old one can be used for reference. If you need to tweak your layers, check the JSON file to see if the contentType remains intact. Hope this helps.
... View more
06-11-2015
06:23 AM
|
2
|
0
|
650
|
|
POST
|
I received this from ESRI support: "This anomaly can be classified as an ArcGIS Online where the AGOL changes the "contentType" in the symbology description to <null>. Essentially, this leads to the symbology contentType defined as null in the Offline geodatabase and as such the Collector for ArcGIS fails to read and assimilate the features."
... View more
06-10-2015
04:36 PM
|
1
|
0
|
1786
|
|
POST
|
When that happens, the only way I've found is to republish the layer. In my case, the contentType was set to null after I tried to do some reordering of the symbols using Manage New Features in AGOL. That is: Edit ( between the Add and Basemap menu) >> Manage >> then moving the items up or down. It is possible to change this order by updating the JSON file and avoid the contentType change. I have not been able to update the drawingInfo section of the JSON file as this also seems to set the contentType to null. In your case, I would suggest republishing your layer. Then check the service url to see what it says for contentType. Add the layer to a new map, and before making any tweaks, see if it works both on and off-line. Then work through your map adjustments making frequent checks with the service url to see if and where the contentType is getting changed. If you can identify the step, then maybe a work around could be found. I do have a support request in, so I may have more information later.
... View more
06-10-2015
01:11 PM
|
0
|
1
|
1786
|
|
POST
|
I am working on a similar problem. Do you know how to look at the ArcGIS REST Services page for your layer? My Content >> layer file >> in Layers, click the link showing the layer name or click on the triangle button and select Service URL. On the service url page, you will see a section for Drawing Info. Search for "contentType" - typically it says "image/png". But with the problem you are suggesting, I suspect it will show a null (two back to back double quotes).
... View more
06-10-2015
12:02 PM
|
0
|
3
|
1786
|
|
POST
|
The behavior you describe suggests that the values are being replaced per a template instead of being inherited. If you get a warning message about changing feature types and deleting data, this would indicate such a situation. I would suggest looking at the REST services (Service URL) - from My Content, click on the layer; in the Layers section you will find a link to the service url. Look at any Templates that might show up. All domains should say inherited.
... View more
06-10-2015
11:14 AM
|
0
|
2
|
1035
|
|
POST
|
It appears that ArcGIS Online maps use the domain sort from the database's settings to populate the dropdown. However, Collector seems to use an unsorted list from Online's "Edit-Add Features" section. Using the manage button (Manage New Features), I can move the items in the list up or down, eventually matching the domain sorting. I can also go in and edit the "Types" in the JSON file to reorder the list. When using ether method, Collector uses the new sorting in the dropdown. However, the map can no longer be downloaded for off-line work. In Android it looks like the layer has been turned off. For iOS it seems to dump back to the map index. When I look at the JSON file, I notice that the "drawingInfo" item of "contentType" has changed from "contentType":"image/png" to "contentType":"". This happens when the order is changed with online's Manage button or by updating the JSON file. Is there an issue with contentType being set to null?
... View more
06-08-2015
05:39 PM
|
0
|
4
|
2924
|
|
POST
|
Before uploading any map, I always use the sort coded value domain tool on all the databases' domains. This keeps things sorted everywhere except when the domain is used to identify the feature type. I can go to the "Edit - Manage New Features" in ArcGIS Online and rearrange the order, but I haven't found where the sort order is getting messed up or where it can be fixed in ArcMap. I have used the REST API to fix the order, but I think I would rather do it in ArcMap.
... View more
06-05-2015
03:34 PM
|
0
|
0
|
2925
|
|
POST
|
In a feature class, I have a field that controls the feature type and, therefore, the symbology. This field uses a coded-value domain list that is carefully sorted. I can get the legend to use the domain sorting without difficulty. The difficulty in sorting comes with the drop-down menu in Collector where the user changes the feature type. When I create a new feature and add it to a new ArcGIS on-line map, I end up having to go into the “Edit - Manage New Features” and reorder items to get the drop-down list in the same order as the legend - this can be tedious if there are many feature types. I have also used the REST API to reorder the types - this is quicker, but could create other problems. Can this reordering be done in ArcMap when the feature class is created?
... View more
06-04-2015
06:05 PM
|
0
|
15
|
10723
|
|
POST
|
When you create the table, set "allow nulls" to "no" for fields using domains and the "no value" will not be displayed in the drop-down.
... View more
06-03-2015
07:32 PM
|
1
|
0
|
842
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-27-2016 02:23 PM | |
| 1 | 09-09-2017 08:27 PM | |
| 2 | 08-20-2020 06:15 PM | |
| 1 | 10-21-2021 09:15 PM | |
| 1 | 07-19-2018 12:33 PM |
| Online Status |
Offline
|
| Date Last Visited |
09-15-2025
02:54 PM
|