Off course there is a dress code of every country and short skirts are not considered a decent dress in the public.

Regarding the presentation of ID from the police officer i think he should present a police ID card but it may not be must as well. Here in Qatar a police officer is quickly recognised as they are very thin and not tall :-).