Visibility based on zoom level

1,857 views
Skip to first unread message

Bob Heitzman

unread,
Jul 6, 2010, 6:53:20 PM7/6/10
to KML Developer Support - Getting Started with KML
Is the ability to set visibility based on zoom missing from KML? This
has been a standard feature for decades for GIS software.

Note that 'zoom level' in this context is relative the horizontal (or
verticle - XY) extent displayed, not the altitude of an object or the
camera.

I've looked into regions which may work for points but is pretty
worthless for polygons of varying sizes like parcel data. I'd like to
load a parcel layer and not have it render until I zoom below one mile
showing on the screen. And when I get below one mile all objects are
visible.

GIS programs have a min and max setting so you can do the opposite to
the above - objects don't show until you can see more than one mile on
the screen - like an index layer.

Josh L

unread,
Jul 9, 2010, 2:26:47 PM7/9/10
to KML Developer Support - Getting Started with KML
Hi Bob,

One of the things that is different with Earth than standard GIS
software is that it is 3d, and as such your distance from the terrain
may vary greatly depending on your Camera or LookAt. In other words,
there is not the same relationship with a more standard 'scale' that
covers the extent of your visible area like you might have in a 2d
browser for most common projections.

For example, if you have zoomed in so you are about a mile above the
ground, and then tilted the angle of your view, it's unlikely you want
many thousands of parcels displaying in the far off distance even if
some of the parcel data is less than a mile 'away' from your
viewpoint. For this reason the "Level of Detail" or <lod> tag is
considered a more robust tool for deciding what data to display at
what detail/distance.

http://code.google.com/apis/kml/documentation/kmlreference.html#lod
outlines the logic behind choosing the appropriate LOD levels for your
data.

Cheers,

-Josh

Bob Heitzman

unread,
Jul 14, 2010, 6:29:29 PM7/14/10
to KML Developer Support - Getting Started with KML
I've read the LOD portion of the document but I can't see how it would
allow me to control the visibility of random sized polygons like
parcels or Census Blocks. One object could cover 10,000 acres and be
adjacent to 0.1 acre objects. Both objects should be visible/invisible
below/above a defined threshold. Setting LOD on these random objects
seem like a nightmare.

Besides random size these objects are of random shape. Trying to
define bounding boxes for groups of objects also seems very difficult.

I was thinking that splitting the AOI (my County is about two degrees
wide, one high) into cells may work but I can't figure out how to link
the cells to the objects. Again I am looking for all to appear or none
to appear below/above the threshold regardless of shape/size or if
they are partially or fully contained within a cell.

Has anyone tackled creating regions for Census Blocks or Traffic
Analysis Zones (TAZ)?

Here's a source for the shapefiles is anyone is interested:
http://www2.census.gov/cgi-bin/shapefiles2009/national-files use right
pane to drill down to a county.

barryhunter (KML Guru)

unread,
Jul 27, 2010, 11:45:28 AM7/27/10
to KML Developer Support - Getting Started with KML
Don't know if you still persueing this...

But the LatLngAltBox you define for LOD purposes, doesn't actually
need to match the extent of the feature its used on.

So each and every feature (regardless of its physical size) can have
the same size LatLngAltBox - so they all 'fade' simulatiouslly. As
long as the coverage is fairly small can just use a fixed +/- lat/long
from the centroid to create a virtual box. If covering a larger area
need a better conversion between real world dimensions and lat/long.

http://code.google.com/apis/kml/documentation/regions.html#latlonaltbox


On Jul 14, 11:29 pm, Bob Heitzman wrote:
> I've read the LOD portion of the document but I can't see how it would
> allow me to control the visibility of random sized polygons like
> parcels or Census Blocks. One object could cover 10,000 acres and be
> adjacent to 0.1 acre objects. Both objects should be visible/invisible
> below/above a defined threshold. Setting LOD on these random objects
> seem like a nightmare.
>
> Besides random size these objects are of random shape. Trying to
> define bounding boxes for groups of objects also seems very difficult.
>
> I was thinking that splitting the AOI (my County is about two degrees
> wide, one high) into cells may work but I can't figure out how to link
> the cells to the objects. Again I am looking for all to appear or none
> to appear below/above the threshold regardless of shape/size or if
> they are partially or fully contained within a cell.
>
> Has anyone tackled creating regions for Census Blocks or Traffic
> Analysis Zones (TAZ)?
>
> Here's a source for the shapefiles is anyone is interested:http://www2.census.gov/cgi-bin/shapefiles2009/national-filesuse right
Reply all
Reply to author
Forward
0 new messages