[postgis-devel] [JDBC] Patch for JtsBinaryWriter

Markus Schaber schabi at logix-tt.com
Mon Dec 18 01:59:08 PST 2006


Hi, Thomas,

Markus Schaber <schabi at logix-tt.com> wrote:

> Thanks for your patch, I'll have a look into it.

To be honest, I don't understand that part:


+++ org/postgis/jts/JtsBinaryWriter.java        (working copy)
@@ -108,7 +108,7 @@
     /** Parse a geometry starting at offset. */
     protected void writeGeometry(Geometry geom, ValueSetter dest) {
         final int dimension = getCoordDim(geom);
-        if (dimension < 2 || dimension > 4) {
+        if (dimension != 0 && (dimension < 2 || dimension > 4)) {
             throw new IllegalArgumentException("Unsupported geometry dimensionality: " + dimension);
         }
         // write endian flag

Why do you want to allow goemetries with dimension==0?

As far as I can see, that would write WKB whih cannot be parsed by the
PostGIS backend.

Regards,
Markus

-- 
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in Europe! www.ffii.org
www.nosoftwarepatents.org



More information about the postgis-devel mailing list