Thanks, I agree w/ your analysis, patched.
On Thu, Jan 26, 2012 at 2:20 AM, Innerebner Markus <[email protected]> wrote: > Hi all, > > for me this looks like an error: > > postgis.jdbc.LineString method concat (line70) > > WRONG: > int count = points.length + points.length - (cutPoint ? 1 : 0); > > CORRECT: > int count = points.length + opoints.length - (cutPoint ? 1 : 0); > > can you check this please? > > thanks Markus > > I am using the version 1.3.3 from the maven repository > > <dependency> > <groupId>org.postgis</groupId> > <artifactId>postgis-jdbc</artifactId> > <version>1.3.3</version> > </dependency> > > > /************** corrected ***/ > > public LineString concat(LineString other) { > Point[] points = this.getPoints(); > Point[] opoints = other.getPoints(); > > boolean cutPoint = this.getLastPoint() == null > || this.getLastPoint().equals(other.getFirstPoint()); > int count = points.length + opoints.length - (cutPoint ? 1 : 0); > Point[] p = new Point[count]; > > // Maybe we should use System.arrayCopy here? > int i, j; > for (i = 0; i < points.length; i++) { > p[i] = points[i]; > } > if (!cutPoint) { > p[i++] = other.getFirstPoint(); > } > for (j = 1; j < opoints.length; j++, i++) { > p[i] = opoints[j]; > } > return new LineString(p); > } > > _______________________________________________ > postgis-users mailing list > [email protected] > http://postgis.refractions.net/mailman/listinfo/postgis-users _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
