Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] GDAL and JAI

Hey Greg,

I would re-iterate what Jody just said. Jan created a "rubber sheeting" system in uDig that you will probably want to re-use.

You may have already thought this through so the following may be redundant.

I would encourage you to structure your UI to let user work with several alternative approaches, depending on their workflow so that users can careful control the distortion induced by the operation.

The simplest need is merely to "anchor" an image, that is to relate one point in the image to one point in map space. This involves no distortion.

A second need is to both anchor, scale and align, using two points. This involves only the 'distortion' of scale and rotation---which is generally not considered distortion. Note that you can ask the user to give you more than two points, such as the four corners and use the over determined sample to average the value you will use for the operation. The operation can be done with a simple affine transform in JAI.

A third need is to peg the corners which introduces a further distortion. The operation may or may not still be affine---I don't have any coffee yet---but it will for sure still be a single, simple matrix.

There may be other cases of interest to you in between but the final level of complexity is generally the "rubber sheeting" algorithm. This involves 'arbitrary' distortion. You ask the user to define an arbitrary number of anchor point pairs, one on the image and one on the map, and then the algorithm uses a series of matrices applied piecewise to the image. There you should follow the work of Jan Jesek since he's got working code for two vector layers (rather than images).

While your UI could simply allow a user to define anchor points and decide which alogrithm to use based on the number of points, that approach would not allow a user to over-determine the number of points used for a low-distortional algorithm which is a common need for professional work.

good luck on the effort,
--adrian

Jody Garnett wrote:
Some of this has been done:- The flightline project allowed the positioning
of images (using udig as a base)
http://udig.refractions.net/files/downloads/flightline/
- A SoC project focused on defining a MathTransform using some fun math and
a series of before/after points
- The JAI examples have a nice warm

Cheers,
Jody

Jody

On Tue, Nov 11, 2008 at 8:56 AM, Graham Davis <gdavis@xxxxxxxxxxxxxxx>wrote:

Hi,

I'm looking into making a small module in uDig for image manipulation.
 Basically my client wants to take an aerial photo and place it overtop of a
satellite base layer.  They want to be able to manually manipulate this
photo and visually fit it onto the correct spot of the map.  The
manipulation they want to be able to achieve includes shrinking/growing the
image, rotating it and morphing it to align correctly.  Ideally this would
be done in real-time with the user manipulating  the image with their mouse
and maybe some numerical input.  Once the user is satisfied with their
approximate placement, they can "lock it in" at which point I will save the
resulting image and its coordinates as a geotiff.

I am currently looking at JAI and GDAL to see if these sorts of image
manipulation functions are available.  I haven't used either library very
extensively, so it is pretty new to me.  The GDAL documentation seems to be
pretty light in general (at least for Java and GeoTools).  I've only found
these resources:

- http://docs.codehaus.org/display/GEOTOOLS/ImageIO-EXT+GDAL
- http://trac.osgeo.org/gdal/wiki/GdalOgrInJava

Does anyone know of other helpful resources that I could use for this
project?  Are there any uDig modules that currently do anything like this,
with example code I could look at?  Or perhaps someone has some suggestions
for how I might approach this so that it fits nicely with current uDig
designs?  If this functionality sounds useful to others, I'm all for trying
to make this module "official".  Thanks,

--
Graham Davis
Refractions Research Inc.
gdavis@xxxxxxxxxxxxxxx

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel


------------------------------------------------------------------------

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel



Back to the top