[postgis-devel] Re: [postgis-users] postgis.jar file does not contain latest geometry types

Markus Schaber schabi at logix-tt.com
Thu Dec 14 02:12:47 PST 2006

Hi, Ken,

Ken Southerland <southerland at samsix.com> wrote:

> > The problem I see right off the bat here is that GeneralPath does not have
> > an arcTo() method and the only curve that is implemented currently in the
> > new postgis is an arc. 

The reason for the latter is that the ISO MM spec only contains arcs.

> > Sheesh.  I'm almost thinking about cheating (not
> > with the official java2d mapping but with my own mapping) and just
> > pretending like the arc stored is really a Quadratic Curve.

You can also investigate[1] and mimic how java.awt.geom.Arc2D and
java.awt.geom.Ellipse2D map their geometries into PathIterator
primitives. Maybe you need several java2d Path segments for a ISO MM
segment that contains a full circle, but at least a lossless geometric
mapping should be possible.

> Let me know if this discussion is best for the devel list in general.  Having 
> just joined I don't know the protocol just yet.  And let me know if I'm being 
> too pesky.  :)

Yes, it's best do discuss this on the devel list, so I Cc'ed it.

> So, I have an answer for my own issue.  The batik project 
> (http://xmlgraphics.apache.org/batik/) has 
> org.apache.batik.ext.awt.geom.ExtendedGeneralPath class which extends 
> GeneralPath by simply adding an arcTo() method to it!  Not surprisingly 
> someone has already run into this problem.

But the main reason why they extended the GeneralPath model is that
they need 

> What is your feeling about requiring the java2d mapping to depend on the batik 
> project in order to make use of this feature.  They nicely have their jar 
> files all broken up into small chunks and the one needed here 
> (batik-awt-util.jar) is only 361K.

I would prefer to stay without batik if possible, because I don't want
to pull in other build dependencies.


[1] SUN's jdk source is available for "educational purposes", and you
can see how the ClassPath people did it.

Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in Europe! www.ffii.org

More information about the postgis-devel mailing list