How to stop the Point Shape field from being blank

1007
8
10-28-2016 04:18 PM
DougBrowning
MVP Esteemed Contributor

I am having an issue where if someone does not allow the Survey123 app to see location the geopoint is blank.  This means it can not show on any map going forward.  So I can never "see" it anywhere.  It also means it is not visible to Data Drive Pages for some reason and ArcMap complains that shape can not be null.  I know of no way to edit the point location since I can never see it.  Also when I try to edit it in ArcMap Create local copy will never check it out.

Is there a way to set a default location so at least this will not happen again?  How is everyone dealing with this issue?

I did find in testing that if location is turned off the map is blank.  When you open it you must hit Home then move the map.  This is confusing users.

Thanks

Tags (3)
0 Kudos
8 Replies
JamesTedrick
Esri Esteemed Contributor

We addressed the issue of null geometry in Survey123 v1.8 - the client application submits a 0,0 location if it receives no location from the device and the user doesn't provide one manually.  Since you have ArcGIS Desktop, ArcGIS Pro can work with the feature service directly without the need to create a local copy- it's a little awkward, but you can identify the null geometry records by selecting all of the records on the map visually and then switching the selection.  Geometry can be calculated using the 'Calculate Field' with a code block like:

def createPT():
    import arcpy
    sr = arcpy.SpatialReference(4326)
    pnt = arcpy.Point(None, None)
    ptGeo = arcpy.PointGeometry(pnt, sr)
    return ptGeo
0 Kudos
DougBrowning
MVP Esteemed Contributor

That worked thanks.  Are you saying this should not have happened?  I am using 1.8 but it still did that.  Hopefully I can get something like the post below to work.

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Yes, if you are using the 1.8 Survey123 application for collecting the points, you should not have seen null geometries; instead you should have seen points at 0,0.

0 Kudos
DougBrowning
MVP Esteemed Contributor

I can get a default value in the geopoint using the calculation field.  For example "45.637665 -122.671670"

But then it always goes to that point and ignores the GPS.  Can I so something where the GPS is used if it has it but if null it uses a default point?

I have tried

if(${GPS}= '0 0',"45.637665 -122.671670",${GPS})

if(${GPS}= '',"45.637665 -122.671670",${GPS})

with no luck.  Any hints?  Thanks

I am using 1.8.27.

0 Kudos
JamesTedrick
Esri Esteemed Contributor

If you want to provide a default value, you can do so in the 'default' column, using the text string format.  That will prefill the location point.  The user would then need to press the 'Locate Me' button to get a GPS reading.

0 Kudos
DougBrowning
MVP Esteemed Contributor

Default did not work but Calculation did.  Is there a way to ask if 0 then use I default?  I can not get the code to work.

0 Kudos
JamesTedrick
Esri Esteemed Contributor

I'm surprised that default did not work- it's working for me both in Connect and on device.  I've attached a sample that should work.

0 Kudos
DougBrowning
MVP Esteemed Contributor

I found the issue.  If it is in default there are no " " around it but if it is a calculation then you need " ".

I can get this code to work when it is not in the calculation of the field itself

if(${GPS}= '','45.637665 -122.671670','46.616385 -124.491775')

but when i put this if statement in the calculation for the GPS field it does not like that.  Cyclical reference which makes sense.  

I guess I will let it default to 0 0 if that is working now.  I will report back if it keeps getting set to null.

Thanks a lot

 

0 Kudos