Hi!
When exporting a shape to a .xyz-file using io_shapes - "Export Shapes to XYZ", only the first first character of every string is written into the target .xyz-file. This is true for both the header and for every attribute.
So basically, I'm talking about the code in "src/modules_io/shapes/io_shapes/xyz.cpp".
In my application, I needed the complete strings. I fixed the problem by rewriting the module. I implemented my replacement differently than the original implementation:
fprintf
to a file opened by fopen
, I used a std::ofstream
Get_Field_Name( iField ).b_str()
to the stream using its operator<<
(rather than just Get_Field_Name( iField )
)Get_Field_Name( iField ).b_str()
to the stream using its operator<<
(rather than just Get_Field_Name( iField )
)I'm not sure which one of these changes fixed the problem, but in combination it works perfectly.
It might also be interesting that my SAGA-GIS (the one I loaded my compiled module into) is the standard 64 bit version (2.1.0) available for download (with unicode strings)
Anonymous
Hi,
thanks for reporting. This should be fixed in r1869 in r1874, see
io_shapes, export to xyz: should fix bug #170 'Export Shapes to XYZ exports only the first character of strings' http://sourceforge.net/p/saga-gis/code-0/1869/
Export Shapes to XYZ: do not use Stream.Write because of unicode incompatibility, completes r1869 http://sourceforge.net/p/saga-gis/code-0/1874/