|
From: Justin D. <jde...@op...> - 2010-10-02 17:45:57
|
On Sat, Oct 2, 2010 at 11:34 AM, Andrea Aime <and...@ge...>wrote: > On Sat, Oct 2, 2010 at 6:12 PM, Justin Deoliveira <jde...@op...> > wrote: > > Yeah, unfortunately this is a nasty issue. Rob has had this issue before > as > > well. > > On the encoding front the plan was to instead of create a geometry not as > a > > jts geometry but as a generic complex attribute. And then have the > encoding > > subsystem ignore the regular geometry binding (since it is not a geometry > > object) and encode it (along with the metadta) as a generic complex > > attribute. > > Wow wow, slow down a little. This seems like a nice idea but I've lost you > at the beginning of the sentence :-) > > So say in the database I store something like: > > <GeometryWithMetadata> > <myMetadata>... > <myGeometry>... > </GeometryWithMetadata> > > How do I go then to turn it into a GML geometry with with metadata like: > > <gml:Polygon> > <gml:metaDataProperty> > <gml:GenericMetaData> > <extention> > <area uom="m2">8476875.000000</area> > <length uom="m">108.706000</length> > <width uom="m">13.863100</width> > </extention> > </gml:GenericMetaData> > </gml:metaDataProperty> > <gml:exterior> > <gml:LinearRing> > <gml:posList> > 31.214218 43.833347 31.215328 43.833862 31.216240 43.833717 ... > </gml:posList> > </gml:LinearRing> > </gml:exterior> > </gml:Polygon> > > Do you have some code skeleton I can follow? > Again this is just an idea at this point but the idea would be to represent the geometry fully via the geotools feature model rather than a JTS geometry. So in very rough pseudo code: ComplexAttribute genericMetaData = createComplexAttribute(...) ComplexAttribute metadataProperty = createComplexAttribugte(..., genericMetadata) ... ComplexAttribute exterior = createCompexAttribute(...) ComplexAttribute polygon = createComplexAttribute(..., metadataProperty, polygon) And then pass the "polygon: ComplexAttribute to the encoder. And because the polygon is not a jts object the regualr GMLPolygonBinding would not execute. INstead processing would move up the binding chain to a binding that can generically encode any ComplexAttribute instance. Does that make any sense? > > The parsing front is much harder as Andrea noted. What has been done in > the > > past for cases like this and what I think the app-schema folks do is use > the > > geometry user data as Andrea noted. But storing a map there that can > store > > anything from the crs to this generic metadata. A hack to me sure but not > > sure we have much else. Unless we introduced some sort of geometry > wrapper > > that stored all the metadata explicitly. > > All in all rolling your own parser is probably better for your sanity > since > > the parsing story for complex features is not quite there yet when > compared > > to the encoding story. > > Cool > > Cheers > Andrea > > > -- > ----------------------------------------------------- > Ing. Andrea Aime > Senior Software Engineer > > GeoSolutions S.A.S. > Via Poggio alle Viti 1187 > 55054 Massarosa (LU) > Italy > > phone: +39 0584962313 > fax: +39 0584962313 > > http://www.geo-solutions.it > http://geo-solutions.blogspot.com/ > http://www.linkedin.com/in/andreaaime > http://twitter.com/geowolf > > ----------------------------------------------------- > -- Justin Deoliveira OpenGeo - http://opengeo.org Enterprise support for open source geospatial. |