A container crane includes a movable trolley and a load-carrying frame
pendantly connected to the trolley and comprised of a spreader and a head
block, for transfer of a container from or to a transport vehicle. Plural
optical detectors are mounted on the trolley for identifying longitudinal
and transversal edges of the head block or spreader and the transport
vehicle. Operatively connected to the detectors is a processing device
for determining a spatial position of the edges and calculating a
position of longitudinal and transversal center lines of the head block
or spreader and the transport vehicle and their spatial positions in
relation to one another. In this way a possible offset of the center
lines of the head block or spreader with regard to those of the transport
vehicle in longitudinal and transversal directions as well as a rotation
angle of the center lines can be determined, whereby a detected offset or
rotation angle is compensated by displacing the spreader relative to the
head block.