Skip to content

Commit

Permalink
Added unknown region
Browse files Browse the repository at this point in the history
  • Loading branch information
herrtunante committed Jun 25, 2024
1 parent fe4a4e9 commit 7830a87
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public class IPCCDataExportTimeSeriesToTool extends AbstractIPCCDataExport {
private static final String SUBDIVISION_AUX = "SUBDIV_AUX";

private static final String NO_SUBDIVISION = "-1";

private static final String UNKNOWN_REGION = "Unknown";

@Autowired
private IPCCLandUses ipccLandUses;
Expand Down Expand Up @@ -448,7 +450,12 @@ private LrtRegions getLrtRegions() {
@Override
public LrtRegion mapRow(ResultSet rs, int rowNum) throws SQLException {

String regionName = rs.getString( getStratifyByRegion() ).replaceAll("'", ""); // remove single quotes that can cause errors when importing to IPCC
String regionName = rs.getString( getStratifyByRegion() );

if( regionName == null || regionName.trim().isEmpty() ) {
regionName = UNKNOWN_REGION;
}
regionName = regionName.replaceAll("'", ""); // remove single quotes that can cause errors when importing to IPCC
Double area = Precision.round( rs.getDouble( SUM_EXPANSION_FACTOR ), AREA_PRECISION ) ;

LrtRegion lrtRegion = new LrtRegion();
Expand Down

0 comments on commit 7830a87

Please sign in to comment.