* @return an map context with generated test data.
*/
public MapContext createExampleMap()
{
// TODO: Read up on Coordinate Reference System, and pass one to the constructor below:
final MapContext exampleMap = new DefaultMapContext();
// Some random height coverage data
// TODO
// Some random roads
// TODO
// Some random lakes and rivers
// TODO
// Some random cities containing building polygons
// TODO
// Some random coverage color (population density?)
// TODO
try
{
//AttributeType geom = AttributeTypeFactory.newAttributeType("the_geom", Point.class);
AttributeType geom = AttributeTypeFactory.newAttributeType( "the_geom", LineString.class );
AttributeType roadWidth = AttributeTypeFactory.newAttributeType( "width", Float.class );
FeatureType ftRoad = FeatureTypes.newFeatureType( new AttributeType[]{ geom, roadWidth }, "road" );
WKTReader wktReader = new WKTReader();
//Point geometry = (Point) wktReader.read("POINT (" + lat + " " + lon + ")");
LineString geometry = (LineString) wktReader.read( "LINESTRING (0 0, 10 10, 10 20, 20 30, 10 40, 15 50)" );
Float width = new Float( 10 );
Feature theRoad = ftRoad.create( new Object[]{ geometry, width }, "myRoad" );
System.out.println( theRoad );
final FeatureCollection featureCollection = new DefaultFeatureCollection( "roads", ftRoad );
featureCollection.add( theRoad );
exampleMap.addLayer( new DefaultMapLayer( featureCollection, new BasicLineStyle() ) );
System.out.println( "exampleMap = " + exampleMap );
}
catch ( SchemaException e )
{