Zum Hauptinhalt gehen

Set a feature's geometry to null

Kommentare

4 Kommentare

  • Permanently deleted user

    I'm pretty sure that the delete operator works for this, but you may be unable to load features with null geometries to your service so be aware of that.

     

    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete

    0
  • Permanently deleted user

    Hi Jostein,

     

    Just to clarify, are you:

    • looking to remove a geometry from a feature that you're displaying from the workflow only (eg, using graphics layers, markup, highlighting, etc)?
    • looking to temporarily stop drawing a particular feature's that's shown by the viewer because the layer is included in the site? (eg, use "Set Layer Definition Expression" to put a filter on the layer)
    • looking to propagate that change to the feature stored in ArcGIS Server? (clear the geometry, but keep the attributes for that feature)

     

    0
  • Jostein Svegården

    The last point. I want to update the row by removing the geometry, but keeping the record and attributes

    0
  • Permanently deleted user

    Hi Jostein,

     

    If it's a point feature, try using the Set Property activity to update it's geometry's x value to "NaN".

    Eg.

    Set Property-

    Object: =$query1.feature.geometry

    Property: x

    Property Value: ="NaN"

     

    Then use the Update Features activity to send those changes. That seems to work on my end. Make sure your initial query fetches the OBJECTID field, so it knows which feature to apply the change to.

     

    I'm following from the "empty point" example described on https://developers.arcgis.com/documentation/common-data-types/geometry-objects.htm#POINT

     

     

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.