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

Reply via email to