tags:

views:

221

answers:

1

Hi all,

I'm trying to generate a KML file to display a set of features scattered around the UK. I would like the features to be grouped together at higher zoom levels, ideally displaying as an icon with a count of the number of features, so that users can see clusters of features easily.

Essentially I'm trying to do something along these lines, but in Google Earth, not Maps.

Can anyone point me in the right direction. I'm a bit of a newbie with KML :-)

Cheers,

RB.

ANSWERS :

My own research suggests I can do what I want using Regions to define bounding boxes for certain features.

It has also been suggested I should do this using network links, which I'm going to investigate as I think it's a better match for other reasons too.

+1  A: 

Is this a standalone KML file? Or the KML returned as data for a network link?

In the first case I'm not sure this is even possible. I have seen layer transparency change with "camera altitude", so perhaps something like this is also possible on features? Then you could add both the single features and the groups features into the same KML file and make them visible based on "distance to camera"? Could be a new KML feature I missed, but you'd have the check the KML specification.

In the second case, you just return KML that matches the given network link viewport information. Based on the bounding box you get, you can subdivide that box into a grid and cluster per box. If you have one feature in a box, return the feature. If you have more than one in a box, return just a "grouped feature" for that box. The clustering will then automatically change when the user moves around in Google Earth: after each camera change your network link URL is called again and you again do feature selection and clustering with the given bounding box viewport. This makes your clustering dynamic.

Does this help?

peSHIr
It does. I started doing it as a standalone KML file, but looking into network links I think that's more what I'm trying to achieve. Many thanks. I think I can do what I want standalone using Regions, so I'm looking into those.
RB