Opened 16 years ago

Closed 15 years ago

#1027 closed defect (fixed)

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

Reported by: masneyb Owned by: timlinux
Priority: major: does not work as expected Milestone: Version 1.0.3
Component: GUI Version: Trunk
Keywords: Cc:
Must Fix for Release: No Platform: Debian
Platform Version: Awaiting user input: no

Description

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!

Change History (3)

comment:1 by masneyb, 16 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:

[Composer] geometry=@ByteArray(\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)

... [UI] canvasSplitterState=@ByteArray(\0\0\0\xff\0\0\0\0\0\0\0\x2\0\0\x1\x12\0\0\x1\r\x1\0\0\0\x6\x1\0\0\0\x1) encoding=System geometry=@ByteArray(\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`\0\0\x1\xd4\0\0\0\0\0\0) ... [Windows] Bookmarks\geometry=@ByteArray(\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\geometry=@ByteArray(\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\geometry=@ByteArray(\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) Measure\h=200 ...

Brian

comment:2 by timlinux, 16 years ago

Milestone: Version 1.0.0
Owner: changed from nobody to timlinux

Hi

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

Tim

comment:3 by mhugent, 15 years ago

Resolution: fixed
Status: newclosed

Fixed in r11023

Note: See TracTickets for help on using tickets.