4.4. Raster (Image Correlation)

The Raster tools place, correct and georeference raster images — scanned plans, old map sheets, orthophotos, GeoTIFFs — the way AutoCAD Raster Design does, with the same commands, dialogs and prompts.

Command

Alias

What it does

IINSERT

IIN

Insert an image with its correlation: read its position from the GeoTIFF tags, the world file or the file’s resolution, change it if needed, convert it to the drawing’s coordinate system, and place it. Raster Design’s Insert with the Image Correlation dialog.

IMATCH

IMA

Match an image already in the drawing to points: pick a point on the image and where it belongs, two or more times. The image is moved, rotated and scaled; the pixels are not changed.

IRSHEET

IRS

Rubbersheet an image onto control points to remove distortion (shrunk paper, scan skew, an old map’s projection). The pixels are resampled into a new, georeferenced file.

IEXPORT

IEX

Export an image with its correlation — a world file and / or GeoTIFF tags — so that GIS and other CAD programs place it where IQcad does.

The ordinary image commands — IMAGEATTACH (AutoCAD’s Attach Image dialog) and IMAGECLIP (clipping) — are described in the Command Reference.

4.4.1. Access

Where

How

Ribbon — Super Tools tab

Group Raster: the Match Image split button. A click runs IMATCH; the arrow opens Match Image, Insert Image (Correlation)…, Rubber Sheet Image… and Export Image (World File / GeoTIFF)….

Ribbon — Image tab

Select one image: the contextual Image tab appears. Group Correlate: Match, Rubber Sheet, Export.

Menu bar

Super Tools → Raster → Insert Image (Correlation)…, Match Image, Rubber Sheet Image…, Export Image (World File / GeoTIFF)…

Command line

IINSERT / IIN, IMATCH / IMA, IRSHEET / IRS, IEXPORT / IEX

4.4.2. Which command?

You have…

Use

A GeoTIFF, or an image with a world file (.tfw, .jgw, .pgw…), in the drawing’s coordinate system

IINSERT — it lands in place, no picking.

The same, but in another coordinate system (e.g. a WGS 84 GeoTIFF in a GGRS87 drawing)

IINSERT with the Transform tab.

A scanned plan with no georeferencing, and two or more points you can identify on it and in the drawing (grid crosses, building corners, survey points)

IINSERT (Default — the scan’s real paper size), then IMATCH.

A scan that is distorted — paper shrinkage, a skewed scan, a map sheet whose grid is not square

IMATCH to bring it close, then IRSHEET.

An image to give to a GIS / another CAD program, placed as in IQcad

IEXPORT (world file and / or GeoTIFF).

4.4.3. Things to know first

Insertion point. An image is placed by its bottom-left corner, its width and height, and a rotation (counter-clockwise, in degrees, like every angle in the drawing).

Correlation sources. Where an image’s position can come from:

Source

Read from

Image File

GeoTIFF tags inside a .tif: the tie point and pixel size, or the transformation matrix; the EPSG code and the linear units. Files marked PixelIsPoint are moved half a pixel to the pixel corner, as GDAL does.

World File

The six-line file next to the image: .tfw (TIFF), .jgw (JPEG), .pgw (PNG), .bpw (BMP), the extension + w, or .wld. A world file gives the centre of the first pixel; IQcad places the image by the pixel’s corner, as AutoCAD does.

Default

No georeferencing. If the file stores a resolution above 100 dpi (a scan), the image comes in at its real paper size (a 300 dpi A4 scan is 210 mm wide); otherwise it is 1 drawing unit wide. 72 and 96 dpi are what cameras and screenshots write, not a paper size.

A .prj file next to the image (as GIS programs write with world files) gives its coordinate system.

Points. Every point prompt takes a click (object snaps work), typed coordinates x,y, relative @dx,dy, or ``#N`` — the survey point number N from the drawing’s point database. So survey points can be the destinations of IMATCH and IRSHEET directly.

Undo. Every command here is undone with one U / Ctrl+Z. Files written (rubbersheeted, transformed or exported images) stay on disk.

4.4.4. IINSERT — Insert with correlation

Inserts an image and shows the Image Correlation dialog with the position read from the file. You review or change it, then press OK.

Workflow

  1. Run IINSERT. Choose the image in the Insert Image dialog (TIFF, PNG, JPEG, BMP). The command line reports what it found, e.g. Correlation found: world file ortho.jgw.

  2. The Image Correlation dialog opens on the Source tab.

  3. Change anything on Modify, Transform or Insertion.

  4. OK places the image (and, with Zoom To Image, zooms to it).

4.4.4.1. The dialog’s four tabs

Source

Item

Meaning

Correlation Source

The sources this image has: Image File (GeoTIFF), World File (name), Default. Click one to use it; all values below follow.

Correlation Values

Insertion X, Y (bottom-left corner), Rotation (shown clockwise, as 12d30'00", Raster Design’s convention), Scale.

Density

Pixels per image unit, and the size in pixels.

Units

The image’s units: stated by the file, the scan’s inches, or taken as the drawing’s units.

Coordinate System

The EPSG code from the GeoTIFF, when it has one.

Image / Correlation File Name

The files the values come from.

Note

When the world file has skew or is mirrored, an image frame cannot hold that; it is ignored and said here — use IRSHEET.

Modify — the correlation values for this insertion only (the file and its world file are not changed):

  • Insertion X / Y — bottom-left corner, in image units.

  • Rotation (clockwise) — degrees, e.g. 12.5 or 12d30'00".

  • Scale — above 1 enlarges.

  • Density — pixels per image unit.

  • Units — the image’s units: Unitless, Inches, Feet, Miles, Millimeters, Centimeters, Meters, Kilometers, US Survey Feet. When they differ from the drawing’s units the image is converted (an image in metres in a millimetre drawing is 1000 times larger). By default they are the drawing’s own units, so nothing is converted unless you say so.

The Insertion values follow every change here.

Transform — when the image is in another coordinate system than the drawing:

Item

Meaning

Transform To Drawing’s Coordinate System

Ticked automatically when the image’s system (GeoTIFF or .prj) and the drawing’s (Civil → Civil Settings → Coordinate System) are both known, differ and are supported.

Image / Drawing (EPSG code)

Change or type the codes; the name of each is shown beside it.

True (pixel by pixel)

Every pixel is converted (a 17 × 17 grid of exactly converted points drives the resampling). Writes a new image file name_EPSG<code>.<ext> with its world file. The most accurate.

4-Point Rubbersheet

Only the four corners are converted; the image is resampled between them. New file, faster, less exact over large areas.

3-Point Affine

Three corners are converted and the original file is placed (moved, rotated, scaled) — no new file; skew is dropped. Fine for small images.

Supported systems: 2100 GGRS87 / Greek Grid (EPSG:1272 shift, about 1 m — the transformation’s own accuracy), 4326 WGS 84 (longitude, latitude), 3857 Pseudo-Mercator, 32601–32660 / 32701–32760 WGS 84 / UTM. The conversions agree with PROJ to under 1 mm.

Insertion — what goes into the drawing, in drawing units:

  • Insertion Point X, Y, Z, Rotation (counter-clockwise), Scale — each with Pick <.

  • Image size in drawing units — width × height.

  • Insert Options: Zoom To Image, Show Frame Only (the frame and name, no pixels).

With the Transform on, these are set by the transformation and greyed.

Pick < hides the dialog and asks on the command line; the dialog comes back on the Insertion tab:

Specify insertion point <500000.000,4200000.000>:
Specify rotation angle <0.000>:        (a point: the angle from the insertion point)
Specify scale factor <1.000>:          (a point: its distance is the image width)

Enter keeps the value.

4.4.4.2. Examples

1 — An orthophoto with a world file. ortho_2cm.jpg + ortho_2cm.jgw in a GGRS87 drawing:

Command: IINSERT
(choose ortho_2cm.jpg)
Correlation found: world file ortho_2cm.jgw.
(dialog: Source = World File; OK)
Image inserted: ortho_2cm.jpg at 278323.427,4308260.818, 890.856 x 542.293, rotation 0.000 deg.

2 — A WGS 84 GeoTIFF into a GGRS87 drawing. The drawing’s system is set to 2100 in Civil Settings. The GeoTIFF says EPSG:4326:

Command: IINSERT
The image is in EPSG:4326, the drawing in EPSG:2100 - see the Transform tab.
Correlation found: GeoTIFF tags in the image.
(Transform tab: True (pixel by pixel); OK; save as area_EPSG2100.tif)
Transformed EPSG:4326 -> EPSG:2100; saved area_EPSG2100.tif (2140 x 1755 pixels) and its world file.

3 — A 300 dpi scan at its real size. plan_A1.tif (scanned at 300 dpi, no world file) in a millimetre drawing: Source = Default, Units = Inches – the file’s 300 dpi gives its paper size; it comes in 841 mm wide. Then use IMATCH to put it in place.

4 — Shift a georeferenced image by hand. On Modify, add 0.35 to Insertion Y: the Insertion tab follows; OK. The world file is not changed.

4.4.5. IMATCH — Match to points

Moves, rotates and scales an image so that points on it land on points in the drawing. Only the image’s frame changes (no new file); a clipping boundary follows the image.

Prompts

Select image to match:                         (skipped: one image selected, or the only image)
Specify first source point:                    (on the image)
Specify first destination point:               (where it belongs)
Specify second source point or [Undo]:
Specify second destination point:
Specify next source point or [Undo/Done] <Done>:
Specify next destination point:
Scale image based on match points? [Yes/No] <Yes>:

Pairs

  • Two pairs — an exact fit: the image is moved, rotated and scaled so both points land exactly.

  • Three or more — a least-squares (Helmert) fit through all of them, with the error of each pair and the total RMS error on the command line. Use more points than needed: a large error shows a wrong pick.

  • Undo removes the last pair; Done (or Enter, or a right-click) finishes.

  • Scale = No keeps the image’s size: it is only moved and rotated (for a correctly sized image you only want to position).

A line is drawn from each source point to its destination while you pick.

Example — a scanned plan onto four survey points. Grid crosses on the scan are surveyed as points 101–104:

Command: IMATCH
Specify first source point:              (click the cross on the scan)
Specify first destination point: #101
Specify second source point or [Undo]:   (click the next cross)
Specify second destination point: #102
Specify next source point or [Undo/Done] <Done>:
Specify next destination point: #103
Specify next source point or [Undo/Done] <Done>:
Specify next destination point: #104
Specify next source point or [Undo/Done] <Done>:
Scale image based on match points? [Yes/No] <Yes>:
  ID  Source point                Destination point           Error
   1  12.410,8.220                482110.000,4201220.000      0.042
   2  ...
  Total RMS error: 0.038
Image matched: scale 49.873210, rotation 1.2840 deg.

If the remaining errors are larger than you accept, the scan is distorted: continue with IRSHEET using the same points.

4.4.6. IRSHEET — Rubbersheet

Removes distortion with control points: each pairs a source point on the image with the destination point in the drawing where it belongs. The image is resampled into a new file with its own world file.

Workflow

  1. Run IRSHEET (with one image selected, or select it).

  2. The Rubbersheet – Set Control Points dialog opens.

  3. Add control points (Add Points < or Grid Points).

  4. Choose the Method; look at the Error column and Preview.

  5. OK: choose the new file’s name (default name_rs.<ext>); the image is resampled with a progress bar.

  6. Answer Replace the image in the drawing with it? — Yes: the image now shows the new file (one undo step); No: the new image is added on top and the original kept.

The control points are also saved to LASTRS.txt in the Temp folder.

4.4.6.1. The dialog

Item

Meaning

Method — Triangular

The points are triangulated (Delaunay) and each triangle gets its own transformation: every point lands exactly. The image outside the destination points is dropped — put points near the corners.

Method — Polynomial

One fit for the whole image, of the chosen Degree. Points need not land exactly; the Error column shows by how much.

Degree

Polynomial only. Allowed by the number of points: 3–5 → 1, 6–9 → 2, 10–14 → 3, 15–20 → 4, 21+ → 5.

Table

ID, Error (Polynomial), Source Point, Destination Point. Click a row to select it.

Total RMS Error

Of all points (Polynomial).

Add Points <

Pick pairs on the drawing (below).

Grid Points

Destinations on a regular grid (below).

Delete / Repick < / Zoom To <

For the selected row. Auto Zoom zooms to the pair before a repick.

Preview

The source points’ outline in blue, the destination outline in red, and each point’s move. Enter returns to the dialog.

Import / Export

The control points as a text file — one point per line, ID srcX srcY dstX dstY (or without the ID); lines starting with ; or # are comments. Reuse a set on another sheet.

Add Points prompts:

Specify source point 1 or [Undo] <return to the dialog>:
Specify destination point or [Anchor/Undo]:

Anchor keeps the point where it is (source = destination) — use it to pin parts of the image that are already right. Enter at the source prompt returns to the dialog.

Grid Points — for a map sheet with a printed grid. The Grid Parameters dialog:

  • Points: Rows, Columns (Total shown).

  • Grid: X Origin, Y Origin, or Pick <.

  • Cell: X Size, Y Size, or Pick < (two corners of one cell).

  • Preview draws the grid; Add Points starts matching.

For each grid node the view is centred on it and you click the matching cross on the image:

Grid point 1 of 12 at 480000.000,4200000.000: specify the source point or [Anchor/Skip/Undo] <return>:

Skip leaves a node out (a cross you cannot see); Undo goes back one node.

4.4.6.2. Which method?

Triangular

Polynomial

Points

Land exactly

Best fit; errors shown

A wrong point

Bends its triangles — check the Preview

Shows as a large error

Outside the points

Dropped

Kept (extrapolated)

Use for

Local distortion, many points, a grid

Even distortion (paper shrinkage), few points

4.4.6.3. Examples

1 — An old map sheet with a 3 × 4 grid.

Command: IRSHEET
(dialog: Grid Points)
(Grid Parameters: Rows 3, Columns 4, X Origin 480000, Y Origin 4200000,
 X Size 500, Y Size 500; Add Points)
Grid point 1 of 12 at 480000.000,4200000.000: ... (click the cross)
...
All 12 grid points done.
(dialog: Method Triangular; Preview; OK; save as sheet_rs.tif; Yes)
Rubbersheeted: 12 control points, triangular; saved sheet_rs.tif (9120 x 6880 pixels) and its world file.

2 — A shrunk paper plan, survey points as destinations. Add Points with #201 … #208 as destinations, Method Polynomial, Degree 2 (8 points allow 2). Check the Error column: a point far above the others was picked wrong — select it, Repick <.

3 — Pin the good part. A scan correct on its left half: add Anchor points along the left half and real pairs on the right, Method Triangular.

4.4.7. IEXPORT — Export with correlation

Saves an image with its position, for GIS (QGIS, ArcGIS) and other CAD programs.

Workflow

  1. Run IEXPORT (with one image selected, or select it).

  2. Choose the file name and format (TIFF, PNG, JPEG, BMP; default name_export.<ext>).

  3. Export Options (below); OK.

Export Options

Option

Meaning

Maintain Drawing Link To Image

The image in the drawing then uses the exported file.

Burn Rotation Into Image

A rotated image is resampled north-up; the correlation has no rotation — every program shows it right. The file is larger (empty corners).

Include Rotation In Correlation

The pixels are kept as they are; the rotation is written in the world file / GeoTIFF. Some programs ignore it.

Output Without Rotation

The pixels are kept and no rotation is saved. Selected and locked when the image is not rotated.

World File

.tfw / .jgw / .pgw / .bpw next to the image.

GeoTIFF Tags (TIFF only)

The position inside the TIFF itself; with the EPSG code when given (e.g. 2100) and the drawing’s linear units.

Exported to the same format, the file is copied byte for byte (a JPEG is not compressed again). The options are remembered for the next export.

Example — a georeferenced TIFF for QGIS.

Command: IEXPORT
(save as site_geo.tif)
(Export Options: Burn Rotation Into Image, World File, GeoTIFF Tags, EPSG 2100; OK)
Exported site_geo.tif (2311 x 1980 pixels) + site_geo.tfw + GeoTIFF tags (EPSG:2100).

Open site_geo.tif in QGIS: it lands in EPSG:2100 where it is in IQcad.

4.4.8. Large images

Images over 250 megapixels (orthophotos) — or results that large — are resampled in bands: only the rows each band needs are read, and the result is written strip by strip, compressed. Memory stays at about 400 MB for a band’s rows, plus — for a JPEG — the compressed file itself, whatever the image size.

  • The result must be a TIFF (.tif); PNG, JPEG and BMP are refused with a message.

  • A progressive JPEG that large cannot be done (its decoder holds the whole image); ordinary (baseline) JPEGs and TIFFs can.

  • The compressed result must be under 4 GB (a TIFF limit).

  • Example: a 39085 × 23792 px orthophoto (930 MP, JPEG) is rubbersheeted in about 4½ minutes into a 1.1 GB TIFF.

4.4.9. Troubleshooting

Message / symptom

What to do

The points coincide — they give no direction to match.

IMATCH needs two different source points and two different destinations.

A large error on one point

Picked wrong: IMATCH — Undo and pick again; IRSHEET — select the row and Repick <.

The rubbersheeted image is cut off

Triangular drops what is outside the destination points: add points near the image’s corners, or use Polynomial.

… is not supported (Transform tab)

The EPSG code is not one of those listed; save the image in a supported system, or place it with IMATCH on known points.

The Transform tab is not ticked

The drawing’s coordinate system is not set (Civil → Civil Settings → Coordinate System), or the image has no GeoTIFF code / .prj: type the codes.

The image file is not found (an embedded image …)

IRSHEET and IEXPORT work on the image’s file; unembed it first.

… save the result as a TIFF

The image is over 250 MP: choose a .tif name.