As from Monday's meeting, there is a small detail on how to handle linearization so that touching circular arcs line up.
If you just take a set number of steps (say 32) between your start and end arc points you end up with situation shown. The "longer" arc will have longer line segments (and not line up with the coordinates generated for the shorter arc). Solution Mark and I came up with was to always calculate the generated coordinates based on the great circle. End up with a short line segment from the start point, consistent generated curvature for the coordinates of the arc, and a shorter line segment to the end point. Downside is that the middle control point may not end up being exactly on the generated arc. Note if you really wanted to you could take the pixel size into account and generate the curve to the correct tolerance for display (so control point and generated line fall within the same pixel. On Mon, May 27, 2013 at 7:15 PM, Andrea Aime <andrea.a...@geo-solutions.it>wrote: > Hi, > I am looking into end-to-end support for circular arcs in GeoTools. > > The requirement would be to take a circular arc from the data source (SQL > Server 2012 in this case, > http://msdn.microsoft.com/en-us/library/ff929141.aspx), and maintain the > data in its native form until it can be encoded in GML with the proper > circular arc encoding. > > The first thing is being able to parse the circular string from the > database. > SQLServer comes with two flavours, WKB and native geometry readers. > The native geometry reader should be easily fixed, the WKB one instead is > a bit annoying in that it seems it cannot be subclassed, as it's fully of > private methods. > > For the latter I've cc'ed Martin Davis. Martin, is it ok to make a copy of > the WKBReader in GeoTools, keeping both the original copyright header and > the GeoTools one? The license is the same. > For the future, if all the private methods could be made protected, that > would allow me to do some cleaner subclassing without having to copy > everything around (ah mind, I'm still in the evaluate and negotiate phase, > funding for this is still not secured). > > Geometry support wise my current line of thinking would be to create a > GeoTools specific CircularString class, which extends LineString, and > actually wraps two things: > * a org.geotools.gml3.Circle.Arc object, that provides a way to represent > circular arcs and linearize them, which would be moved to the api module, > org.geotools.jts.geometry package (more on this later) > * an optional, created on demand LineString object, to which most of the > methods would be delegated > The CircularString would have a configurable linearization tolerance among > its fields. > > This way code that does not know about CircularString could be able to > just move on and treat the thing as a vanilla LineString (including the map > rendering code), while code that actually knows what we're talking about > could extract the Arc and play with it. > > As for the position in the api module, the reason is that I'd like to make > some special case for circle when reprojecting: in WFS we often have to > just flip coordinates in order to generate the output, while a general > transformation will stretch the circular arc making it no more one, plain > axis flipping could be done without breaking its circular nature. And the > code doing geometry transformations is in that package, hence the need to > put the CircularString there. > > Opinions? > > 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 > > ------------------------------------------------------- > > > ------------------------------------------------------------------------------ > Try New Relic Now & We'll Send You this Cool Shirt > New Relic is the only SaaS-based application performance monitoring service > that delivers powerful full stack analytics. Optimize and monitor your > browser, app, & servers with just a few lines of code. Try New Relic > and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may > _______________________________________________ > GeoTools-Devel mailing list > GeoTools-Devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geotools-devel > >
<<attachment: arc.png>>
------------------------------------------------------------------------------ Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET Get 100% visibility into your production application - at no cost. Code-level diagnostics for performance bottlenecks with <2% overhead Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________ GeoTools-Devel mailing list GeoTools-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel