Hi Tonny, Ruud, > > On Wed, Sep 10, 2008 at 11:17 PM, Barry > > <[EMAIL PROTECTED]> wrote:
> >> No sorry I just tried this made no difference in the browser the image just > >> displays the actual image I want but if I open in inkscape I can see all the > >> interconnecting roads outside of the viewable box. We need to do a clean > >> crop where by all that is placed inside the viewbox is all that is added to > >> the svg not anything else as it is making the file to big. So this is pretty hard to do well. > On Thu, Sep 11, 2008 at 11:25 AM, Tonny Kohar <[EMAIL PROTECTED]> wrote: > > > > If I am not wrong interpreting your questions, your clean cropping is > > very difficult to do and it can't be achieved by simple copying/clone > > the intersected element with your rectangle crop. Because > > getIntersectionList will return anything that intersect the area not > > within the area. So if the intersected node/element is big enough, > > part of it is inside the area and the other part is outside the area, > > this node will still returned. Right Tonny. "Tonny Kohar" <[EMAIL PROTECTED]> wrote on 09/11/2008 12:31:03 AM: > Another note, depending on your requirement, if you are allowed to > modify the output, you maybe able to use boolean operator (union, > intersec, exlusiveOr, etc) to do clean cutting at the boundary, but > the output will end up as path element instead of the original element > eg: rect,line,path Right, you need to intersect the raw geometry of the file with the viewBox. Java2D actually provides facilities to do this in the java.awt.geom.Area element. However Ruud you will need to deal with transforms and re-generating the SVG content. There may be other things like text that need other approaches. Also complex effects like filters can make this even harder as they need surround to ensure that you get the same output within the viewBox. Finally I would suggest they if you go down this route you should intersect the geometry with a rect that is slightly outset from the final viewbox. Otherwise you might end up with slight drop outs at the seams between tiles or for stroked content you will see the stroke around the edges of the tiles.
