Hi there, I'm trying to import an SVG file describing the provinces of Belgium in Roassal. I've cleaned an SVG file found on wikipedia and trying to import it. I'm trying to imitate the way it is done with Countries. So: RTMapBuilder class>>provincesOfBelgium and implemented to corresponding SVG paths. Here's one example: RTSVGPath class>> antwerp Very naively, I've tried: provinceExample Which does not display anything. I suspect the problem lies in the coordinates of my paths. Is there a README somehwere or the original file that was used to generate the world map of the examples? Cheers, Francois |
On Fri, Jul 31, 2015 at 6:31 PM, François Stephany <[hidden email]> wrote:
Apparently the path parser doesn't conform to specs? in the code I see a nice comment "The description of SVG path, says that M and m may accept more than one coordinates. In practices, this is rarely the case. " This also applies for other commands that should support multiple coordinates. anyway, try this (I made all line-to commands explicit): 'm 177.419,25.0693 l 1.379,-3.5593 l -2.986,-1.3778 l -3.33,0.5742 l -0.114,-3.1001 l -4.019,-4.0187 l 1.492,-5.9704 l -2.181,-2.8706 l -1.952,-0.2298 l -1.034,-1.2628 l -2.411,5.1667 l -3.673,3.7892 l -3.101,-2.067 l -5.396,1.378 l -2.068,-1.8371 l 4.479,-0.9188 l 0.345,-5.1667 l -6.2,-2.1815 l -4.938,5.741 l 0.114,2.8704 l -8.611,-0.574 l 1.264,-5.5112 l -5.397,0 l -6.43,3.4444 l 1.263,4.5929 l 2.411,2.7555 l -1.492,2.6409 l -4.478,-0.6891 l 0.115,-2.7555 l -6.43,0.3443 l 0,2.4112 l 2.296,0.5743 l -0.345,5.5112 l 3.904,1.0336 l -3.1,3.3295 l 3.056,7.4863 l 0.504,5.9475 l -7.923,0.2296 l -2.985,3.1002 l 1.722,1.837 l -0.114,3.5595 l 2.889,0.4893 l 3.352,-0.9423 l 7.038,4.5375 l 3.704,-0.5553 l 1.759,1.7593 l 3.149,-1.7593 l 4.075,2.1297 l 2.963,-3.6118 l 11.112,-1.7592 l 0.092,3.3337 l 11.576,-3.6113 l 1.204,-3.0562 l 5.001,-0.8332 l 2.129,-3.8894 l 4.723,-0.7409 l 0.741,-1.9448 l 2.223,0.8336 l 1.481,-0.8336 l 0.186,-4.9079 l -4.075,-2.0373 l 1.605,-5.4063 z'
The chapter for MapBuilder hasn't been done yet, but it is planned. :) Peter |
It will soon come :-)
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
|
It works with the explicit line-to: Any hint on how to force its inclusion in Inkscape ?On Fri, Jul 31, 2015 at 9:18 PM, Alexandre Bergel <[hidden email]> wrote:
Screen Shot 2015-07-31 at 21.50.58.png (34K) Download Attachment |
In reply to this post by Peter Uhnak
Yep, you're right the path parser doesnt not conform with the spec. From Section 8.3.2 of http://www.w3.org/TR/SVG/paths.html#PathDataMovetoCommands If a moveto is followed by multiple pairs of coordinates, the subsequent pairs are treated as implicit lineto commands. Thanks for the pointer :) If you have any idea on how to output those explicit "l", I'm all ears... On Fri, Jul 31, 2015 at 7:36 PM, Peter Uhnák <[hidden email]> wrote:
|
In reply to this post by fstephany
---> Save our in-boxes! http://emailcharter.org <---
Johan Fabry - http://pleiad.cl/~jfabry PLEIAD and RyCh labs - Computer Science Department (DCC) - University of Chile |
In reply to this post by fstephany
On Fri, Jul 31, 2015 at 10:10 PM, François Stephany <[hidden email]> wrote:
Well I just took your string and replaced all spaces except for the first and last with ' l ' :-D yourString copyReplaceAll: ' ' with ' l '. Peter |
Yep that's what I ended up doing but it would we cool to export and don't think about that ;) On Fri, Jul 31, 2015 at 10:16 PM, Peter Uhnák <[hidden email]> wrote:
|
In reply to this post by jfabry
You're right Baarle-Hertog neighbourhood are not in the SVG file :( It should'nt be a problem to express their position in SVG. Have a look at the Comines-Warneton 'which is part of Hainaut) stuck between France and West-Flanders ;)On Fri, Jul 31, 2015 at 10:15 PM, Johan Fabry <[hidden email]> wrote:
Screen Shot 2015-07-31 at 22.26.08.png (110K) Download Attachment |
---> Save our in-boxes! http://emailcharter.org <---
Johan Fabry - http://pleiad.cl/~jfabry PLEIAD and RyCh labs - Computer Science Department (DCC) - University of Chile |
Let's ditch Flanders altogether! On 31 Jul 2015 23:17, "Johan Fabry" <[hidden email]> wrote:
|
---> Save our in-boxes! http://emailcharter.org <---
Johan Fabry - http://pleiad.cl/~jfabry PLEIAD and RyCh labs - Computer Science Department (DCC) - University of Chile |
Flanders geography looks way too complicated for a sane brain :p On Fri, Jul 31, 2015 at 11:36 PM, Johan Fabry <[hidden email]> wrote:
|
Hi François, I don't think it's worth fixing in the current implementation, however there is already available SVG importer into Pharo, so I'll try to find a way how to adapt it. It should support regular SVG (circle, rectangle, ...), not just path. Peter On Fri, Jul 31, 2015 at 11:42 PM, François Stephany <[hidden email]> wrote:
|
This is Athens-SVG btw (not loaded by default in Pharo, but available in Athens repository). I think Stef mentioned it several times in regards to RTSVGPath. Peter On Sat, Aug 1, 2015 at 11:32 AM, Peter Uhnák <[hidden email]> wrote:
|
Okidoki ! I've found the option to explicitly include the "lineto" in Inkscape (see the attached screenshot of the Preferences).On Sat, Aug 1, 2015 at 11:34 AM, Peter Uhnák <[hidden email]> wrote:
Screen Shot 2015-07-31 at 22.40.08.png (86K) Download Attachment |
In reply to this post by jfabry
On 31-07-15 22:15, Johan Fabry wrote:
> > Hey, you forgot Baarle-Hertog … > https://en.wikipedia.org/wiki/Baarle-Hertog Or maybe that’s even too > complicated a situation for SVG to handle :-) Especially if you want to exclude the parts of Baarle-Nassau inside of Baarle-Hertog Stephan |
Hmm, maybe Athens-SVG will not be so simple, because it's paint-only so I would still have to write a lot of stuff around. But maybe we could grab the SVG path lexer that's there (and is better than in Roassal) and use it to simplify and improve current implementation, so even multi-coordinate commands work. I shall investigate more... Peter On Sat, Aug 1, 2015 at 8:20 PM, Stephan Eggermont <[hidden email]> wrote: On 31-07-15 22:15, Johan Fabry wrote: |
Yes, it would be great!
I first tried to understand the SVG parser in Athens, but I could not make it to work. So I wrote the one in Roassal. But indeed, we need a better thing. By the way, there is no parser supported by Cairo? I’ve just found this: http://cairosvg.org/project_description/ Cheers, Alexandre > On Aug 1, 2015, at 5:47 PM, Peter Uhnák <[hidden email]> wrote: > > Hmm, maybe Athens-SVG will not be so simple, because it's paint-only so I would still have to write a lot of stuff around. > > But maybe we could grab the SVG path lexer that's there (and is better than in Roassal) and use it to simplify and improve current implementation, so even multi-coordinate commands work. > I shall investigate more... > > Peter > > On Sat, Aug 1, 2015 at 8:20 PM, Stephan Eggermont <[hidden email]> wrote: > On 31-07-15 22:15, Johan Fabry wrote: > > Hey, you forgot Baarle-Hertog … > https://en.wikipedia.org/wiki/Baarle-Hertog Or maybe that’s even too > complicated a situation for SVG to handle :-) > > Especially if you want to exclude the parts of Baarle-Nassau inside > of Baarle-Hertog > > Stephan > > > > -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. |
Le 2/8/15 03:02, Alexandre Bergel a écrit : > Yes, it would be great! > I first tried to understand the SVG parser in Athens, Uh? Of course it is working. You can import SVG file. > but I could not make it to work. So I wrote the one in Roassal. Usually this approach does not work because two half done is not equal to one > But indeed, we need a better thing. > > By the way, there is no parser supported by Cairo? I’ve just found this: http://cairosvg.org/project_description/ > > Cheers, > Alexandre > > >> On Aug 1, 2015, at 5:47 PM, Peter Uhnák <[hidden email]> wrote: >> >> Hmm, maybe Athens-SVG will not be so simple, because it's paint-only so I would still have to write a lot of stuff around. >> >> But maybe we could grab the SVG path lexer that's there (and is better than in Roassal) and use it to simplify and improve current implementation, so even multi-coordinate commands work. >> I shall investigate more... >> >> Peter >> >> On Sat, Aug 1, 2015 at 8:20 PM, Stephan Eggermont <[hidden email]> wrote: >> On 31-07-15 22:15, Johan Fabry wrote: >> >> Hey, you forgot Baarle-Hertog … >> https://en.wikipedia.org/wiki/Baarle-Hertog Or maybe that’s even too >> complicated a situation for SVG to handle :-) >> >> Especially if you want to exclude the parts of Baarle-Nassau inside >> of Baarle-Hertog >> >> Stephan >> >> >> >> |
Free forum by Nabble | Edit this page |