* If we are executing the "crs" sub-command, extract the first CRS.
*/
if (hasUnexpectedFileCount(1, 1)) {
return Command.INVALID_ARGUMENT_EXIT_CODE;
}
final Metadata metadata;
final DataStore store = DataStores.open(files.get(0));
try {
metadata = store.getMetadata();
} finally {
store.close();
}
if (metadata == null) {
return 0;
}
CoordinateReferenceSystem crs = null;
if (isCRS) {
for (final ReferenceSystem rs : metadata.getReferenceSystemInfo()) {
if (rs instanceof CoordinateReferenceSystem) {
crs = (CoordinateReferenceSystem) rs;
break;
}
}