Revision 12546 trunk/extensions/extGeoreferencing/src/org/gvsig/georeferencing/utils/GeoLayerFactory.java
GeoLayerFactory.java | ||
---|---|---|
22 | 22 |
import java.io.File; |
23 | 23 |
|
24 | 24 |
import org.cresques.cts.IProjection; |
25 |
import org.gvsig.fmap.raster.layers.FLyrRasterSE; |
|
25 | 26 |
import org.gvsig.georeferencing.GeoreferencingToolsModule; |
26 | 27 |
import org.gvsig.georeferencing.gui.dialog.GeoreferencingDialog; |
27 | 28 |
|
... | ... | |
32 | 33 |
import com.iver.cit.gvsig.fmap.drivers.RasterDriver; |
33 | 34 |
import com.iver.cit.gvsig.fmap.layers.FLyrGeoRaster; |
34 | 35 |
import com.iver.cit.gvsig.fmap.layers.FLyrPoints; |
35 |
import com.iver.cit.gvsig.fmap.layers.FLyrRaster; |
|
36 | 36 |
import com.iver.cit.gvsig.fmap.layers.RasterAdapter; |
37 | 37 |
import com.iver.cit.gvsig.fmap.layers.RasterFileAdapter; |
38 | 38 |
import com.iver.cit.gvsig.project.documents.view.gui.View; |
... | ... | |
45 | 45 |
*/ |
46 | 46 |
public class GeoLayerFactory{ |
47 | 47 |
|
48 |
//**********************Params******************************** |
|
49 |
|
|
50 |
//**********************End Params**************************** |
|
51 |
|
|
52 |
//**********************Vars********************************** |
|
53 |
|
|
54 |
//**********************End Vars********************************** |
|
55 |
|
|
56 |
//**********************Classes*********************************** |
|
57 |
|
|
58 |
//**********************End Classes******************************* |
|
59 |
|
|
60 |
//**********************Methods*********************************** |
|
61 |
|
|
62 |
|
|
63 | 48 |
/** |
64 | 49 |
* Crea una capa FLyrPoints a partir de los par?metros de entrada. |
65 | 50 |
* @param lyGeoRaster Capa a georreferenciar |
... | ... | |
132 | 117 |
* |
133 | 118 |
* @throws DriverIOException |
134 | 119 |
*/ |
135 |
public static FLyrGeoRaster createLayer(String layerName, RasterDriver d, |
|
136 |
File f, IProjection proj, double widthPxImg, double heightPxImg) throws LoadLayerException { |
|
137 |
RasterAdapter adapter = new RasterFileAdapter(f); |
|
138 |
adapter.setDriver(d); |
|
120 |
public static FLyrGeoRaster createLayer(String layerName, Object params, |
|
121 |
IProjection proj, double widthPxImg, double heightPxImg) throws LoadLayerException { |
|
139 | 122 |
GeoPointPersistence geoPointPersistence = new GeoPointPersistence(); |
140 | 123 |
StackZoom zoom = new StackZoom(); |
141 | 124 |
FLyrGeoRaster lyrGeoRaster = new FLyrGeoRaster(geoPointPersistence, zoom); |
... | ... | |
143 | 126 |
|
144 | 127 |
if (lyrGeoRaster != null) { |
145 | 128 |
lyrGeoRaster.setName(layerName); |
146 |
lyrGeoRaster.setSource(adapter);
|
|
129 |
lyrGeoRaster.setLoadParams(params);
|
|
147 | 130 |
lyrGeoRaster.setProjection(proj); |
148 | 131 |
lyrGeoRaster.setImageDimension(widthPxImg, heightPxImg); |
149 | 132 |
lyrGeoRaster.load(); |
... | ... | |
166 | 149 |
* |
167 | 150 |
* @throws DriverIOException |
168 | 151 |
*/ |
169 |
public static FLyrRaster createLayer(String layerName, RasterDriver d, |
|
170 |
File f, IProjection proj) throws LoadLayerException { |
|
171 |
RasterAdapter adapter = new RasterFileAdapter(f); |
|
172 |
adapter.setDriver(d); |
|
173 |
|
|
174 |
FLyrRaster capa = new FLyrRaster(); |
|
152 |
public static FLyrRasterSE createLayer(String layerName, Object params, |
|
153 |
IProjection proj) throws LoadLayerException { |
|
154 |
FLyrRasterSE capa = new FLyrRasterSE(); |
|
155 |
capa.setLoadParams(params); |
|
175 | 156 |
capa.setName(layerName); |
176 |
|
|
177 |
capa.setSource(adapter); |
|
178 | 157 |
capa.setProjection(proj); |
179 | 158 |
capa.load(); |
180 |
|
|
181 | 159 |
return capa; |
182 | 160 |
} |
183 | 161 |
//**********************End Methods******************************** |
Also available in: Unified diff