Re: [Simple-support] simple xml with jts geometry classes?
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2008-05-13 17:48:30
|
Hi, To do what you are saying you will have to modify the Transformer class to add the types you mention. I have been trying to improve this situation and have already started working on an XML format to specify annotations, where you do not directly have access to the source code to annotated, or if you just want to keep your code and the XML serialization format separate. This should be complete soon enough, it is currently in a branch in the SVN repository. However it is not in a state that can be used as of yet. Niall --- Marten Bauer <mar...@go...> wrote: > Hello, > > I want to use simple xml to serialize my classes to > xml. > The project deals with geo information systems and > therefore we are using geometry classes of jts (java > topology suite, > http://www.vividsolutions.com/jts/jtshome.htm). > > How can I serialize this instances (classes)? > > My idea was to write my own transform class like > (code is written out of my brain!): > > class jtsGeomTransform implements > Transform<Geometry>{ > public String write(Geometry geom){ > return wktwriter.write(geom); > } > > pulbic Geometry read(String wkt){ > return wktreader.read(wkt); > } > } > > Where wktwriter/wktreader are parts of jts and > convert geometry > instances into Strings known as "well known text" > and back. The other > classes like LineString, Polygon, Point, > MultiLineString, MultiPolygon > are all derived from Geometry. > > Questions: > 1. Is this the recommend way to solve my problem? > 2. How can/must I add my transform classes to the > Persister? > > Thx for helping > Marten > > > ------------------------------------------------------------------------- > 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/ > _______________________________________________ > Simple-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simple-support > |