aX[i] = fl_x.get(i);
aY[i] = fl_y.get(i);
}
// Create the zone
temp.setZone(new ZoneNPoly(aX, aY, minZ, maxZ));
}
else
{
_log.warning("ZoneData: Bad sql data for zone: " + zoneId);
statement.close();
rset.close();
continue;
}
fl_x = null;
}
else
{
_log.warning("ZoneData: Unknown shape: " + zoneShape);
statement.close();
rset.close();
continue;
}
statement.close();
rset.close();
statement = null;
rset = null;
}
catch(Exception e)
{
if(Config.ENABLE_ALL_EXCEPTIONS)
e.printStackTrace();
_log.warning("ZoneData: Failed to load zone coordinates: " + e);
}
}else{ //use file one
// Create this zone. Parsing for cuboids is a
// bit different than for other polygons
// cuboids need exactly 2 points to be defined.
// Other polygons need at least 3 (one per
// vertex)
if (zoneShape.equalsIgnoreCase("Cuboid"))
{
if (coords.length == 2)
temp.setZone(new ZoneCuboid(coords[0][0], coords[1][0], coords[0][1], coords[1][1], minZ, maxZ));
else
{
_log.warning("ZoneData: Missing cuboid vertex in sql data for zone: " + zoneId);
continue;
}
}
else if (zoneShape.equalsIgnoreCase("NPoly"))
{
// nPoly needs to have at least 3 vertices
if (coords.length > 2)
{
final int[] aX = new int[coords.length];
final int[] aY = new int[coords.length];
for (int i = 0; i < coords.length; i++)
{
aX[i] = coords[i][0];
aY[i] = coords[i][1];
}
temp.setZone(new ZoneNPoly(aX, aY, minZ, maxZ));
}
else
{
_log.warning("ZoneData: Bad data for zone: " + zoneId);
continue;