60 |
* This class enables a non Atlas context to use the Atlas LayerPanel |
* This class enables a non Atlas context to use the Atlas LayerPanel |
61 |
* {@link JPanel} as a {@link MapContextManagerInterface} |
* {@link JPanel} as a {@link MapContextManagerInterface} |
62 |
* |
* |
63 |
* @author <a href="mailto:[email protected]">Stefan Alfons Krüger</a> |
* @author <a href="mailto:[email protected]">Stefan Alfons Tzeggai</a> |
64 |
* |
* |
65 |
* TODO Rename to StyledShapefile |
* TODO Rename to StyledShapefile |
66 |
*/ |
*/ |
156 |
public CoordinateReferenceSystem getCrs() { |
public CoordinateReferenceSystem getCrs() { |
157 |
if (crs == null) { |
if (crs == null) { |
158 |
crs = fs.getSchema().getCoordinateReferenceSystem(); |
crs = fs.getSchema().getCoordinateReferenceSystem(); |
159 |
if (fs.getSchema().getCoordinateReferenceSystem() == null) { |
if (crs == null) { |
160 |
LOGGER.warn("Could not determine the CRS of " + getTitle() |
|
161 |
+ ". Using default " + GeoImportUtil.getDefaultCRS()); |
crs = fs.getSchema().getGeometryDescriptor() |
162 |
crs = GeoImportUtil.getDefaultCRS(); |
.getCoordinateReferenceSystem(); |
163 |
|
|
164 |
|
if (crs == null) { |
165 |
|
LOGGER.warn("Could not determine the CRS of " + getTitle() |
166 |
|
+ ". Using default " |
167 |
|
+ GeoImportUtil.getDefaultCRS()); |
168 |
|
crs = GeoImportUtil.getDefaultCRS(); |
169 |
|
} |
170 |
} |
} |
171 |
} |
} |
172 |
return crs; |
return crs; |
299 |
* @return The {@link File} where the SLD was loaded from or |
* @return The {@link File} where the SLD was loaded from or |
300 |
* <code>null</code> if there didn't exist a {@link File}. |
* <code>null</code> if there didn't exist a {@link File}. |
301 |
* |
* |
302 |
* @author <a href="mailto:[email protected]">Stefan Alfons |
* @author <a href="mailto:[email protected]">Stefan Alfons Tzeggai</a> |
|
* Krüger</a> |
|
303 |
*/ |
*/ |
304 |
public File getSldFile() { |
public File getSldFile() { |
305 |
return sldFile; |
return sldFile; |
372 |
/** |
/** |
373 |
* Tries to load a style from the file denoted in {@link #getSldFile()}. If |
* Tries to load a style from the file denoted in {@link #getSldFile()}. If |
374 |
* the file doesn't exits, return <code>null</code>; |
* the file doesn't exits, return <code>null</code>; |
375 |
|
* |
376 |
* @return <code>true</code> is style was loaded |
* @return <code>true</code> is style was loaded |
377 |
*/ |
*/ |
378 |
public boolean loadStyle() { |
public boolean loadStyle() { |
379 |
if (getSldFile() == null) |
if (getSldFile() == null) |
380 |
return false; |
return false; |
381 |
|
|
382 |
try { |
try { |
383 |
Style[] loadSLD = StylingUtil.loadSLD(getSldFile()); |
Style[] loadSLD = StylingUtil.loadSLD(getSldFile()); |
384 |
setStyle(loadSLD[0]); |
setStyle(loadSLD[0]); |