Re: orthophoto over dem

Hi Don, 

> >I made a small adaption to the GIFAdaptor to take care of the
> >positioning in the geographic space.
> >At that point the combining of the FlatFields worked flawless.
> 
> I would avoid making changes to the GIFAdapter. Instead,
> read in your image, create the appropriate coordinate system,
> then create a new domain set with the coordinate system and
> then a new FlatField with the new domain:
> 
>     FlatField ff = GIFAdapter.getData();
>     Linear2DSet domain = (Linear2DSet) ff.getDomainSet();
>     RealTupleType domainType = ((SetType)domain.getType()).getDomain();
>     // make the coordinate system - coordsys
>     RealTupleType newType
>        new RealTupleType(
>             domainType.getRealComponents(), coordsys, null);
>     Linear2DSet newDomain
>            new Linear2DSet(newType,
>                new Linear1DSet[] {domain.getX(), domain.getY()});
>     FunctionType newFType
>       new FunctionType(newType,
>           ((FunctionType)ff.getType()).getRange());
>     FlatField ffWithCS = new FlatField(newFType, newDomain);
>     ffWithCS.setSamples(ff.getSamples(false), false);
> 
> (note I haven't compiled the above, but it should give you
> the idea).


Agreed. I also prefer to not change basecode.
I tried to use your code, but the thing doesn't work. The
CoordinateSystem (which is simply a translation system) is not 
called for some reason. I'm a bit confused. I guess it is because of
what Bill said in his last post.

> BTW, the Unidata IDV (http://www.unidata.ucar.edu/software/idv)
> already has functionality to overlay images on topography like
> you are trying to do.  It basically uses the same technique
> above with Bill's combine method.  An example exercise is
> available in our Training Workshop:
> 
> http://www.unidata.ucar.edu/software/IDV/docs/workshop/datadisplays/gis/DEM.html
> 
> using an image from a web map server and a USGS DEM.

Yeah, I tried IDV and it is a great tool. I dreamed it would have been
possible to use that one in JGrass because it is a really advanced tool.

> >I put the result and the code here: 
> >http://www.jgrass.org/cgi-bin/moin.cgi/HowItIsGoingWithVisad
> >
> >There will be need for optimization of the code, but it works.
> 
> It looks like the JGrass project is doing some nice work.

Regarding hydrology and geomorphology I would say yes. We have a heel of
Achilles which is the displaying system, which we are now trying to
substitute. If someone has ideas, advices are very welcome, we are still
prototyping (offlist, since that would probably be sightly offtopic here). 

> >I found that image is read flipped against the geographic position, so I
> >did a workaround on the colorarrays.
> >Has anyone a better solution for the flipping?
> 
> I'm guessing that you have your CS backwards (line and element
> interchanged).

Hum? Wouldn't that just transpose the image? Mine is mirrored upside
down.

Andrea

==============================================================================
To unsubscribe visad, visit:
http://www.unidata.ucar.edu/mailing-list-delete-form.html
==============================================================================