Translate posts to Experimental | Feedback
Google
Official Google Earth Download Site
Page 1 of 2 1 2 >
Topic Options
Rate This Topic
Previous Topic
View All Topics Index
Next Topic
#32173 - 04/27/05 06:40 AM SQL Linking to Data
John_Witstyn Offline
Traveler

Registered: 04/27/05
Posts: 4
Loc: Dallas TX USA
I am trying to link Keyhole to a SQL Server database so that I can set it to update every 5 minutes or so and show movement of GPS locations (of trucks) automatically.
Currently I can import the GPS Locations in a CSV file but that is a very manual process.
Also, I need to be able to use different icons depending on data in the database - for example, if a work order is open it needs to be a green icon, when closed it needs to be red. All this information updates in real time in the database.

I currently use MapPoint for this task and by hitting Shift F9 I am able to update all the database links in the map. But MapPoint is UGLY.

Does anyone have a 'Network link' or Import tool that can do this for me?

Thanks

Top
#32174 - 04/27/05 10:06 AM Re: SQL Linking to Data [Re: John_Witstyn]
mcshea98 Offline
Master Guide

Registered: 04/09/05
Posts: 488
Loc: USA
John,

Here is some information on the KML file. It has a little information on Network Links. Ink_Polaroid provided some good information here and there is some more information here.

I believe that you will have to write a script that will pull the information from your SQL database and write to a KML file.
This is probably your best example.
You might want to look at this as another example. I am not that good with scripting, but there are other people that are. Good luck.

Top
#32175 - 04/27/05 02:17 PM Re: SQL Linking to Data [Re: mcshea98]
John_Witstyn Offline
Traveler

Registered: 04/27/05
Posts: 4
Loc: Dallas TX USA
Thanks for this.

I will play around with it and try to get it going.

John

Top
#32176 - 04/27/05 02:37 PM Re: SQL Linking to Data [Re: John_Witstyn]
mcshea98 Offline
Master Guide

Registered: 04/09/05
Posts: 488
Loc: USA
If your successful, I would like to know how you accomplish this.

Top
#32177 - 04/28/05 12:57 PM Re: SQL Linking to Data [Re: mcshea98]
John_Witstyn Offline
Traveler

Registered: 04/27/05
Posts: 4
Loc: Dallas TX USA
Well, I am getting closer.

I created a SQL query that is run by SQL Server on a regular basis and creates a kml file in a certain location on a certain server. Once there, I link to it using a Network Link and set it to refresh every so often.

The only thing I haven't worked out yet is how to change the icons. The script I was using as a basis uses root://icons/etc but I have been unable to get this to work. If I could work out what the coding for the icons is, I could use the data in the database to assign the correct icon to each placemark when the sql is generated with a 'case' statement. And then the job is done.

Does anyone have a bit more detailed instruction on how the <icon>, <styleUrl> and <Style> tags work?

John

Top
#32178 - 04/28/05 01:21 PM Re: SQL Linking to Data [Re: John_Witstyn]
ink_polaroid Administrator Offline
Sysop

Registered: 01/01/05
Posts: 1882
Loc: SF Bay Area, CA
The <icon> tags in a network link work just fine with a standard http://your-server/your-image.jpg. Try that.

Top
#32179 - 04/28/05 02:31 PM Re: SQL Linking to Data [Re: ink_polaroid]
John_Witstyn Offline
Traveler

Registered: 04/27/05
Posts: 4
Loc: Dallas TX USA
Thank you, thank you, thank you.

That did it.

I now have a much superior truck/workorder mapping system that updates in real time.

If anyone wants to see the SQL queries or has any questions about the details - just post here or email me - jwitstyn@appliancewhse.com

John

Top
#32180 - 05/31/05 09:57 PM Re: SQL Linking to Data [Re: ink_polaroid]
gpxchangedotcom Offline
Traveler

Registered: 05/26/05
Posts: 5
I'm trying to replace the icons used on point placemarks with some loaded on my own server. Would love to see an example of how the <icon> element is put to use for this purpose.

Top
#32181 - 05/31/05 10:24 PM Re: SQL Linking to Data [Re: gpxchangedotcom]
ink_polaroid Administrator Offline
Sysop

Registered: 01/01/05
Posts: 1882
Loc: SF Bay Area, CA
To keep things backwards-compatible with Keyhole 2, use this simple stucture:

Code:

<Style>
<icon>http://foo.com/bar.png</icon>
</Style>



The syntax/structure of KML for Google Earth has changed slightly from that used in Keyhole. Files created with GE will not be viewable with Keyhole 2.2, but GE will parse older Keyhole KML files with no problems.

Top
#32182 - 06/01/05 07:28 AM Re: SQL Linking to Data [Re: ink_polaroid]
gpxchangedotcom Offline
Traveler

Registered: 05/26/05
Posts: 5
Thanks. Here's another one for you;

How do I show the label <name> on the map, but omit any icon? I just want text annotation to appear.

Top
Page 1 of 2 1 2 >