15 |
import org.apache.log4j.Logger; |
import org.apache.log4j.Logger; |
16 |
import org.geotools.data.FeatureSource; |
import org.geotools.data.FeatureSource; |
17 |
import org.geotools.feature.AttributeType; |
import org.geotools.feature.AttributeType; |
18 |
|
import org.geotools.feature.FeatureCollection; |
19 |
import org.geotools.styling.Style; |
import org.geotools.styling.Style; |
20 |
import org.opengis.referencing.crs.CoordinateReferenceSystem; |
import org.opengis.referencing.crs.CoordinateReferenceSystem; |
21 |
|
|
214 |
|
|
215 |
/** |
/** |
216 |
* @return The {@link File} where the SLD was loaded from or |
* @return The {@link File} where the SLD was loaded from or |
217 |
* <code>null</code> if there didn't exist a {@link File}. (It could |
* <code>null</code> if there didn't exist a {@link File}. |
|
* be a WFS or a PostGIS |
|
218 |
* |
* |
219 |
* @author <a href="mailto:[email protected]">Stefan Alfons |
* @author <a href="mailto:[email protected]">Stefan Alfons |
220 |
* Krüger</a> |
* Krüger</a> |
227 |
this.sldFile = sldFile; |
this.sldFile = sldFile; |
228 |
} |
} |
229 |
|
|
230 |
|
/** |
231 |
|
* Returns the features of the {@link FeatureSource}. |
232 |
|
* |
233 |
|
* @see {@link StyledFeaturesInterface} |
234 |
|
*/ |
235 |
|
@Override |
236 |
|
public FeatureCollection getFeatureCollection() { |
237 |
|
FeatureCollection features; |
238 |
|
try { |
239 |
|
features = getGeoObject().getFeatures(); |
240 |
|
} catch (IOException e) { |
241 |
|
throw new RuntimeException( |
242 |
|
"Error getting the features of the FeatureSource"); |
243 |
|
} |
244 |
|
return features; |
245 |
|
} |
246 |
|
|
247 |
|
/** |
248 |
|
* Same as {@link #getGeoObject()} method, but complies to the |
249 |
|
* {@link StyledFeaturesInterface} |
250 |
|
* |
251 |
|
* @see {@link StyledFeaturesInterface} |
252 |
|
*/ |
253 |
|
@Override |
254 |
|
public FeatureSource getFeatureSource() { |
255 |
|
return getGeoObject(); |
256 |
|
} |
257 |
|
|
258 |
} |
} |