parameters: (self, request:Request, project_id, landmark_id)
return_statement: return Response({
              'link_id': pci.id,
              'point_id': point.id,
              'landmark_id': landmark.id
          })
docstring: Add a new location or use an existing one and link it to a landmark.
  
          Either (x,y,z) or location_id have to be provided.
          ---
          parameters:
            - name: project_id
              description: Project of landmark group
              type: integer
              paramType: path
              required: true
            - name: landmark_id
              description: The landmark to link
              type: integer
              paramType: path
              required: true
            - name: location_id
              description: Optional existing location ID
              type: integer
              required: false
            - name: x
              description: Optional new location X coodinate
              type: float
              required: false
            - name: y
              description: Optional new location Y coodinate
              type: float
              required: false
            - name: z
              description: Optional new location Z coodinate
              type: float
              required: false
docstring_summary: Add a new location or use an existing one and link it to a landmark.
docstring_tokens: Add a new location or use an existing one and link it to a landmark .
function: def put(self, request:Request, project_id, landmark_id) -> Response:
          """Add a new location or use an existing one and link it to a landmark.
  
          Either (x,y,z) or location_id have to be provided.
          ---
          parameters:
            - name: project_id
              description: Project of landmark group
              type: integer
              paramType: path
              required: true
            - name: landmark_id
              description: The landmark to link
              type: integer
              paramType: path
              required: true
            - name: location_id
              description: Optional existing location ID
              type: integer
              required: false
            - name: x
              description: Optional new location X coodinate
              type: float
              required: false
            - name: y
              description: Optional new location Y coodinate
              type: float
              required: false
            - name: z
              description: Optional new location Z coodinate
              type: float
              required: false
          """
          location_id = request.data.get('location_id')
          x = float(request.data.get('x'))
          y = float(request.data.get('y'))
          z = float(request.data.get('z'))
          if location_id and (x or y or z):
              raise ValueError("Please provide either location ID or coordinates")
          landmark = ClassInstance.objects.get(project_id=project_id, pk=int(landmark_id))
  
          if location_id:
              point = Point.objects.get(project_id=project_id, pk=location_id)
          else:
              # Create new point
              point = Point.objects.create(project_id=project_id, user=request.user,
                      editor=request.user, location_x=x, location_y=y, location_z=z)
  
          pci = PointClassInstance.objects.create(point=point,
                  user=request.user, class_instance=landmark,
                  project_id=project_id, relation=Relation.objects.get(
                      project_id=project_id,
                      relation_name="annotated_with"))
  
          return Response({
              'link_id': pci.id,
              'point_id': point.id,
              'landmark_id': landmark.id
          })
function_tokens: def put ( self , request : Request , project_id , landmark_id ) -> Response : location_id = request . data . get ( 'location_id' ) x = float ( request . data . get ( 'x' ) ) y = float ( request . data . get ( 'y' ) ) z = float ( request . data . get ( 'z' ) ) if location_id and ( x or y or z ) : raise ValueError ( "Please provide either location ID or coordinates" ) landmark = ClassInstance . objects . get ( project_id = project_id , pk = int ( landmark_id ) ) if location_id : point = Point . objects . get ( project_id = project_id , pk = location_id ) else : # Create new point point = Point . objects . create ( project_id = project_id , user = request . user , editor = request . user , location_x = x , location_y = y , location_z = z ) pci = PointClassInstance . objects . create ( point = point , user = request . user , class_instance = landmark , project_id = project_id , relation = Relation . objects . get ( project_id = project_id , relation_name = "annotated_with" ) ) return Response ( { 'link_id' : pci . id , 'point_id' : point . id , 'landmark_id' : landmark . id } )