Due to the current gap in continued funding from the U.S. National Science Foundation (NSF), the NSF Unidata Program Center has temporarily paused most operations. See NSF Unidata Pause in Most Operations for details.
Hi Andrea- I haven't been following this thread too closely, but I have a few comments. Andrea Antonello wrote:
Bill, thanks for that. The lightbulb in my head finally lit up. 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). 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.
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.
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). Don ************************************************************* Don Murray UCAR Unidata Program dmurray@xxxxxxxxxxxxxxxx P.O. Box 3000 (303) 497-8628 Boulder, CO 80307 http://www.unidata.ucar.edu/staff/donm ************************************************************* ============================================================================== To unsubscribe visad, visit: http://www.unidata.ucar.edu/mailing-list-delete-form.html ==============================================================================
visad
archives: