@access.user
    @describeRoute(
        Description('Create new items from a GeoJSON feature or feature'
                    ' collection.')
        .param('folderId', 'The ID of the parent folder.', required=True,
               paramType='query')
        .param('geoJSON', 'A GeoJSON object containing the features or feature'
                          ' collection to add.', required=True,
               paramType='query')
        .errorResponse()
        .errorResponse('Invalid GeoJSON was passed in request body.')
        .errorResponse('GeoJSON feature or feature collection was not passed in'
                       ' request body.')
        .errorResponse("GeoJSON feature did not contain a property named"
                       " 'name'.")
        .errorResponse('Property name was invalid.')
        .errorResponse('Write access was denied on the parent folder.', 403)
        .notes("All GeoJSON features must contain a property named 'name' from"
               " which the name of each created item is taken.")
    )
    def create(self, params):
        """
        Create new items from a GeoJSON feature or feature collection. All
        GeoJSON features must contain a property named 'name' from which the
        name of each created item is taken.

        :param params: parameters to the API call, including 'folderId' and
                       'geoJSON'.
        :type params: dict[str, unknown]
        :returns: filtered fields of the created items with properties appended
                 to the 'meta' field and geospatial data appended to the 'geo'
                 field of each item.
        :rtype: list[dict[str, unknown]]
        :raise RestException: on malformed, forbidden, or unauthorized API call.
        """
        self.requireParams(('folderId', 'geoJSON'), params)

        try:
            geospatial = bson.json_util.loads(params['geoJSON'])
            GeoJSON.to_instance(geospatial, strict=True)
        except ValueError:
            raise RestException('Invalid GeoJSON passed in request body.')

        if geospatial['type'] == 'Feature':
            features = [geospatial]
        elif geospatial['type'] == 'FeatureCollection':
            features = geospatial['features']
        else:
            raise RestException('GeoJSON feature or feature collection must be '
                                'passed in request body.')

        data = []

        for feature in features:
            properties = feature['properties']
            if 'name' not in properties:
                raise RestException("All GeoJSON features must contain a"
                                    " property named 'name'.")
            name = properties['name']
            del properties['name']
            if 'description' in properties:
                description = properties['description']
                del properties['description']
            else:
                description = ''

            for key in properties:
                if not len(key):
                    raise RestException('Property names must be at least one'
                                        ' character long.')
                if '.' in key or key[0] == '$':
                    raise RestException('The property name %s must not contain'
                                        ' a period or begin with a dollar'
                                        ' sign.' % key)

            data.append({'name': name,
                         'description': description,
                         'metadata': properties,
                         'geometry': feature['geometry']})

        user = self.getCurrentUser()
        folder = self.model('folder').load(
            id=params['folderId'], user=user, level=AccessType.WRITE, exc=True)

        items = []

        for datum in data:
            newItem = self.model('item').createItem(
                folder=folder, name=datum['name'], creator=user,
                description=datum['description'])
            self.model('item').setMetadata(newItem, datum['metadata'])
            newItem[GEOSPATIAL_FIELD] = {'geometry': datum['geometry']}
            newItem = self.model('item').updateItem(newItem)
            items.append(newItem)

        return [self._filter(item) for item in items]
dataset/ETHPy150Open girder/girder/plugins/geospatial/server/geospatial.py/GeospatialItem.create/original