@access.user
    @loadmodel(model='item', level=AccessType.WRITE)
    @describeRoute(
        Description('Set geospatial fields on an item.')
        .notes('Set geospatial fields to null to delete them.')
        .param('id', 'The ID of the item.', paramType='path')
        .param('body', 'A JSON object containing the geospatial fields to add.',
               paramType='body')
        .errorResponse('ID was invalid.')
        .errorResponse('Invalid JSON was passed in request body.')
        .errorResponse('Geospatial key name was invalid.')
        .errorResponse('Geospatial field did not contain valid GeoJSON.')
        .errorResponse('Write access was denied for the item.', 403)
    )
    def setGeospatial(self, item, params):
        """
        Set geospatial data on an item.

        :param item: item on which to set geospatial data.
        :type item: dict[str, unknown]
        :param params: parameters to the API call, unused.
        :type params: dict[str, unknown]
        :returns: filtered fields of the item with geospatial data appended to
                 its 'geo' field.
        :rtype : dict[str, unknown]
        :raise RestException: on malformed, forbidden, or unauthorized API call.
        """
        geospatial = self.getBodyJson()

        for k, v in six.viewitems(geospatial):
            if '.' in k or k[0] == '$':
                raise RestException('Geospatial key name %s must not contain a'
                                    ' period or begin with a dollar sign.' % k)
            if v:
                try:
                    GeoJSON.to_instance(v, strict=True)
                except ValueError:
                    raise RestException('Geospatial field with key %s does not'
                                        ' contain valid GeoJSON: %s' % (k, v))

        if item not in GEOSPATIAL_FIELD:
            item[GEOSPATIAL_FIELD] = dict()

        item[GEOSPATIAL_FIELD].update(six.viewitems(geospatial))
        keys = [k for k, v in six.viewitems(item[GEOSPATIAL_FIELD])
                if v is None]

        for key in keys:
            del item[GEOSPATIAL_FIELD][key]

        item = self.model('item').updateItem(item)

        return self._filter(item)
dataset/ETHPy150Open girder/girder/plugins/geospatial/server/geospatial.py/GeospatialItem.setGeospatial/swapped operands of `not in`