*/
// docs start export2
private void exportToShapefile2() throws Exception {
FeatureType schema = featureSource.getSchema();
String typeName = schema.getName().getLocalPart();
JFileDataStoreChooser chooser = new JFileDataStoreChooser("shp");
chooser.setDialogTitle("Save reprojected shapefile");
chooser.setSaveFile(sourceFile);
int returnVal = chooser.showSaveDialog(null);
if (returnVal != JFileDataStoreChooser.APPROVE_OPTION) {
return;
}
File file = chooser.getSelectedFile();
if (file.equals(sourceFile)) {
JOptionPane.showMessageDialog(null, "Cannot replace " + file, "File warning",
JOptionPane.WARNING_MESSAGE);
return;
}