Re: [geos-devel] WKT / WKB Writer Output Dimension
On Wed, May 26, 2010 at 12:41:53AM -0400, Frank Warmerdam wrote: > Note that I'll default to writing the new syntax. I'm not sure if I > will support writing the old syntax or not via a flag. If current WKTWriter didn't output old syntax it makes perfectly sense to start the support with new syntax. Keep up the good work ! --strk; () Free GIS & Flash consultant/developer /\ http://strk.keybit.net/services.html ___ geos-devel mailing list geos-devel@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/geos-devel
Re: [geos-devel] WKT / WKB Writer Output Dimension
Martin Davis wrote: FWIW, the semantics of JTS were intended to be that setting the output dimension determines the *maximum* number of dimensions written. If the input geometry does not provide that many dimensions, the extra ones are not written. So this is somewhat equivalent to "letting the input geometry determine the number of dimensions to output". Martin, Gotcha. I'll take the same approach in GEOS then. I see now the WKBWriter is actually broken if output dimension is set to 3 and a 2D geometry is passed in but that is just a bug. http://trac.osgeo.org/geos/ticket/346 I'll fix that while applying the suggest behavior. The WKTWriter accepts this value in the constructor. WKTWriter was intended to be a lightweight immutable class, so this makes sense for Java. In the C world perhaps it's better to have an explicit setter. Output Dimension can be set in the constructor of the WKBWriter, but also via a later setter. I'll try to following the WKBWriter pattern in the WKTWriter. If you want to force always outputting a given number of dimensions, would you want to support supplying a default value for missing dimensions? Or just default to 0? Since I'm not going to force 3D output it doesn't matter, but if I had been going to do so I would have wanted to write 0. Seems like a good idea to support outputting the new syntax, via a flag. Note that I'll default to writing the new syntax. I'm not sure if I will support writing the old syntax or not via a flag. Best regards, -- ---+-- I set the clouds in motion - turn up | Frank Warmerdam, warmer...@pobox.com light and sound - activate the windows | http://pobox.com/~warmerdam and watch the world go round - Rush| Geospatial Programmer for Rent ___ geos-devel mailing list geos-devel@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/geos-devel
Re: [geos-devel] WKT / WKB Writer Output Dimension
FWIW, the semantics of JTS were intended to be that setting the output dimension determines the *maximum* number of dimensions written. If the input geometry does not provide that many dimensions, the extra ones are not written. So this is somewhat equivalent to "letting the input geometry determine the number of dimensions to output". The WKTWriter accepts this value in the constructor. WKTWriter was intended to be a lightweight immutable class, so this makes sense for Java. In the C world perhaps it's better to have an explicit setter. If you want to force always outputting a given number of dimensions, would you want to support supplying a default value for missing dimensions? Or just default to 0? Seems like a good idea to support outputting the new syntax, via a flag. Frank Warmerdam wrote: Folks, Currently the WKBWriter supports writing 2D (default) or 3D (by calling setOutputDimension(3)). I would like to extend this to support setting the output dimension to a special value (-1 or 0 perhaps) indicating that the output dimension of the WKB should be determined from the input geometry. More importantly, I'd like to extend the WKTWriter to support writing 3D geometries, adding a setOutputDimension() method like on the WKBWriter. For the WKT writer I will support at least the new style WKT "POINT Z (1 2 3)" and possibly support the old approach "POINT (1 2 3)" as an option. Some discussion of this will be at: http://trac.osgeo.org/geos/ticket/292 I hope by leaving the defaults as the current behavior the changes should be non-disruptive but with substantial capability. Any suggestions or objections? Best regards, -- Martin Davis Senior Technical Architect Refractions Research, Inc. (250) 383-3022 ___ geos-devel mailing list geos-devel@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/geos-devel
[geos-devel] WKT / WKB Writer Output Dimension
Folks, Currently the WKBWriter supports writing 2D (default) or 3D (by calling setOutputDimension(3)). I would like to extend this to support setting the output dimension to a special value (-1 or 0 perhaps) indicating that the output dimension of the WKB should be determined from the input geometry. More importantly, I'd like to extend the WKTWriter to support writing 3D geometries, adding a setOutputDimension() method like on the WKBWriter. For the WKT writer I will support at least the new style WKT "POINT Z (1 2 3)" and possibly support the old approach "POINT (1 2 3)" as an option. Some discussion of this will be at: http://trac.osgeo.org/geos/ticket/292 I hope by leaving the defaults as the current behavior the changes should be non-disruptive but with substantial capability. Any suggestions or objections? Best regards, -- ---+-- I set the clouds in motion - turn up | Frank Warmerdam, warmer...@pobox.com light and sound - activate the windows | http://pobox.com/~warmerdam and watch the world go round - Rush| Geospatial Programmer for Rent ___ geos-devel mailing list geos-devel@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/geos-devel