Uber Technologies Inc. sued the Los Angeles Department of Transportation on Tuesday, escalating a monthslong disagreement over the city’s data-collection efforts.

Uber has been sparring with the city’s transportation authority over a rule that requires that it share real-time location data for its dockless scooters.

City officials have said...