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.
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?
Related
I have 3 KML's that do not draw at all and 2-3 that act sporadically depending on what zoom level they are at. I checked the file limitations and I don't seem to be violating any of the limits. I went back to my original shapefiles to check for geometry errors. One of the files had geometry errors and I fixed them yet it didn't seem to fix the problem of the KML not rendering. I've also implemented zoom functionality with Googles Visualization API and geoxml3 processor. Here are some interesting things that happen with my application:
One of the KML files that does not draw will actually respond to the
zoom functionality by zooming to its extent but still won't draw the
polygon; evidence that the KML is being parsed but not drawing.
One of the KML files that does not draw will eventually draw if I
click on the polygon next to it and am zoomed in close enough. It
will not initially.
I have two KML files that draw when zoomed out but 'disappear' when
I zoom in.
My application is here and my fusion table is here. If anyone has had similar problems and was able to fix them I would really appreciate to know how it was accomplished because I'm stumped at this point.
Thanks
first of all: Fusion Tables are still experimental
some issues:
South Nelson Elementary is missing in varID
JV Humphries Secondary Polygons needs to be fixed
I thought I would post an update.
It turns out some of my data did have geometry errors; those were fixed and converted to KML.
The problem is my actual coding. The code was orginally written to simply display polygons from an array and to be turned on/off via a checkbox. The reason for this was to be able to view adjacent boundaries of the other polygons. I achieved this in my initial coding and the user had to zoom into the area of interest via Google's map functionality.
Then I was asked to have a zoom function when the checkbox was clicked to have the application zoom to the polygon in question. This of course works but it depends on which order the checkboxes are clicked on. I'm fairly certain it has to do with how the empty array is populated as checkboxes are clicked on/off.
I don't fully understand the logic of how the code decides which polygon to zoom or not zoom to. All I know is that if all checkboxes are unchecked then each checkbox is checked on/off one at a time the zoom functionality works.
If anyone has a suggestion on how to have each checkbox act 'independently' to zoom regardless of order clicked I would appreciate it.
I've searched the various forums and can't find this question asked. If it has, please point me to it.
I'm generating a .KML file with lots of point data in a 400 mile area. When the file is opened, points labels are shown which makes it very busy.
What I'd like is for the file to open with only the points and no labels. Then when the users zooms in to let's say 20 miles, the labels are shown.
I have control over the generation of the KML file, so I can add any additional "parameters" that I need to accomplish this effect.
I'd appreciate someone pointing me to the best method to do this.
Thanks,
MEG
Add each of your points twice to your KML file and place them in different Regions. In the outer region, you can hide the labels via this technique.
I am working on a GE local bike mapping project, and I am using placemarks to create labels with linked descriptions for the roads/trails on the map. While it is nice for the user to click a placemark/label on the map for a description; as the map has grown, the labels can also create visual clutter. The placemarks for the label/descriptions are currently stored with the lineStrings in folders for each road.
It would be nice to be able to turn all of the labels off or on without opening each of the separate road folders to de/select each one. The names of most of the roads are also available on the underlying Google Earth hybrid layer, so the labels and descriptions are helpful but not absolutely necessary.
Download https://sites.google.com/site/tuobikes/kml/hullcrabtree.kmz for an example.
Is there any way to define a set of placemarks as a subtype in order to turn them all on or off as a group? For example, placemark type=label or placemark type=photo... This seems like useful functionality, but I don't see it in the kml reference
Is storing the placemarks for the labels/descriptions together in a folder separate from the lineStrings for the roads the only way to solve the problem?
I don't know of any way other than a Folder to turn on/off a group of related placemarks.
That said, consider using one or more KML Regions to reduce clutter:
"Regions are a powerful KML feature that allows you to add very large datasets to Google Earth without sacrificing performance. Data is loaded and drawn only when it falls within the user's view and occupies a certain portion of the screen. Using Regions, you can supply separate levels of detail for the data, so that fine details are loaded only when the data fills a portion of the screen that is large enough for the details to be visible."
I was wondering how does Nike website make the change you can see when selecting a color or a sole. At first I thought they were only using images and when the user picked a color you just replaced that part, but when I selected a different sole I noticed it didn't changed like an image it looked a bit more as if it was being rendered. Does anybody happens to know how this is made? Or where can I get further info about making this effect :)?
It's hard to know for sure, but my guess would be that they're using a rendering service similar to that provided by Adobe's Scene7.
It's a product that is used to colorize/customize a base product image based on user choices.
If you're interested in using the service, I'd suggest signing up for their weekly webinar. I attended one a while back and was very impressed with their offering. They showed the Converse site (which had functionality almost identical functionality to the Nike site) as a demo.
A lot of these tools are built out in Flash using a variety of techniques:
1) You can use Flash's BitmapData object to directly shift the hues of the pixels in your item. This is probably the simplest technique but often limits you to simple color transformations.
2) You can pre-render transparent PNG's (or photos, I guess) containing the various textures you would want to show on your object (for instance patterns or textures) and have them dynamically added to your stage at runtime. This, I think, offers the highest fidelity but means you need all of your items rendered upfront.
3) You can create 3D collada files and load them via a library like Papervision3D. Then dynamically change the texture at runtime. This is the most memory intensive technique and tends to result in far worse fidelity, but for that you get a full 3D object that you can view in space.
I'm sure there are other techniques but those are the top 3 I can think of. I hope that helps!
I work for a ticketing agency and we print out tickets on our own ticket printer. I have been straight coding the ticket designs and storing the templates in a database. If we need a new field adding to a ticket I manually add it and use the arcane co-ordinate system to estimate where the fields should go and how much the other fields need to move by to accomodate new info.
We always planned to make this system automate with a simple (I stress the word simple) graphical editor. Basically we don't forsee tickets changing radically in shape any time soon, we have one size of ticket and the ticket printer firmware is super simple because it's more of an industrial machine, it has about 10 fonts and some really basic sizing interactions.
I need to make this editor display a rectangle of the dimensions by pixel of the tickets (can even be actual size) and have a resizable grid which can toggle between superimposition and invisibility on top of the ticket rectangle and represented by dots rather than lines.
Then I want to be able to represent fields by drawing rectangles filled with the letter "x" that show the maximum size of the field (to prevent overlaps). These fields should be selectable, draggable and droppable in a snap to grid fashion.
I've worked out the maths of it but I have no idea how to draw rectangles and then draw grids in layers and then put further rectangles full of 'x'es on top of those. I also don't really know much about changing drawn positions in accordance with mouse events. It's simply not something I've ever had to do.
All the tutorials I've seen so far presume that you already know a lot about using the draw objects and are seeking to extend a basic knowledge of these things. I just need pointing in the direction of a good tutorial in manipulating floating objects in a picturebox in the first place.
Any ideas?
For those of you in need of a guide to this unusual (at least those of us with a BIS background) field I would heartily endorse:
https://web.archive.org/web/20141230145656/http://bobpowell.net/faqmain.aspx
I am now happily drawing graphical interfaces and getting them to respond to control inputs with not too much hassle.