Are you using the JTS Coordinate or the NTS Coordinate? If you are using the NTS Coordinate class, I'd just change the Point class to inherit from Coordinate, as David suggests. However, this also means you'll need to change it from a struct to a class. If you aren't using JTS at all, you can post this to the NTS forums here: http://code.google.com/p/nettopologysuite/issues/list.
The performance hit almost certainly comes from memory usage and GC trashing as you copy structs to new GC objects and then they go out of scope and need to be collected. In NTS v2.0 all point (coordinate) data is represented in a memory-efficient way, and completly as value types (structs in the CLR) to avoid this hit. -codekaizen On Fri, May 16, 2008 at 9:12 AM, David Zwiers <[EMAIL PROTECTED]> wrote: > Have you considered having your objects sub-class the JTS classes? You would > likely only need to implement the get coordinate/coordinate sequence > methods. > > David Zwiers > Vivid Solutions Inc. > > ________________________________ > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > [EMAIL PROTECTED] > Sent: May 16, 2008 8:58 AM > To: [email protected] > Subject: [jts-devel] Coordinate type mapping question > > Hello, > > We are using JTS (well, actually NetTopologySuite - NTS) for the purpose of > carrying out boolean operations on polygons. When we started our project, we > didn't think that we will need to use the JTS - as a result we have our own > primitive geometry types - the primary being our own Point type geometry (a > structure - not a class) which functionally maps to JTS' Coordinate type. In > order to be able to call the JTS routines, we are required to map our Point > type into JTS Coordinate type, and back. This sometimes results into > performance penalty because of the two way conversion of Point and > Coordinate. > > Any thoughts on this from anyone as to how to most efficiently map (or avoid > mapping) our type to JTS type? > > Thanks! > > _______________________________________________ > jts-devel mailing list > [email protected] > http://lists.refractions.net/mailman/listinfo/jts-devel > > _______________________________________________ jts-devel mailing list [email protected] http://lists.refractions.net/mailman/listinfo/jts-devel
