[postgis-devel] [JDBC] Patch for JtsBinaryWriter

Thomas Marti (HSR) tmarti at hsr.ch
Mon Dec 18 02:02:42 PST 2006


Hey Markus

I had to add that, because empty geometries (look at the last test case in 
JtsTestParser) return a dimension of 0 with the new getCoordDim() method.


Bye, Thomas

Markus Schaber schrieb:
> 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
> 




More information about the postgis-devel mailing list