From: Sandro Santilli Date: Fri, 28 Jan 2005 14:50:35 +0000 (+0000) Subject: Applied small patches from Markus Shaber X-Git-Tag: pgis_1_0_0RC3~89 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=70f658f4a6e42c5a3d35ce12bb7b75e24b43cc94;p=postgis Applied small patches from Markus Shaber git-svn-id: http://svn.osgeo.org/postgis/trunk@1350 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/jdbc2/src/org/postgis/Point.java b/jdbc2/src/org/postgis/Point.java index 801dc3493..d0f5c1a7e 100644 --- a/jdbc2/src/org/postgis/Point.java +++ b/jdbc2/src/org/postgis/Point.java @@ -6,6 +6,8 @@ import java.sql.SQLException; public class Point extends Geometry { + public static final boolean CUTINTS=true; + public int hashCode() { return super.hashCode() ^ hashCode(x) ^ hashCode(y) ^ hashCode(z) ^ hashCode(m); } @@ -109,15 +111,26 @@ public class Point extends Geometry { public void innerWKT(StringBuffer sb) { sb.append(x); + if (CUTINTS) cutint(sb); sb.append(' '); sb.append(y); + if (CUTINTS) cutint(sb); if (dimension == 3) { sb.append(' '); sb.append(z); + if (CUTINTS) cutint(sb); } if (haveMeasure) { sb.append(' '); sb.append(m); + if (CUTINTS) cutint(sb); + } + } + + private static void cutint(StringBuffer sb) { + int l = sb.length()-2; + if ((sb.charAt(l+1)=='0')&&(sb.charAt(l)=='.')) { + sb.setLength(l); } } diff --git a/jdbc2/src/org/postgis/binary/ValueGetter.java b/jdbc2/src/org/postgis/binary/ValueGetter.java index 027200ca2..ee497e1d5 100644 --- a/jdbc2/src/org/postgis/binary/ValueGetter.java +++ b/jdbc2/src/org/postgis/binary/ValueGetter.java @@ -83,12 +83,7 @@ public abstract class ValueGetter { } protected int getInt(int index) { - int hg = data.get(index + 3); - int high = ((int) hg << 24); - int hmed = ((int) data.get(index + 2) << 16); - int lmed = ((int) data.get(index + 1) << 8); - int low = (int) data.get(index); - return high + hmed + lmed + low; + return (data.get(index + 3) << 24) + (data.get(index + 2) << 16) + (data.get(index + 1) << 8) + data.get(index); } protected long getLong(int index) { diff --git a/jdbc2/todo.txt b/jdbc2/todo.txt index f3461728f..1d8e79292 100644 --- a/jdbc2/todo.txt +++ b/jdbc2/todo.txt @@ -29,3 +29,6 @@ Todo for PostGIS 1.0 compatible JDBC classes - Possibly relicensing under LGPL +- Possibly adding server side code to support plJava + http://gborg.postgresql.org/project/pljava/projdisplay.php +