+ Support for (Hex)(E)wkb
+ Autoprobing DriverWrapper for HexWKB / EWKT switching
+ fix compile problems in ValueSetter for ancient jdk releases.
+ + fix EWKT constructors to accept SRID=4711; representation
- full autoconf-based configuration
- added scale() and transscale() companion methods to translate()
- initial implementation of postgis_proc_upgrade script
public int numGeoms() {
return subgeoms.length;
}
-
+
protected ComposedGeom(int type, Geometry[] geoms) {
this(type);
this.subgeoms = geoms;
protected ComposedGeom(int type, String value, boolean haveM) throws SQLException {
super(type);
- value = value.trim();
+ value = initSRID(value);
+
String typestring = getTypeString();
if (value.indexOf(typestring) == 0) {
int pfxlen = typestring.length();
return (dimension >= 2 && dimension <= 3) && (type >= 0 && type <= 7);
}
+ /**
+ * Splits the SRID=4711; part of a EWKT rep if present and sets the srid.
+ *
+ * @returns value without the SRID=4711; part
+ */
+ protected String initSRID(String value) {
+ value = value.trim();
+ if (value.startsWith("SRID=")) {
+ int index = value.indexOf(';', 5); // sridprefix length is 5
+ if (index == -1) {
+ throw new IllegalArgumentException(
+ "Error parsing Geometry - SRID not delimited with ';' ");
+ } else {
+ this.srid = Integer.parseInt(value.substring(5, index));
+ return value.substring(index + 1).trim();
+ }
+ } else {
+ return value;
+ }
+ }
}
*/
protected Point(String value, boolean haveM) throws SQLException {
this();
- value = value.trim();
+ value = initSRID(value);
+
if (value.indexOf("POINTM") == 0) {
haveM = true;
value = value.substring(6).trim();