SVG map import fails - What am I doing wrong?

Hello!

Having spent days re-creating a map by hand as .svg in Inkscape, I wanted to import it into my module tonight. However, on attempting to load it I get the “Unable to Read File - VASSAL was unable to read the file ‘[file name]’” error message.

I have tried simpler versions of the same map, e.g. by collapsing everything onto one layer and removing the only .svg component that I had not created myself. The only time I managed an import was when I stripped out everything except for the most basic shapes.

Here are the basic stats for what I am trying to import

[]Mostly hand drawn .svg file created in Inkscape[/]
[]10.6 MB file size[/]
[]4,000 x 4,400 pixel nominal size[/]
[]About 5,000 total shapes[/]
[]Tried loading with original eight layers as well as collapsed to single layer[/]
[]No embedded bitmaps or code[/]
[]Running VASSAL 3.2.8 on Mac OS X 10.7.5 with Java 1.6.0_51 from Apple[/]

It seemed like this should be straightforward, but it is not (for me). I have considered breaking the map into smaller chunks, but this would be quite tedious in the .svg format.

Please help me figure out how to make this work – and what additional information you need to be able to help.

It would be such a shame to export the map to PNG first. Thanks a bunch for an assistance in advance!

– Martin

Thus spake blackice:

Hello!

Having spent days re-creating a map by hand as .svg in Inkscape, I
wanted to import it into my module tonight. However, on attempting to
load it I get the “Unable to Read File - VASSAL was unable to read the
file ‘[file name]’” error message.

I have tried simpler versions of the same map, e.g. by collapsing
everything onto one layer and removing the only .svg component that I
had not created myself. The only time I managed an import was when I
stripped out everything except for the most basic shapes.

Here are the basic stats for what I am trying to import

  • Mostly hand drawn .svg file created in Inkscape
  • 10.6 MB file size
  • 4,000 x 4,400 pixel nominal size
  • About 5,000 total shapes
  • Tried loading with original eight layers as well as collapsed to
    single layer
  • No embedded bitmaps or code
  • Running VASSAL 3.2.8 on Mac OS X 10.7.5 with Java 1.6.0_51 from
    Apple

It seemed like this should be straightforward, but it is not (for me). I
have considered breaking the map into smaller chunks, but this would be
quite tedious in the .svg format.

Please help me figure out how to make this work – and what additional
information you need to be able to help.

It would be such a shame to export the map to PNG first. Thanks a bunch
for an assistance in advance!

Where can we get the SVG so we can try it ourselves?


J.

Hi Joel,

The map file is here: dropbox.com/s/s1lwbqfo2nlsp … shrunk.svg

Can you get it this way? Thanks for your help!

– Martin

Thus spake blackice:

Hi Joel,

The map file is here: dropbox.com/s/s1lwbqfo2nlsp
shrunk.svg[1]

Can you get it this way? Thanks for your help!

Did you check VASSAL’s errorLog? It says what the problem is:

“Caused by: org.w3c.dom.DOMException: The current document is unable to create an element of the requested type (namespace: w3.org/2000/svg, name: flowRoot).”

Your SVG contains flowRoot elements, but the version attribute of the
svg element is set to 1.1. The flowRoot element wasn’t part of the SVG
1.1 standard. If you want to use flowRoot, you have to use SVG 1.2.
You could simply edit the svg element so that version=“1.2”, but that
won’t be enough to get this file to work. When I tried that, there
were some other problems:

‘The “center” identifier is not a valid value for the “text-align”
property.’

So, you have some problems with your SVG.


J.

Hi Joel,

Great, thanks for figuring this out. I feel like such an amateur, but I will find a way to make this work.

Cheers,

Martin

Hi,

I managed to get rid of all flowRoot elements. This article was tremendously helpful for the task: inkscapeforum.com/viewtopic.php?f=5&t=10819

However, I am now running into the next error message. At least this time I found it and I believe it means that I have a special character issue:

Caused by: java.io.UTFDataFormatException: Invalid byte 1 of 1-byte UTF-8 sequence.

The map is using two Scandinavian characters, which I suspect cause the problem: ø and å.

I will try again with those characters removed, but do you have any thoughts on how to get them to work?

Thanks!

Martin

Great, the map is now loaded! I am still missing the Scandinavian characters, so any thoughts on those are still very welcome.

– Martin

Thus spake blackice:

Hi,

I managed to get rid of all flowRoot elements. This article was
tremendously helpful for the task:
inkscapeforum.com/viewtopic.php?f=5&t=10819[1]

However, I am now running into the next error message. At least this
time I found it and I believe it means that I have a special character
issue:

Code:
Caused by: java.io.UTFDataFormatException: Invalid byte 1 of 1-byte
UTF-8 sequence.

The map is using two Scandinavian characters, which I suspect cause the
problem: ø and å.

Neither of these are single-byte characters in UTF-8, so if they’re
encoded a single bytes, they’re encoded improperly.

Can I see the SVG you have now?


J.