You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by hardc0d3r <ha...@gmail.com> on 2007/08/07 15:38:21 UTC

Tiling a large svg

what is the proper technique/method for tiling large svg files? i have read
that i can break the svg to many svg files.. how do i 'break' and 'assemble'
it? is this possible in svg tiny? i have also read that i can use
getIntersectionList. any suggestion/opinion is appreciated.. thanks!

by the way, this is for a road network application.. thanks again!
-- 
View this message in context: http://www.nabble.com/Tiling-a-large-svg-tf4230192.html#a12034554
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Tiling a large svg

Posted by hardc0d3r <ha...@gmail.com>.
wow.. it took me three days to figure this out.. 
-- 
View this message in context: http://www.nabble.com/Tiling-a-large-svg-tf4230192.html#a12514975
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Tiling a large svg

Posted by hardc0d3r <ha...@gmail.com>.
can anyone guide me through this? please..
-- 
View this message in context: http://www.nabble.com/Tiling-a-large-svg-tf4230192.html#a12513254
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Tiling a large svg

Posted by hardc0d3r <ha...@gmail.com>.
what are the functions needed to get the coordinates of the displayed area on
the canvas? and what is viewport? is it the area that you can see on the
canvas? help...
-- 
View this message in context: http://www.nabble.com/Tiling-a-large-svg-tf4230192.html#a12490076
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Tiling a large svg

Posted by hardc0d3r <ha...@gmail.com>.
how do i get the coordinates of the viewed area?
-- 
View this message in context: http://www.nabble.com/Tiling-a-large-svg-tf4230192.html#a12458006
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Tiling a large svg

Posted by th...@kodak.com.
Hi Hardc0d3r,

hardc0d3r <ha...@gmail.com> wrote on 08/19/2007 08:16:26 PM:

> sorry but tiling is still not clear to me.. how do i show and remove the
> tiles?

   I gave several possible mechanisms for handing tiling in the
client document.  Without knowing what method you plan to attempt
I can't answer the question.  Andreas of course offered another
option of using a GIS system that will handle most of this work
for you (given your apparent newness to all things graphics I
would suggest going that route as setting up a tiling system
that works well is a quite advanced project).


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Tiling a large svg

Posted by hardc0d3r <ha...@gmail.com>.
sorry but tiling is still not clear to me.. how do i show and remove the
tiles?
-- 
View this message in context: http://www.nabble.com/Tiling-a-large-svg-tf4230192.html#a12228392
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: AW: Tiling a large svg

Posted by hardc0d3r <ha...@gmail.com>.
the requirement is to have a svg file for map and for the other data like
roads/structures, i will save it in database.. i cannot do it in other
ways.. and it has to be online but i do not have enough resources (such as
Postgis). but thanks for the link. i can learn a lot of stuff there..
-- 
View this message in context: http://www.nabble.com/Tiling-a-large-svg-tf4230192.html#a12160876
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


AW: Tiling a large svg

Posted by Neumann Andreas <an...@karto.baug.ethz.ch>.
If you really have larger datasets it is often advisable to store the geographic data in a spatial database and load the data after each zoom and pan. There is a tutorial on how to do this with Postgis/PHP/SVG at http://www.carto.net/papers/svg/postgis_geturl_xmlhttprequest/
 
This works fine if you have network access - if you don't, and if you have to store data locally, a tile approach would help. Postgis can again help with tiling GIS data. It can export SVG fragments.
 
maybe this helps,
Andreas
 
---
Andreas Neumann
Institute of Cartography
Swiss Federal Institute of Cartography
ETH Hoenggerberg
CH-8093 Zurich
Phone: ++41-1-6333031
Fax: ++41-1-6331153
http://www.karto.ethz.ch/
http://www.carto.net/papers/svg/
http://www.svgopen.org/
 

________________________________

Von: thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com]
Gesendet: Mi 8/15/2007 11:42
An: batik-users@xmlgraphics.apache.org
Cc: batik-users@xmlgraphics.apache.org
Betreff: Re: Tiling a large svg



Hi Hardc03r,

hardc0d3r <ha...@gmail.com> wrote on 08/14/2007 09:12:28 PM:

> what i know is if the
> viewing area intersects with the tile, that tile should be shown.. how?

   By having it in the document tree.

> do i have to get it from the server every time i move the viewing
> area?

   Well I would suggest caching them on the client but yes typically
every time the view moves you would check what tiles need to be
displayed and fetch any new ones from the server.

> and does the viewing are really move?

   That is your decision but it is what I would do.

> if i have a svg that is 500x500 pixels and tile it to 10x10 pixels,
> do i have to make a seperate svg file that is also 500x500 where
> the tiles will be shown?

   That would be typical.  The 500x500 image would generally have
script or some other mechanism (see multiImage element in
samples/tests/spec12/structure/multi2.svg).

> and does each tile have to be a valid svg file or can i just make
> it contain in <g>?

   This depends on how you choose to include them in the parent
document.  If you want to reference the tiles with a simple 'image'
element then they must be valid svg files.  If you want to load them
with script/Java (via getURL or the like) then they can be a simple
'g' or what ever you want.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Tiling a large svg

Posted by th...@kodak.com.
Hi Hardc03r,

hardc0d3r <ha...@gmail.com> wrote on 08/14/2007 09:12:28 PM:

> what i know is if the
> viewing area intersects with the tile, that tile should be shown.. how?

   By having it in the document tree.

> do i have to get it from the server every time i move the viewing
> area?

   Well I would suggest caching them on the client but yes typically
every time the view moves you would check what tiles need to be 
displayed and fetch any new ones from the server.

> and does the viewing are really move?

   That is your decision but it is what I would do.

> if i have a svg that is 500x500 pixels and tile it to 10x10 pixels, 
> do i have to make a seperate svg file that is also 500x500 where 
> the tiles will be shown? 

   That would be typical.  The 500x500 image would generally have
script or some other mechanism (see multiImage element in
samples/tests/spec12/structure/multi2.svg).

> and does each tile have to be a valid svg file or can i just make 
> it contain in <g>?

   This depends on how you choose to include them in the parent
document.  If you want to reference the tiles with a simple 'image'
element then they must be valid svg files.  If you want to load them
with script/Java (via getURL or the like) then they can be a simple
'g' or what ever you want.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Tiling a large svg

Posted by hardc0d3r <ha...@gmail.com>.
follow up questions..

what i know is if the
viewing area intersects with the tile, that tile should be shown.. how?
do i have to get it from the server every time i move the viewing
area? and does the viewing are really move? if i have a svg that is
500x500 pixels and tile it to 10x10 pixels, do i have to make a
seperate svg file that is also 500x500 where the tiles will be shown? and
does each tile
have to be a valid svg file or can i just make it contain in <g>?

sorry for all the questions..
-- 
View this message in context: http://www.nabble.com/Tiling-a-large-svg-tf4230192.html#a12154933
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Tiling a large svg

Posted by hardc0d3r <ha...@gmail.com>.
sorry if i am asking too much.. what do you mean by

> Use Boolean operations on the geometry.  A simpler approach is
> to filter content based on bounding boxes.

what if the svg is 10000x10000 pixels and contains a lot of paths and rects,
how can i make it load faster?
-- 
View this message in context: http://www.nabble.com/Tiling-a-large-svg-tf4230192.html#a12111176
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Tiling a large svg

Posted by th...@kodak.com.
Hi Hardc0d3r

hardc0d3r <ha...@gmail.com> wrote on 08/07/2007 09:38:21 AM:

> what is the proper technique/method for tiling large svg files?

   Use Boolean operations on the geometry.  A simpler approach is
to filter content based on bounding boxes.

> i have read that i can break the svg to many svg files.

   You can write out multiple SVG files generated from the
original file.  The simplest way to do that is to only
output the elements that intersect a particular tiles bounding
box.

> how do i 'break' and 'assemble' it? 

   Assembling it would most likely be done by a combination
of svg 'image' elements referencing the multiple SVG files
you wrote out above.  One tricky thing is that it's easy to
get artifacts where the tiles meet.

> is this possible in svg tiny?

   The short answer is no.  The longer answer would require
knowing what facilities outside of SVG Tiny might be available
(like scripting) or what other compromises you might be
willing to make.

>  i have also read that i can use
> getIntersectionList. any suggestion/opinion is appreciated.. thanks!

   getIntersectionList will give you the list of elements that
intersect a particular rectangle.  Which is roughly what you
want to emit for a single tile.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org