[geos-devel] Question about JTS porting process

Mateusz Łoskot mateusz at loskot.net
Thu Mar 2 09:38:18 EST 2006


Hi,

AFAIK GEOS is a kind of direct port of JTS.
Am I right?
So, I have some observation and I'd like to ask for explanation.
It seems some of bugs/typos/inconsistencies are ported
together with features ;-)
Also, obviously there are some things in-progress/not finished yet
in JTS code. So, such incomplete stuff seems also to be ported.
Am I right?

Here is small example of such class in GEOS where such incomplete stuff 
comes straight from JTS:

///////////////////////////////////////////////////////////////////////
// GEOS version of class
class CoordinateArraySequenceFactory : public CoordinateSequenceFactory
{
public:

   // ...

   CoordinateSequence *create(vector<Coordinate> *coords, int dims) const
   {
     return new CoordinateArraySequence(coords);
   }

   CoordinateSequence *create(unsigned int size,
     unsigned int dimension=3) const
   {
     return new CoordinateArraySequence(size);
   }

   // ...
};

///////////////////////////////////////////////////////////////////////
// JTS version of class
DefaultCoordinateSequenceFactory


and sample method:

public CoordinateSequence create(int size, int dimension) {
    return new DefaultCoordinateSequence(size);
}


My question is why those parameters like dims or dimension are not used
in GEOS as well as in JTS?
There are many similar places.

Does it mean that JTS developers are going to extend implementation of 
create method(s) and they will use those (currently unused) parameters?
This would imply the same in GEOS.

But if those unused things won't be used in future then it could be 
better to clean them up during GEOS refactoring.

I'd be thankful if anyone could expain me the idea.

Cheers
-- 
Mateusz Łoskot
http://mateusz.loskot.net



More information about the geos-devel mailing list