The overriding CoordinateArraySequenceFactory::create methods have different default parameter values than the create methods in the CoordinateSequenceFactory base class. This is potentially ambiguous, since
will fail to compile, while
will compile successfully.
The patch syncronizes the create signatures, and adds necessary
throughout the code to resolve the ambiguities.
Add support for M values
I would like to avoid the reinterpret_cast. Would be maybe easier to expose a method taking no argument and meaning "empty sequence with automatically guessed dimensions"...
Works for me. Could you please add a test to tests/unit/geom/CoordinateArraySequenceFactoryTest.cpp for the new method,
remove empty spaces from blank lines (git diff --color shows them in red) and squash the commits ?
Syncronize CoordinateArraySequenceFactory::create signatures, add fac…
…tory for empty sequence.
Reading the header, isn't there a conflict between these two methods of CoordinateArraySequenceFactory ?:
CoordinateSequence *create(std::vector<Coordinate> *coords) const;
CoordinateSequence *create(std::vector<Coordinate> *coords, std::size_t dims=0) const;
I guess that's the reason why there was no default value for "dims" before ?
I guess the solution is dropping the single-argument version, to further sync with base class...
Yes indeed, good catch. The thing that is slightly ugly is that the implementation of the single-parameter version is
return new CoordinateArraySequence(coords,3);
i.e. as if the default parameter value for the dims variable was 3, whereas it is 0 in the two-parameter version. But in my opinion it makes sense to clean this up properly and hence yes, remove the single-parameter version.
Tests still pass
Pushed as r4052 (possibly 3a36e1a once it gets here)
Cleanup CoordinateSequenceFactory interface
Adds method for creating empty sequence.
Syncronizes CoordinateArraySequenceFactory methods.
Patch by Sandro Mani,
git-svn-id: http://svn.osgeo.org/geos/trunk@4052 5242fede-7e19-0410-aef8-94bd7d2200fb