Mark,
There doesn't appear to be any Individual Values thematic "out of the box", but
it can be done in a round-about sort of way using the IDSelectionTheme
interface. The basic approach is a two-step process:
Step 1: Create a recordset using a Group By on the column you want to create
the individual values theme on.
Step 2: For each record in the recordset, create a recordset for all records
in your table that have the same value of your column. Create a new
IDSelectionTheme object for all of the features in this recordset.
Here's some sample code that I've just been working on. It connects to an
Oracle database to get the data (it's using point data):
private void applyIndividualRenditions(Layer layer, String table,
String column, String whereColumn, String whereValue)
{
try
{
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
conn = DriverManager.getConnection(
"jdbc:oracle:thin:@charon:1521:ORCL1","SYSTEM","manager");
Statement statement = conn.createStatement();
//get all of the individual values from the table
ResultSet rs = statement.executeQuery(
"select " + column + " from " + table +
" where " + whereColumn + "='" + whereValue + "' " +
" group by " + column);
//loop through each individual value
while(rs.next())
{
//create the theme using the value from the recordset as the name
IDSelectionTheme theme = new
IDSelectionTheme(rs.getString(column));
PrimaryKey pkey;
//get all features that have the current value for the column
FeatureSet feats = layer.searchByAttribute(null, column,
new Attribute(rs.getString(column)), null);
Feature f = feats.getNextFeature();
//create a random color for the symbol
Rendition rend = new Rendition();
int r, g, b;
r = (int)(Math.random() * 255);
g = (int)(Math.random() * 255);
b = (int)(Math.random() * 255);
Color c = new Color(r, g, b);
rend.setValue(rend.SYMBOL_COLOR, c);
//add each feature in the featureset to the theme
while(f != null)
{
pkey = f.getPrimaryKey();
theme.add(pkey, rend);
f = feats.getNextFeature();
}
layer.getThemeList().add(theme);
}
rs.close();
}
catch (Exception e)
{
e.printStackTrace();
}
}
"Crompton, Mark" wrote:
> Hi All,
>
> I know that there are not many MapXtreme experts out there, but if anyone
> can help I would appreciate it. So far I have worked through all the
> examples, and can Thematically Map my own data. BUT... I can only Map BY
> RANGE. Is it possible using MapXtreme Java V2 to map by individual values,
> or set the ranges manually? The CreateRangedTheme method only appears to
> allow 3 different variations (EQUAL_RANGE, EQUAL_NUM and STANDARD_DEV).
> Reading the documentation (what little is provided) there appears a way to
> use the BIN methods to change ranges, BUT HOW???
>
> Any help would be appreciated, Thanks
> Mark Crompton
> ----------------------------------------------------------------------
> To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
> "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]