Bug report #1027

The --extent command line option does not appear to work

Added by masneyb - over 14 years ago. Updated over 13 years ago.

Assignee:Tim Sutton
Affected QGIS version: Regression?:No
Operating System:Debian Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:11087


The --extent command line option does not appear to work. I am running qgis with a command like this:

qgis --project myproject.qgs --extent ###,###,###,###

When the application starts, it is zoomed out by a hundred miles or so from the original coordinates. I verified that my extent coordinates are correct.

As of this evening, I am using the latest version from HEAD. I also see that the --snapshot argument was fixed since 0.9.1. Thanks!


#1 Updated by masneyb - over 14 years ago

I did some more digging this morning. The extent is making it to QgsMapRender::setExtent(). The extent is readjusted by QgsMapRender::adjustExtentToSize(). When QGis starts up, the initial window size is rather small. Is there a way to have qgis start in a maximized state?

I see that it writes some geometry information to the config file. Here are the relevant settings:

[email protected](\\x1\\xd9\\xd0\\xcb\\0\\x1\\0\\0\\0\\0\\0\\0\\0\\0\\0\\x1a\\0\\0\\x3\\x1f\\0\\0\\x2z\\0\\0\\0\\0\\0\\0\\0\\x1a\\0\\0\\x3\\x1f\\0\\0\\x2z\\0\\0\\0\\0\\0\\0)

[email protected](\\x1\\xd9\\xd0\\xcb\\0\\x1\\0\\0\\0\\0\\0\\0\\0\\0\\0\\x34\\0\\0\\x2\\x65\\0\\0\\x1\\xd9\\0\\0\\0\\x5\\0\\0\\0N\\0\\0\\x2
Bookmarks\\[email protected](\\x1\\xd9\\xd0\\xcb\\0\\x1\\0\\0\\0\\0\\0\\x5\\0\\0\\0\\x1a\\0\\0\\x1\\\\\\0\\0\\x1 \\0\\0\\0\\x5\\0\\0\\0\\x1a\\0\\0\\x1\\\\\\0\\0\\x1 \\0\\0\\0\\0\\0\\0)
Identify\\[email protected](\\x1\\xd9\\xd0\\xcb\\0\\x1\\0\\0\\xff\\xff\\xff\\xb9\\0\\0\\0\\0\\0\\0\\0\\xdb\\0\\0\\x1Z\\xff\\xff\\xff\\xbe\\0\\0\\0\\x1a\\0\\0\\0\\xd6\\0\\0\\x1U\\0\\0\\0\\0\\0\\0)
Measure\\[email protected](\\x1\\xd9\\xd0\\xcb\\0\\x1\\0\\0\\0\\0\\0(\\0\\0\\0\\x8c\\0\\0\\x1-\\0\\0\\x1r\\0\\0\\0-\\0\\0\\0\\xa6\\0\\0\\x1(\\0\\0\\x1m\\0\\0\\0\\0\\0\\0)


#2 Updated by Tim Sutton over 14 years ago


The extents of the map render scene and the extents of the application window are independently of each other. QGIS should remember the window size from your previous session (thats what the geometry is for in the config file you referred to). Once the window is show the maprender scene is set to the spatial extents defined in your .qgs file at a scale appropriate to the current window size. If window sizing is still causing you an issue, please file a separate bug for that.

I am moving this bug to milestone 1.0.0. When the upcoming 0.11.0 release is out in a week or so, please confirm if this --extents bug still exists and if not close this issue.

Many thanks


#3 Updated by Marco Hugentobler over 13 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

Fixed in

Also available in: Atom PDF