Aven and kml export

Olly Betts olly at survex.com
Tue Jul 28 10:34:33 BST 2015


On Sun, Jul 26, 2015 at 05:50:08PM -0500, Jan Schorn wrote:
> My special interest is to export a survey to a GIS fomat, I think kml
> is good for this, and import it as 3d vectors with grass gis. And It's
> perfect, that there ist support for coordinate reference systems.
[...]
> There are two issuses I'm wondering about with aven 1.2.20 and ubuntu
> (mint, ppa repos):
> 
> 1) how do I export kml lines? any option i activate in the ui, just
> placemark points are exported to kml.

That's not supported in 1.2.20, but I've already implemented it since
that release, so it'll be in 1.2.21.

If you're comfortable building from the git repo, you can build your
own version with this feature.  Or you could try exporting as GPX - it
looks like Grass GIS can import that.

> 2) the decimal separator of the coords in the exported kml files is a
> comma instead of a point, see file attached.
> i'm not really into c-programming, but to me it's quite strange -
> heaving a look to the code in github, isn't the writing of coordinates
> to a stream done in /src/kml.cc by the command
> fprintf(fh,
> "<Placemark><Point><coordinates>%.8f,%.8f,%.2f</coordinates></Point><name>",
> X, Y, Z);
> so coordinates should be written with decimal-points, don't they?...

The "%f" printf format is locale sensitive, so if you're using a locale
that uses "," for the decimal separator then you'll get this problem.

I've committed a fix to temporarily switch to the "C" locale while
performing any export, which fixes this for KML and similar issues for
any other affected formats.

You can probably work around it in older versions by explicitly running
aven in the "C" locale from the command line like so:

env LC_ALL=C aven

Cheers,
    Olly



More information about the Survex mailing list