Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

SVG: Cairo and AGG are out of sync #1388

Open
TobWen opened this Issue · 7 comments

3 participants

@TobWen

When rendering SVGs on a map, which are transformed using translate() [offset shift], output of Cairo and AGG is out of sync.

The strange thing: only some SVGs are affected.

AGG:
AGG output

CAIRO:
CAIRO output

mapnik: e2b6572
cairo: 1.10.2
cairo-wrapper: 1.8.4
python-cairo: 1.8.8
geos: v3.2.0

Tested on PDF output, viewer is latest Adobe Reader on Windows XP.

@artemp
Owner

@TobWen - can you post those SVG's to check ?

@TobWen

Okay, but code isn't optimized now :)

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   version="1.0"
   width="100"
   height="100"
   id="svg2">
  <defs id="defs8" />

  <g transform="scale(0.05) rotate(180, 190, 860) matrix(-1 0 0 1 300 0)" >

    <path
       d="M909 1440H939Q1195 1440 1416 1247Q1644 1020 1644 725V713Q1644 418 1416 190Q1195 0 937 0H913Q655 0 442 182Q333 289 308 346Q270 401 237 498Q204 606 204 705V733Q204 940 333 1133Q417 1249 521 1317Q708 1440 909 1440Z"
       style="stroke:none;fill:#FF00FF;"/>

    </g>
</svg>
@artemp
Owner
@TobWen

I've also problems with the SVG from Inkscape. Perhaps you can reproduce this one?

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   version="1.0"
   width="20.000002"
   height="20"
   id="svg2"
   sodipodi:version="0.32"
   inkscape:version="0.46"
   sodipodi:docname="H_Bus.svg"
   inkscape:output_extension="org.inkscape.output.svg.inkscape">
  <metadata
     id="metadata3148">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <sodipodi:namedview
     inkscape:window-height="968"
     inkscape:window-width="1280"
     inkscape:pageshadow="2"
     inkscape:pageopacity="0.0"
     guidetolerance="10.0"
     gridtolerance="10.0"
     objecttolerance="10.0"
     borderopacity="1.0"
     bordercolor="#666666"
     pagecolor="#ffffff"
     id="base"
     showgrid="false"
     inkscape:zoom="4.62"
     inkscape:cx="50"
     inkscape:cy="50"
     inkscape:window-x="-4"
     inkscape:window-y="-4"
     inkscape:current-layer="svg2" />
  <defs
     id="defs8">
    <inkscape:perspective
       sodipodi:type="inkscape:persp3d"
       inkscape:vp_x="0 : 50 : 1"
       inkscape:vp_y="0 : 1000 : 0"
       inkscape:vp_z="100 : 50 : 1"
       inkscape:persp3d-origin="50 : 33.333333 : 1"
       id="perspective3150" />
  </defs>
<path
     id="path3145"
     style="fill:#ff00ff;stroke:none"
     d="M 9.791667,0 L 10.208334,0 C 12.578705,0 14.787038,0.893518 16.833334,2.680555 C 18.944445,4.782407 20.000001,7.199074 20.000001,9.930555 L 20.000001,10.097222 C 20.000001,12.828704 18.944445,15.25 16.833334,17.361111 C 14.787038,19.12037 12.569445,20 10.180556,20 L 9.847223,20 C 7.458334,20 5.277778,19.157407 3.305556,17.472222 C 2.296297,16.481481 1.675926,15.722222 1.444445,15.194444 C 1.092593,14.685185 0.763889,13.981481 0.458334,13.083333 C 0.152778,12.083333 0,11.125 0,10.208333 L 0,9.819444 C 0,7.902778 0.597223,6.050926 1.791667,4.263889 C 2.569445,3.189815 3.439815,2.337962 4.402778,1.708333 C 6.13426,0.569444 7.930556,0 9.791667,0 z" />
</svg>
@springmeyer
Owner

@TobWen - please create a reduced testcase. In other words, a full XML + svg file + script to render output packaged in a zip file and posted somewhere, then linked here. Make sure the test is as minimal as possible but still replicates the issue for you locally before posting it.

@artemp
Owner

@TobWen - the last SVG renders correctly, too.
I'm using :
cairo-1.12.2
cairomm-1.10.0

@TobWen

@springmeyer: I'll create a shapefile on my GIS tomorrow.

@artemp: Seems like the problem occures on PointSymbolizer only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.