<div dir="ltr">Hi,<br><br>I am trying to use geos for topology analysis. I noticed the comments in the class CoordinateSequence(CoordinateSequence.h) :<br><br>> There are some cases in which you might want Geometries to store their<br>> points using something other than the GEOS Coordinate class. For example, you<br>> may want to experiment with another implementation, such as an array of Xs<br>> and an array of Ys. or you might want to use your own coordinate class, one<br>> that supports extra attributes like M-values.<br><br>> You can do this by implementing the CoordinateSequence and<br>> CoordinateSequenceFactory interfaces. You would then create a<br>> GeometryFactory parameterized by your CoordinateSequenceFactory, and use<br>> this GeometryFactory to create new Geometries. All of these new Geometries<br>> will use your CoordinateSequence implementation.<br><br>That means I can build my own CoordinateSequence class by implementing the interfaces in CoordinateSequence class, and further for geometry storage.<br><br>In my case, the underlying of a CoordinateSequence is a array of Point:<br><br>> typedef struct {<br>>   double x;    <br>>    double y;} Point;<br><br>and my class looks like :<br><br>> class GEOS_DLL MyCoordinateSequence : public CoordinateSequence {<br>>       private:<br>>           Point * _points;       /* points array */<br>>       ...<br><br>everything seems to be fine except the getAt function which need to return a const reference to a Coordinate object. Because I do not have the <br>vector<Coordinate> member in my class, I am not sure how to convert a Point to a  Coordinate object for returning. <br><br>And if I add a vector<Coordinate> member in the class, there is not different with  class CoordinateArraySequence :-(<br><br>Also I wonder why then return value is a const reference object rather that a pointer?  If it is a pointer, I can make my own Coordinate sub class which <br>is a wrap of point.  Is there any design purpose on this ? Is it possible to change the return type to a Coordinate pointer that shouble be a abstract class.<br><br>comments are welcomed.<div><br>Regards,<br><br></div><div>zhen<br></div></div>