MySQL Forums
Forum List  »  General

Re: Modified Preorder Tree Traversal - Advanced question
Posted by: Clive Galway
Date: August 23, 2005 02:31PM

on reflection I am asking the wrong question. (It amazing how writing something down clarifies it in your head, isn't it ?)
Given a zoom of 4, how do I pull Scotland and England but not surrey ?

Put another way, given a zoom of x, I want to pull each node that has a zoom of less than x, but only the first one below x in each branch, not it's children.

To visualise it:

................UK(5)...................
************************
..Scotland(3)....England(3)......
.......................Surrey(1).......

I want ideally one query that will pull the top node from each branch below the **** line (ie Scotland and England) given the zoomlevel value 3 or 4.
Please bear in mind that the tree may not be even like this one and that the zoom value is in no way related to a region's depth in the tree.

The zoom value for a region actually represents the zoomlevel in google maps at which the region can clearly be made out. For example, Texas, being huge is going to have a different zoom value that conneticut, which is much smaller - even though they are both at the same depth in the region tree.

Yes I know this could be done with having a min zoom and a max zoom for each region, but I would rather not as this would make inserting a zoom level 4 in between the UK and Scotland, England cumbersome.

Options: ReplyQuote


Subject
Written By
Posted
Re: Modified Preorder Tree Traversal - Advanced question
August 23, 2005 02:31PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.