Gabriella Turek ha scritto: > Hello I am forwarding this for a collegue who's having problems > posting to the list. > Thanx > gaby > > -------- Original Message -------- > Subject: Graphics2D and ShapefileDataStore > Date: Fri, 29 Jun 2007 14:00:58 +1200 > From: Yvonne Baeverle <[EMAIL PROTECTED]> > Organization: NIWA > > Hello all, > I need to write a painted Graphics2D ( polygon) into a new shapefile. > Currently I use DataStore for creating a new File and MultiPolygon as > type of the shape, set attributes, create schema and all this stuff > (see code) but of course this new shapefile is empty because I don't > know how I can set the coordinates and write this polygon into the shape.
Ha, you're into a hard business there. It is possible for sure, but you would have to follow the same path iText and Batik followed, that is, roll your own subclass of Graphics2D that gets the shapes to be painted, and instead of painting them somewhere, read them, turn them into JTS geometries, and write them to a shapefile. If you can limit the methods the user will call onto your implementation of Graphics2d you should get away relatively easily, a full implementation is on the other side quite a daunting task. Good luck :) Cheers Andrea ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
