sexytopo icon indicating copy to clipboard operation
sexytopo copied to clipboard

SVG Sketch Export

Open riggsd opened this issue 9 years ago • 10 comments

I've started a feature branch for adding SVG sketch export. Ideally this will allow direct vector export at map-scale, layer compatible with Adobe Illustrator and Inkscape, with appropriate metadata so that Walls and Compass can roundtrip morph them along with loop closure.

If you're willing to consider accepting this feature, I'd like to use this ticket for discussing further design and implementation.

Initial working but "not ready for primetime" branch is at: https://github.com/riggsd/sexytopo/tree/svg-export

riggsd avatar Jan 19 '16 01:01 riggsd

screenshot 2016-01-18 16 22 28

riggsd avatar Jan 19 '16 01:01 riggsd

Excellent, sounds like a good addition to SexyTopo!

I've recently bought a house, which is taking up a lot of my time - projects like ST have had to be shelved for a few weeks, so apologies if I don't respond much. Revisiting import/export was going to be one of my next priorities.

My main priority has been Therion because that's what most cavers are moving to (or so it seems to me) but would be good if it can play nice with other workflows too. Afraid I have minimal exposure to Walls or Compass but it sounds like SVG export is a good idea.

richsmith avatar Jan 19 '16 22:01 richsmith

Here in the US, Therion is quite unpopular. Compass and Walls are the big two for data reduction, and final maps are typically drafted with Illustrator (though AutoCad, InkScape, Xara, and other vector graphics editors are used in lesser frequency).

SVG is much better supported by all of the above than DXF (with the exception of AutoCad, I would assume). Notably, both Walls and Compass support "round-tripping" of a drafted map in .SVG format, such that the map and its symbols are morphed decently when subsequent survey causes positions to shift.

Congrats on the new house :+1: and thanks for writing SexyTopo. I'm a novice at Android development, but a Java old hat, so backend hacking is where I'm best at the moment. I think that this project has the potential to be a great Android cave survey solution with just a bit of work.

riggsd avatar Jan 20 '16 02:01 riggsd

Yep, as a broad generalisation, US and Europe do seem to have gone in different directions with morphing (round trip) software.

I am not sure that SVG export for the sketch is that useful, and is one of the reasons that I have rejected other software. The sketch made underground is not good enough for final display, the conversion typically has too many splines, plus generally it takes more work to correct than just drawing again with curves directly in Inkscape, Therion or the like. Topodroid does try to solve this by drawing in svg underground, but I find it too slow/difficult and the results are still not good enough. Fundamentally underground sketching, especially in difficult conditions is not good enough for final output. I would love to be proved wrong

AndrewAkinson avatar Jan 20 '16 09:01 AndrewAkinson

I am not sure that SVG export for the sketch is that useful, and is one of the reasons that I have rejected other software. The sketch made underground is not good enough for final display, the conversion typically has too many splines, plus generally it takes more work to correct than just drawing again with curves directly in Inkscape, Therion or the like.

The point isn't that you'd use the underground sketch as the actual vectors which make up your finished map.

The point is that if your exported sketch is already .SVG, set up with the layers that Walls or Compass expects to find, the sketch can be morphed precisely by loop closure or declination adjustment with no additional post-processing necessary.

You've still got to "ink" your finished map over top of it, exactly like you would with a scanned sheet of paper or a pixellated .PNG export.

Andrew, if you reject software for exporting in formats that you don't use, you must not use much software ;-)

riggsd avatar Jan 21 '16 07:01 riggsd

Not rejecting it, also I defiantly do not reject things because they are not for software that I do not use. It was a question about practicality. Looking at the whole process to get the best outcome is important. So if you are going to have yo 'over ink' isn't it better to change Walls go import sexytopo format rather than get an underground tool to do it. Survey software should adapt to the way people survey not the other way round, and with data this implies data integrity is good, so avoiding changing format should be an aim

Andrew

AndrewAkinson avatar Jan 21 '16 09:01 AndrewAkinson

It seems reasonable to me to have SexyTopo be able to export to SVG just for convenience.

Sexytopo doesn't really have a format per se for sketches - it just holds the data in memory as native Android objects and saves it as .json. I don't think there's any cost to having an svg export capability (especially if David is willing to do it!) - it shouldn't affect interacting with Therion.

richsmith avatar Jan 24 '16 14:01 richsmith

The biggest user-facing concern with SVG export is in specifying the output map scale. Obviously vector graphics may be scaled up or down arbitrarily after the fact, but the scale at export time dictates the relative size for text labels and stroke width of various lines; if you scale the sketch down after export, you inadvertently scale down the station label text to an unreadable size, for example. Not to mention that it is simply most convenient if the exported sketch can be incorporated into your map project without any scaling or rotation.

Scaling is defined by the ratio of cave units to map units; so 1000:1 would scale 10m in cave to 1cm on paper.

We metric-shunning Americans need to use more complicated math to go from SexyTopo (and DistoX) internal meters to our typical map scales; an example of US map scale would be 1in = 50ft, so the scaling factor requires inches-to-feet and feet-to-meters conversions when trying to do the calculation on a napkin.

So my design questions deal with how and where to present this output scaling info to the user.

"Where" meaning whether it should A) be a modal dialog after selecting "export" (or perhaps "export to SVG"), whether it should B) be configured as a property of the survey or the cave, whether it should C) be an application-wide preference, or whether D) SexyTopo should spit out exactly one scale and users are responsible for changing it after the fact if they don't like it.

"How" meaning whether it should A) be a simple scaling factor (eg. user enters "1000"), or whether it should B) be an assisted calculator that lets them select cave units (eg. "10m") and map units (eg. "1in").

riggsd avatar Jan 24 '16 22:01 riggsd

David, I apologize myself that I'll start more generally. I understand that caving in USA is isolated space from others cavers around the globe with its own rules, etc.

But what I don't understand is way the tool, which is able to solve all (or most of) your problems you have with cave surveying is so unpopular there. I follow yours discussions and my answer could be very simple: use Therion and you will not lose your time with solving of your problems. But I stopped to do it, because several people there started be very allergic for it evidently without any knowledge or experience with Therion. About final maps export - there is possible to mimic mostly any cave map I saw in discussions or on FB. But there are many, many other possibilities. And those possibilities, or modifications according of your needs is the main difference.

And back to discussion here: in Therion there is any scrap (small piece of final map) automatically calibrated (referenced) by defining of stations which are included in particular scrap there. Object -> Point -> click with left button -> click with right button -> contextual menu pop-ups -> choose Station and if it is xvi file from PocetTopo or generated from Therion data (centerline + LRUD) the name will be added automatically. If not, you should edit the name of station manually. It is all. Round-tripping is making automatically according of coordinates of stations after data reduction.

I haven't try SexyTopo, because my pad has Android version 4.0.4 only.

Tried yet, under emulation. As PocketTopo, but a bit more simple.

martinsluka avatar Mar 30 '16 12:03 martinsluka

I added a basic SVG exporter to ST then I remembered this project @riggsd . Your WIP looks more sophisticated, so still potential to improve on the basic one.

richsmith avatar Jun 09 '19 09:06 richsmith

Closing this issue as SVG export has improved in forthcoming release

richsmith avatar Feb 03 '24 09:02 richsmith