[geos-devel] Question about Geometry and GeometryFactoryrelationship...

Steve Lime steve.lime at dnr.state.mn.us
Wed May 11 13:21:05 EDT 2005

Hi Martin: Thanks for the clarification, something to think about
anyway. In lieu of a code change at the moment I'll couple the two
myself. GEOS Geometry's are buried behind MapServer shapes so the
developer/user doesn't see 'em. With MapServer there no logical
candidate structure/object to attach the factory to without explicitly
creating something new and GEOS specfic. I'd rather not go there.

Is the factory object relatively lightweight so that constantly
instatiating new objects doesn't hurt performance?


>>> mbdavis at VividSolutions.com 5/11/2005 12:02:18 PM >>>
Geometrys need some metadata to allow methods to execute.  This
currently includes things like PrecisionModel and SRID (and may grow
include more things in the future).  Rather than duplicate these for
every geometry, the GF is referenced by the geometry and shared with
created geometrys.  This works well in the Java world.  

In the C++ world if this is a problem I guess each Geometry could own
its own copy of the GF.  This would require a code change to make
Geometrys copy the GF for created Geometrys, rather than keep a
reference to it.

Martin Davis, Senior Technical Architect
Vivid Solutions Inc.      www.vividsolutions.com 
Suite #1A-2328 Government Street Victoria, B.C. V8T 5G5
Phone: (250) 385 6040 - Local 308 Fax: (250) 385 6046

> -----Original Message-----
> From: geos-devel-bounces at geos.refractions.net 
> [mailto:geos-devel-bounces at geos.refractions.net] On Behalf Of 
> Steve Lime
> Sent: May 11, 2005 9:52 AM
> To: geos-devel at geos.refractions.net 
> Subject: [geos-devel] Question about Geometry and 
> GeometryFactoryrelationship...
> Hi All: I'm running into trouble making a clean integration 
> of GEOS into MapServer. Problem is that GeometryFactory 
> objects must persist while any Geometry objects spawned from 
> that factory are in us. This makes it necessary to either use 
> a global factory which is problematic with theading, or 
> somehow couple the two so that they are created, persist and 
> are deleted together. I'm curious why Geometry's cannot 
> stand-alone? Perhaps I'm missing something obvious in my 
> implementation.
> Steve
> Stephen Lime
> Data & Applications Manager
> Minnesota DNR
> 500 Lafayette Road
> St. Paul, MN 55155
> 651-297-2937
> _______________________________________________
> geos-devel mailing list
> geos-devel at geos.refractions.net 
> http://geos.refractions.net/mailman/listinfo/geos-devel 
geos-devel mailing list
geos-devel at geos.refractions.net 

More information about the geos-devel mailing list