Personal tools

Map Sheet Grids

In this context, a grid of sheet frames (or simply, a grid) is a set of one or more rectangles with some associated attributres. The rectangle represents in world coordinates the area that is going to be printed in a gvSIG map (layout). These are the main attributes which are automatically created:

  • CODE is a string that uniquely identifies this frame in the grid
  • SCALE is the scale denominator to be used in the map
  • DIMX_CM is the width in centimeters of the map area in the resulting printed sheet
  • DIMY_CM is the width in centimeters of the map area in the resulting printed sheet
  • OVERLAP is the amount in % by which each frame overlaps the adjacent one
  • ROT_RAD is the rotation angle of the frame (currently unused)
../image/en/um_overlap.jpg

Meaning of the OVERLAP attribute.

In this illustration, OVERLAP = 14 because a / d = 14 / 100. In the second example, b / d = 50 / 100 so the value of the OVERLAP field is 50.

The fields SCALE, DIMX_CM, DIMY_CM and OVERLAP are currently expected to be the same for all frames in a grid. More flexibility might be added in future versions by allowing different values in each frame.

Since the grid can be edited and also exported/imported as a shapefile, it is possible to add custom fields that can be used as active fields when creating the layout template (see following sections).

Creating a new grid

You can add a grid to the current view in two different ways.

From a view or a vector layer

Once you have a working gvSIG view, choose the 'View > Map Sheets > Create grid' menu item to access the grid creation dialog:

../image/en/um_create_grid.jpg

Grid creation dialog

Choose the desired method to create the new grid. The 'Based on features' option will not be available if there is no vector layer in the current view. The map area size in the map sheet can be expressed in cm or mm only. Do not use any thousands separator for the scale denominator.

../image/en/um_grid_created.jpg

New grid is added to the view.

If your settings cause a very high number of grid frames, an error message will show. You can change the maximum number of sheets allowed (see The mapsheets properties file section at the end of this page):

../image/en/um_too_many_msg.jpg

Error message if settings imply too many frames.

From an existing shapefile

You can create a new grid from an existing shapefile if it has the attributes mentioned before. They must be of numeric type except the CODE attribute which must be of string type. The shapefile may also have other attributes which you will be able to use while defining the map layout template. The geometries of the shapefile should be rectangles of the same size and consistent with the SCALE, DIMX_CM and DIMY_CM attributes. If a geometry which is not a rectangle is found, its bounding box will be used.

Manipulating the shapefiles geometries and mandatory attributes is not trivial. You are encouraged to create these shapefiles by exporting an existing grid (see below). The only risk-free operation is adding attributes.

Storing a grid

A grid can be stored for later use in two ways.

As a layer in the project

A grid is also a vector layer and is stored in the gvSIG project as usual.

As an external shapefile

You can export an existing grid as a shapefile by selecting the grid in the TOC and using the 'View > Map Sheets > Export grid as shapefile' menu item:

../image/en/um_enabled_menu.jpg

The 'View > Map Sheets' menu item allows you to export the grid as a SHP, among other things.

Having a grid in the shapefile format lets you manipulate it using other applications. For example you can do these basic operations:

  • add a new frame of the same size as the existing ones.
  • remove or move one or more frames.
  • add custom attributes which you'll be able to use while creating the map layout template.
  • changing the attribute values in a consistent way. For example:
    • multiply the SCALE attribute in all records by k and divide the DIMX_CM and DIMY_CM attributes by k
    • enlarge all geometries by a factor k and multiply the DIMX_CM and DIMY_CM attributes by k
    • enlarge all geometries by a factor k and multiply the SCALE attributes by k

Adjusting the sheet frames in a grid

The grid adjustment tool is activated by clicking on the 'View > Map Sheets > Adjust sheets...' menu option, which is enabled if the layer selected in the TOC is a Map Sheets grid. You will notice that grid frames adopt a reddish, semi-transparent fill color and are labeled with their CODE attribute. The adjusting tool is automatically deactivated if you select a different layer in the TOC. If the newly selected layer is also a grid, the previous grid will exit the adjustment mode and the newly selected grid will enter the adjustment mode. If the newly selected layer is not a grid, the new active tool will be the one that was active when the adjustment tool was chosen.

How the adjusting tool works

The varying effects of clicking, double-clicking and dragging are described in this table. The CTRL key is used to deal with frame selection/deselection:

Mouse location Action Effect Effect if CTRL key down Effect if SHIFT key down

On unselected

frame

Clicking   Frame is selected.  
Double-clicking Frame is deleted. [Not recommended] First click selects frame; second click prompts user to confirm deletion of selected frames.
Dragging Frame is dragged. Frame is selected, not dragged.
On selected frame Clicking   Frame is unselected.
Double-clicking Selected frame(s) are deleted. User is prompted for confirmation if there are two or more frames selected. [Not recommended] First click unselects frame; second click deletes.
Dragging Frame is dragged. Frame is unselected, not dragged.
Out of any frame Clicking    
Double-clicking New frame is added. User is prompted for valid CODE.
Dragging   If there are any frames selected, they are dragged so that relative location of mouse is preserved. If there are any frames selected, they are rotated following the mouse (move the mouse in the area located to the right of the sheet(s) to be rotated.
New feature: Rotating frames

You can rotate one or more frames at the same time. Select the sheet(s) you wish to rotate, then place the mouse a bit to the right of the selected sheet(s), then hold down the SHIFT key and drag the mouse to rotate the sheet(s). Rotation is limited to [-90, +90] degrees. This allows the North arrow to point at any direction between the right and the left margin (through the upper half of the sheet of paper):

../image/en/rotate-sheet.jpg

User is rotating selected sheet(s).

Adding frames

You can add a new frame by double-clicking on a place where there are no frames. You will have to enter a valid new CODE for the new frame:

../image/en/um_new_code.jpg

User is prompted for a new valid CODE.

A valid CODE is one that does not currently exist in the grid. You can then adjust the position of the frame if the presence of other frames did not allow you to create it in the right place.

../image/en/um_new_sheet.jpg

A new frame has been added.

Deleting frames

You can delete a frame by double-clicking on it. If the frame was selected and it was the only one selected, it will be deleted without confirmation. If it's not the only one selected, you will be prompted with a confirmation dialog before deleting all selected frames:

../image/en/um_delete_confirm.jpg

User is asked to confirm deletion of various frames.

Moving frames

You can move one frame (selected or not) by dragging it with the mouse (mouse down + mouse move + mouse up).

../image/en/um_adjust_sheets.jpg

Adjustment tool in action.

You can also move all the currently selected frames at the same time by dragging the mouse in a place where there are no frames and keeping the CTRL key down:

../image/en/um_move_several_2.jpg

CTRL + dragging outside the frames lets you consistently move selected frames.

Selecting/unselecting frames

The CTRL key is used to select/unselect frames. Click on a frame while keeping the CTRL key pressed to switch its status (from selected to unselected and viceversa). Other selection-related operations (such as clearing selection) can be performed normally (not with the adjustment tool) because the grid is also a standard vector layer.

Overlapping frames

If you click or start a dragging operation on a pixel where two or more frames overlap, only one of them (unpredictably chosen) is affected by the operation, so in some cases you will have to temporarily set aside an overlapping frame to access the frame of interest.

The Undo option

The u key will undo the latest operation performed on the grid frames. This applies to adjustment operations (adding, deleting and moving frames); it does not apply to selection/deselection operations. A heap of operations is used to achieve this, so you can undo every operation until the initial state is reached. The heap of recorded operations is cleared every time the grid exits the adjustment mode.

Map Sheets layout template

Introduction

The Map Sheets extension provides a new type of document: the dynamic layout template. It's a special type of layout. The differences with the traditional layout are:

  • it is intended to be used in association with a grid
  • it includes a special type of active (we can call them dynamic too) frames which will automatically refresh when you select the different frames in the print dialog frame list (see below)
../image/en/um_project_manager.jpg

A new type of document is added.

Creating a dynamic layout template from a grid

The goal of having a grid is using it as an index to generate many printable map sheets.

Layout template settings dialog

Before opening the layout template settings dialog, check that the view's TOC is properly set: order and visibility of layers, symbology, transparency. If you are going to use a background layer, you can set it as not visible in the TOC to work more confortably. A background layer is not necessarily visible in the view or in the layout template but will be printed under all other layers in the final sheet.

../image/en/um_create_layout.jpg

User chooses layout template initial settings

In the lower part of this dialog you can choose the active fields that will be added to the layout template. You will typically use CODE to uniquely identify each final sheet and SCALE. The text field lets you input a pattern to be used. The wildcard character is *. This is where you can use the optional attributes (for example, if you edited the shapefile specifically to have some additional information for each grid frame.)

Tuning the layout template

After clicking the 'Accept' button in the previous dialog, the initial version of the dynamic layout template will be presented.

../image/en/um_layout_first.jpg

Draft version of the layout template. Tuning now starts.

The view frame and the active fields will be updated with the values of the first grid frame. At this point you will probably need to tune the layout to make it look better. These actions are performed in the same way as if you were dealing with a conventional gvSIG layout:

  • Drag the main view frame to place it exactly where you want. Notice that -for consistency- you can move it but you cannot resize it.
  • Change the size and texts of the title and active fields and their positions.
  • Add other conventional frames (texts, north, etc.)

Printing the map sheets

Once you have tuned the layout template according to your taste and needs, it's a good idea to check the view for these possible adjustments:

  • Make sure the order of layers fits your purpose.
  • Make sure the graphical properties of each layer is correct: transparency, raster properties, symbology of vector layers, etc.
  • Decide if you wish to print all frames or only some of them. In the latter case, select the grid in the TOC and use the selection tools as usual to select the frames which must be printed.
  • Keep in mind that grids themselves will not be visible in the final sheet. If for some reason you wish to print a grid (for example, you might need to see in each sheet the borders of other sheets) simply export it as a shapefile and add it as a conventional vector layer.
  • If you intend to use a background layer (printed but not visible in the view), add it to the view and uncheck its visibility checkbox in the TOC. You will lately be able to choose it as your background layer and therefore will be printed regardless of its visibility flag in the TOC.

You can now access the main print dialog from the layout template by using the 'Map > Map Sheets > Print map sheets' menu item:

../image/en/um_print.jpg

Print dialog lets user browse sheets and choose various print options.

On the left side of the dialog there is a list with all the grid frames, identified by their CODE attribute. If you click on one of them, the template layout will be updated, i.e. the main view frame will move to the rectangle defined by the frame geometry and the active fields (associated with the CODE, SCALE attributes and others you might have defined) will be refreshed as well.

On the right side of the dialog you can choose:

  • Whether to print all frames or only selected ones.
  • Whether to use a background layer or not.
  • Whether to send the final sheets to an available printer or export them as PDF files.

As PDF files

If you choose to export the map sheets as PDF files, they will be created in a subfolder in the user's folder (typically C:\Documents and settings\user\mapsheets in Windows systems and /home/user/mapsheets). A little dialog will show the progress:

../image/en/um_print_progress.jpg

Print progress dialog.

Another message dialog will tell you when the PDF files are available:

../image/en/um_pdf_list.jpg

New PDF files successfully created.

To a printer

If you are using a Windows system, you will se a checkbox by the 'Print' (to printer) button. If you check it, the printer-specific settings dialog will show after you have chosen the target printer. In the first place, the template layout needs to be close to speed the printing process:

../image/en/um_layout_closed.jpg

(1) Layout template needs to be closed in order to speed up the print process.

../image/en/um_choose_printer.jpg

(2) User chooses printer among available ones as usual.

../image/en/um_printer_specific_settings.jpg

(3) Windows systems only: User can choose printer-specific preferences.

Caution!

Note about printer-specific settings dialogs

When you terminate the gvSIG session, the application tries to restore the printer-specific settings (for example, color preferences, number of sheets per page, etc). Unfortunately, on some Windows systems this is not possible, and a little error message appears:

../image/en/um_operation_not_completed.jpg

gvSIG Map Sheets was unable to restore printer-specific settings to previous values.

In this case, the printer settings selected for the last series of map sheets will be used from that moment every time you use the printer from any application in that computer. One way to avoid this issue is doing a last printing from the Map Sheets extension to manually restore the printer settings to their default settings. Of course, you can always change the printer settings from any other application which allows you to do so.

The mapsheets properties file

In properties/mapsheets.properties you will find a self-explanatory properties file which allows you to set the value of a few important variables:

grid.sheet.max=200
# argb
grid.sheet.symbol.border.color=255,0,0,0
grid.sheet.symbol.fill.color=80,0,0,0
# argb
grid.sheet.symbol.selection.border.color=255,50,50,0
grid.sheet.symbol.selection.fill.color=80,255,255,0
# argb
grid.sheet.symbol.editing.border.color=255,192,0,0
grid.sheet.symbol.editing.fill.color=80,255,0,0
grid.sheet.id.separator=_

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: