Group features in Google Earth to hide detail when zoomed out

人盡茶涼 提交于 2019-12-19 10:31:59

问题


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:


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?



来源:https://stackoverflow.com/questions/689336/group-features-in-google-earth-to-hide-detail-when-zoomed-out

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!