Determining Map Extent

Hi there,
I’ve:

  1. Exported XML OSM file of a certain area from Open Street Map
  2. Imported XML data into PostgreSQL + PostGIS (osm2pgsql)
  3. Converted data in 2. DB into shapefile (pgsql2shp)

Now I’m writing down the mapfile (including layers) to visualize data in 3.
How can i determine the EXTENT of the map generated?
My task can be completed in a smarter way?
Do you all know an auto mapfile generator from data? Many thanks.

Ogrinfo reports the extents of a shape as ogrinfo -so -al shapefile.shp. -all means “all layers” and -so “summary only” and that report is enough for you.