CIP-Students RIU wrote:
Hi Cory, I need add the image not in the Application, else by code, it's mean
that I'm programming an Application based in Udig, and I have images(maps) that
I need georeference its, I have created the world file, but I don't know add
the image in the map...thanks
Okay, here are the steps as I know them:
- Create an IGeoResource from your image
- Create a Layer from your IGeoResource
- Add the Layer to the Map
I will let Jesse explain how to create the IGeoResource -- ultimately
you want an instance of WorldImageGeoResourceImpl, but this is an
internal class, so there would be a better way to obtain it...
As for the last steps:
Create a layer from the IGeoResource:
IGeoResource pngGeoResource;
ILayer layer = pngGeoResource.resolve(ILayer.class, null);
Obtain the map:
ApplicationGIS.getProjects().get(0).getElements(IMap.class).get(0)
http://udig.refractions.net/confluence/display/DEV/How+can+I+find+what+maps+and+projects+are+currently+available%3F
To add the layer to the map:
map.sendCommandASync(new AddLayerCommand(layer) );
http://udig.refractions.net/confluence/display/DEV/How+do+I+add+a+layer+progammatically%3F
Cheers,
Cory.
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel