On Thu, May 30, 2013 at 10:06 AM, Andrea Aime
<andrea.a...@geo-solutions.it>wrote:
> The GML2 model does not have any curved arc notion, so that's easy.
> The GML3 model has a number instead:
> * CircleByCenterPoint: this one we cannot represent as is with the work
> I'm going to do, but it could be turned into
> an equivalent circle
> * Circle, which is represented by its 3 points, and which would have to be
> represented by two arcs in spatial databases
> * ArcString, whose interpolation attribute is fixed to circularArc3Points
> * MultiCurve, which is made of either straight of curved elements
> * Polygon, whose internal structure can be made of either LinearRing or
> Ring objects, the latter allowing for curved elements
>
> So, trying to do a logical mapping:
> 1) a circularstring made of just one arc is mapped to one ArcString
> 2) a circularstring made of more elements is mapped to a MultiCurve made
> solely of ArcString, or a Ring made solely of ArcString
> if it's closed, or a Circle if the elements are actually only two and
> representing a string
> 4) a compoundcurve should map into a MultiCurve automatically (as an
> instance of LineString)
> 5) a polygon should automatically split into its elements, same as 4)
>
> I believe 1) and 2) are problematic with the design of the GML3 encoder?
> If it was a TranslatorBase kind it would
> trivial to implement that logic, but with the way bindings are processed
> in gt-xsd I would honestly don't know
> how to proceed, apparently it pretends a 1-1 matching between java class
> and xml element?
> It seems to me that given a general CircularString with more than one
> element, we need to map it to a MultiLineString,
> whose elements are Arc objects (a subclass of LineString) which is an arc
> by 3 points, and then modify ArcBinding
> to bind to those objects?
> And for polygons I guess a Ring class would be needed, subclass of
> LinearRing, that also linearizes automatically,
> that would be used in RingBinding?
>
> The above is annoying, as the GML encoder limitations would percolate down
> into the geometry representation, limiting it.
>
Am I missing something? Having a CircularString extends MultiLineString and
Ring extends LinearRing is
not going to be the end of the world, but I'd like to see if there are
better options.
I also thought about some sort of feature collection wrapper that
dynamically turns the above JTS objects into
custom GML objects to be used by the encoder alone, and we' have to wrap
the collection every time it has
to be encoded. But it seems like an ugly band aid, and one would have to
know the wrapping is necessary
(thinking about people using the geotools Encoder API directly here)
Cheers
Andrea
--
==
GeoServer training in Milan, 6th & 7th June 2013! Visit
http://geoserver.geo-solutions.it for more information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel