wiki:MapGuideRfc51

Version 20 (modified by chrisclaydon, 16 years ago) ( diff )

--

MapGuide RFC 51 - Raster Re-projection

This page contains an change request (RFC) for the MapGuide Open Source project. More MapGuide RFCs can be found on the RFCs page.

Status

RFC Template Version(1.0)
Submission Date July 14, 2008
Last Modified Tony Fang Timestamp
AuthorTony Fang
RFC Statusdraft
Implementation Statuspending
Proposed Milestone2.1
Assigned PSC guide(s)(when determined)
Voting History
+1
+0
-0
-1
no vote

Overview

This is a proposal to add an efficient raster re-projection algorithm that is based on tessellating an image into smaller triangles and re-projecting the triangles.

Motivation

MapGuide does not currently support any form of raster re-projection. If a user has a raster feature source, it can only be displayed in a MapGuide map that uses the same coordinate system as the raster data.

Previously, in order for application developers to use images in multiple coordinate systems, they needed to create copies of the images in each coordinate system. The re-projection capability that we are adding will allow developers to not have to have multiple versions of the same image (re-projected to different coordinate systems) at the cost of about 25% degradation in performance.

Proposed Solution

We will use a tessellation algorithm to re-project the raster data from one coordinate system (CS) to another.

Figure 1. The left side shows the raster image (green rectangle) in it's own CS. The right side shows the blue mesh of uniform triangles created in device space in the viewport CS.

We must first determine how much of the original image is required by projecting the extents of the viewport (or map) into the image's CS. This yields our desired clipped image (red outline). Then we project the extents of the clipped image into the viewport's CS, and subsequently into device space. A mesh of uniform triangles is created in device space (Figure 1).

Figure 2. The blue mesh of triangles has been transformed into the raster image's CS.

Each point in the triangle mesh is transformed from device space, to the viewport's CS, to the image's CS, and then to device space (Figure 2). A texture map will be created from the two triangle meshes.

Figure 3. The raster image is rendered into the viewport using the texture map.

The image will then be rendered using the texture map created from the two triangle meshes (Figure 3). Because the triangle mesh is in device space, choosing its size guarantees you a minimum level of accuracy: the error in the re-projected image will never be greater than the size of the individual triangles.

The balance between performance and accuracy of the transformation is controlled by the number of triangles created for each raster. The configuration setting will control the grid size and thus the number of triangles created. The configuration will be handled by the serverconfig.ini.

The category and setting names for this configuration are:

[RenderingServiceProperties]
# *****************************************************************************
# R E N D E R I N G  S E R V I C E
#
# Property Name                    Description
# -----------------------------------------------------------------------------
# RasterGridSize                   Size of raster re-projection grid in pixels
# *****************************************************************************
RasterGridSize = 100

Descriptive error messages will be logged to handle invalid configuration settings, invalid data, unsupported transformations etc.

In keeping with MapGuide’s current behavior, if the re-projection fails for any reason, the map will still be rendered and returned, using any other layers that it contains, and the failed layer(s) will be skipped.

We will add an optimization if the re-projection is a simple datum shift. The image will simply be shifted, and the advanced algorithm will not be invoked.

We will support re-projecting raster in drawing sources.

Implications

WMS is also a raster feature source and will be affected by this algorithm.

The AGG and DWF Renderers will support raster re-projection.

GD Renderer support is on hold pending RFC 52 - Remove GD Renderer.

Test Plan

Unit tests should cover:

  • The most common raster image formats (ECW, MrSid, TIFF)
  • Re-projections between each of the main coordinate system types

Unit tests should also validate that error conditions are handled gracefully.

Funding/Resources

Autodesk

Attachments (9)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.