|
From: Andrea A. <and...@al...> - 2004-05-24 19:33:06
|
Alle 20:27, luned=EC 24 maggio 2004, Victor ha scritto:
> Hi,
>
> I"ve little problems to draw a MultiPoint geometry, when I try to drawn
> a MultiPoint geometry in my shapefile my program shows only one Point
> geometry (in this case the last), Is there a problem in my source code?
>
> Mark redCircle =3D sb.createMark(StyleBuilder.MARK_CIRCLE, Color.RED,
> Color.BLACK, 0);
> Graphic graphPoint =3D sb.createGraphic(null, redCircle, null);
> AttributeType geom =3D AttributeTypeFactory.newAttributeType("the_geom",
> MultiPoint.class);
> FeatureType ftRoad =3D FeatureTypeFactory.newFeatureType(new
> AttributeType[] {geom}, "road");
> PointSymbolizer psPoint =3D sb.createPointSymbolizer(graphPoint);
> Style stylePoint =3D sb.createStyle(psPoint);
>
> WKTReader wktReader =3D new WKTReader();
> MultiPoint geometry =3D (MultiPoint) wktReader.read("MULTIPOINT
> (-45.90500 -23.23700,-45.92500 -23.23700, -45.92500 -23.24700)");
>
> Feature theRoad =3D ftRoad.create(new Object[] {geometry}, "myRoad");
>
> FeatureCollection fc =3D DefaultFeatureCollections.newCollection();
> fc.add(theRoad);
> MapLayer myLayer =3D new DefaultMapLayer(fc,stylePoint);
> MapContext map =3D new DefaultMapContext();
> map.addLayer(myLayer);
No, it seems to me a bug in the code... by the way, which renderer are you
using? Sorry for the late response, I'm a bit overloaded...
Best regards
Andrea Aime
|