Is it possible to create fields in FGDB that will automatically populate with lat/long when feature is collected?

6497
19
04-27-2015 11:04 AM
DaveTewksbury
New Contributor III

Wondering if there is a field type that can be set to automatically populate a field with lat and a field with long when a feature is collected using Collector.

Also would like to create a field that creates consecutively numbered stations as they are collected. Looking to have the field essentially be previous station # +1 without having to manually input the number.

Appreciate any thoughts.

thanks

0 Kudos
19 Replies
BenGrod
Occasional Contributor III

Dave, if you can share the geodatabase I'll take a look. I'm sure Miaogeng can help as well but he is the Esri Rep for all things Collector on the GeoNet forum so it might take him longer. Perhaps upload the FGDB to AGOL and share it publicly. If you don't want to or can't share it publicly create a new group, share it to that group, and add me as a member. I'm guessing it is a projection issue but unsure unless I see it.

0 Kudos
DaveTewksbury
New Contributor III

Ben,

Have shared FGDB on AGOL. File is called "Structure Field Trip Stops

<http://hamilton1812.maps.arcgis.com/home/item.html?id=885843205b284eeab79509b6b2aab148>

"

Thanks,

Dave

BenGrod
Occasional Contributor III

Thanks Dave, looking at it now.

0 Kudos
BenGrod
Occasional Contributor III

Hey Dave, it appears that the relationship class is causing the Calculate Geometry tool to be inactive. In order to activate the Calculate Geometry tool you have to begin an edit session. Not sure the exact cause and affect here but I was able to calculate the geometry inside of an edit session within ArcMap. Try it on your end.

0 Kudos
BenGrod
Occasional Contributor III

Dave, I tried putting this into a model which would add the fields and calculate geometry. The model returned a RuntimeError: Objects in this class cannot be updated outside an edit session. If you want to use this data structure and automate the process I believe you will have to write the code in Python, I think you can activate an edit session in Python (someone please correct me if I am wrong). You may find some help by posting a separate discussion in the Python Group to ask for a script to add fields, calculate geometry, and whatever else you might need. Nice working with you and good luck

Error.png

SamuelTompsett
Occasional Contributor II

Hello Dave,

Here is the documentation with step by step instructions on 'Calculate Geometry'.

ArcGIS Help 10.1

Hopefully that helps!

SamuelTompsett
Occasional Contributor II

Try clicking CTRL + SHIFT + G after clicking the field.

0 Kudos
DaveTewksbury
New Contributor III

Sol,

Seems that in order to calculate geometry on the FGDB data requires that

you be in edit mode for the dataset.

From ArcGIS help referenced above

"Start an edit session

<http://resources.arcgis.com/en/help/main/10.1/01m6/01m60000005p000000.htm>.

1.

You can make calculations without being in an editing session; however,

in that case, there is no way to undo the results."

This is not appear to be completely true for a FGDB. If you are in an

editing session for the FGDB data, Calculate Geometry is available. If you

are not in an edit session, it is grayed out. Shapefiles have Calculate

Geometry available if you are or are not in an edit session for the data.

Thanks, learned something new.

0 Kudos
BenGrod
Occasional Contributor III

Dave, if you disable the relationship class in your geodatabase you can calculate geometry outside of an edit session, I tested this out. The relationship class is your limitation in this scenario.

DaveTewksbury
New Contributor III

Thanks Ben

Had not thought about that.

Dave

0 Kudos