Hello everyone.

I am render geometry (lineString, polygon, point (of the library jts )) as
follows:

GeometryFactory geomFac = new GeometryFactory();

Coordinate[] polygonCoordinates = new Coordinate[3];
polygonCoordinates[0] = new Coordinate(10, 20);
polygonCoordinates[1] = new Coordinate(30,40);
polygonCoordinates[2] = new Coordinate(10,20);
LinearRing ring = geomFac.createLinearRing(polygonCoordinates);
Polygon polygon = geomFac.createPolygon(ring, null);
StyleFactory sFac = CommonFactoryFinder.getStyleFactory(
GeoTools.getDefaultHints() );
                
StyleFactory styleFactory = CommonFactoryFinder.getStyleFactory(null);

org.geotools.styling.Style style = styleFactory.createStyle();
org.opengis.filter.FilterFactory factory =
CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
PolygonSymbolizer polysym = sFac.createPolygonSymbolizer();
FilterFactory filterFactory = FilterFactoryFinder.createFilterFactory();
Stroke myStroke = sFac.getDefaultStroke();
myStroke.setColor(filterFactory.createLiteralExpression("#000000"));
myStroke.setWidth(filterFactory.createLiteralExpression(new Integer(1)));
polysym.setStroke(myStroke);
Rule ruleLine = sFac.createRule();
ruleLine.setSymbolizers(new Symbolizer[] { polysym });
FeatureTypeStyle fts = sFac.createFeatureTypeStyle();
fts.setRules(new Rule[] { ruleLine });
fts.setFeatureTypeName("circlefeature");
style.addFeatureTypeStyle(fts);


AttributeType[] typesNew = new AttributeType[1];
typesNew[0] = AttributeTypeFactory.newAttributeType("coolection",
curve2.getClass()
, false, 0, null, DefaultGeographicCRS.WGS84);

FeatureType polyType = FeatureTypes.newFeatureType(typesNew,
"circlefeature");
Feature polyFeature = polyType.create(new Object[] { curve2});
FeatureCollection featureCollectionLine =
FeatureCollections.newCollection();
featureCollectionLine.add(polyFeature);

CoordinateReferenceSystem crs = DefaultGeographicCRS.WGS84;
MapContext context = new DefaultMapContext(crs);
MapLayer layer = new DefaultMapLayer(featureCollectionLine,style);
context.addLayer(context.getLayerCount(),layer);
context.setAreaOfInterest(layer.getBounds());
GTRenderer renderer;
        if( true ){ 
                renderer = new StreamingRenderer();
                HashMap hints = new HashMap();
                hints.put("memoryPreloadingEnabled", Boolean.TRUE);
            renderer.setRendererHints( hints );
        }
        else {
                renderer = new StreamingRenderer();
                HashMap hints = new HashMap();
                hints.put("memoryPreloadingEnabled", Boolean.FALSE);
            renderer.setRendererHints( hints );
        }
        renderer.setContext(context);
        mp.setRenderer(renderer);
        mp.setContext(context);
        mp.setMapArea(layer.getBounds());
        frame.repaint();
        frame.doLayout();


Cuestion:

this is my example to render linestring, polygon, circle... 
but i have to render arc (calcula arc 3 coordinate: center, point1 ,
point2).

help,

Could anyone please give me some pointers? 
Thank you,
-- 
View this message in context: 
http://www.nabble.com/Geometry-Arc-tp17226907p17226907.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to