Parse SVG XML files

sgenzersgenzer Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM Moderator Posts: 2,959 Community Manager
edited December 2018 in Product Feedback - Resolved

Hi...I'd love to see a way for the "Read XML" operator to be adapted so that it can easily read SVG vector image files, broken down by image, subimage, segment, etc...  It would be a great way to do image analysis!!

 

FYI I know there is a Java SVG parser publicly available...could this be used?  :)  https://xmlgraphics.apache.org/batik/

 

Scott

 

Thomas_Ottmatthew_miller
2
2 votes

Declined · Last Updated

Sorry Scott - only two votes since May 2017. Better luck next time. Declined PROD-825

Comments

  • MartinLiebigMartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,453 RM Data Scientist

    Hi Scott,

     

    how would the resulting table look like?

     

    ~Martin

    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
  • sgenzersgenzer Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM Moderator Posts: 2,959 Community Manager

    Excellent question :)  Here's what I think would make sense..

     

    Original XML SVG file: 

    <?xml version="1.0" standalone="no"?>
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
    "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
    <svg width="4cm" height="4cm" viewBox="0 0 400 400"
    xmlns="http://www.w3.org/2000/svg" version="1.1">
    <title>Example triangle01- simple example of a 'path'</title>
    <desc>A path that draws a triangle</desc>
    <rect x="1" y="1" width="398" height="398"
    fill="none" stroke="blue" />
    <path d="M 100 100 L 300 100 L 200 300 z"
    fill="red" stroke="blue" stroke-width="3" />
    </svg>

    Output:

     

    Width, title, desc all in metadata - only paths in example set:

     

    path      command     x        y    x1   x2   y1   y2   width    height     fill       stroke    stroke-width

    rect                                1        1                                    398        398          none   blue

    d             M                     100  100

    d             L                      300  100

    d             L                      200  300

    d             z                                                                                                        red    blue        3

     

    The key for me here is both to break out the shapes AND to de-pivot the paths.


    Scott

Sign In or Register to comment.