Page 1 of 4 123 ... LastLast
Results 1 to 15 of 47
  1. #1
    Lounger
    Join Date
    Apr 2008
    Location
    Colchester, Essex, United Kingdom
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Update Google Eartk KLM file in real time (2003)

    (Edited by HansV to make URL clickable - see <!help=19>Help 19<!/help>)

    I would like to learn enough to create a line on-line “data input page” where anyone can add data which is then passed to Google Earth for instant mapping.

    The test, to prove the process should be timestamp, lat, long, category, icon.

    I have written a sample in Access 2003 (which I can do, attached) however I probably need to write the on-line element in ASP, possibly using a SQL database and parsing to a (Google Earth) KLM file (which is way beyond my current knowledge). I do not even know how to get my Access database on line as a starter.)

    I do have a host with .ASP and .PHP capabilities.

    This is the starting page for KML files http://code.google.com/apis/kml/documentation/

    And this a spreadsheet style http://earth.google.com/outreach/tut...readsheet.html (which cannot be used as each new user could a) see and muck up previous entries.

    If anyone has the time to explore/guide/teach me to the point of a simple, online, working solution I would be very grateful.

    Regards Paul
    Attached Files Attached Files

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Update Google Eartk KLM file in real time (2003)

    Hi Paul, as far as getting Access db's online, the following is a novel way: http://www.upsizing.co.uk

  4. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Update Google Eartk KLM file in real time (200

    Just thought of something else.
    In the db I added a default value of Now() to the timestamp field.
    This removes the need to do anything about this via ASP.
    Regards
    John



  5. #4
    Lounger
    Join Date
    Apr 2008
    Location
    Colchester, Essex, United Kingdom
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Update Google Eartk KLM file in real time (2003)

    Thanks Grovelli, That could be useful for a future application, however I want to display the data in Google Earth not as a HTML page so thats not for me this time.

    Thanks for taking the time to reply, much appreciated. Regards Paul

  6. #5
    Lounger
    Join Date
    Apr 2008
    Location
    Colchester, Essex, United Kingdom
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Update Google Eartk KLM file in real time (200

    Thanks John, I tried the page and it showed the fields ~ looks good.
    I entered some real data and clicked {submit}
    I then received a [The page cannot be displayed] error with HTTP 500 - Internal server error as a sub-error message. {NB This was on your site}
    I went back, entered some more data and clicked [clear form] ~ that worked as I would expect.
    Thanks for picking this one up. I've attached some code from someone who has done this before but it could be written in greek as far as I am concerned so I do not know if it is good code or not :-(
    Regards Paul
    Attached Files Attached Files

  7. #6
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Update Google Eartk KLM file in real time (200

    Paul

    I have put an on-line working copy of your db here . This only attempts the first step - allow users to input the data.

    Getting this to work involved doing three things.

    1. <LI>Uploading tracking.mdb to the webserver, and making sure that ordinary users have write permission for it.
      <LI>uploading adovbs.inc - this is just a file of constants used by asp
      <LI>writing and uploading tracking.asp- this is the main job.
    I attach a zip file containing both tracking.asp and adovbs.inc.
    This uses a fairly common approach of a script that calls itself. The first time it is run, it displays an empty form. When the form is submitted, the data is passed back to the same script, that writes it to the db, then displays another empty form.

    You need some validation in the form to check that required fields are filled in etc. There is a bit of that there, but more is needed. I have just noticed that if you submit a completely empty form it generates an error.just fixed that

    The only way to tell that it has worked is to download the database and open it. It would be possible to write another asp script that displays all the records, but I have not done that.

    I don't know anything about the next step - ie. getting the stuff into Google Earth - but if I have time, I will read the stuff you posted about that.

    I have just replaced the attachment with a slightly modified one.
    Attached Files Attached Files
    Regards
    John



  8. #7
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Update Google Eartk KLM file in real time (200

    I don't know why you get an error. It works for me (and one other person has used it successfully).

    I wonder if it is something to do with the data entered. I tried again with the same data you had put into the first record and it worked OK.
    If I put alpha data into the lat and lon fields it throws a type mismatch error, but that is to be expected.

    Have you tried putting it onto your own server?
    Regards
    John



  9. #8
    Lounger
    Join Date
    Apr 2008
    Location
    Colchester, Essex, United Kingdom
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Update Google Eartk KLM file in real time (200

    Hi John, It could be because I am behind a firewall ~ I will try again tonight (2100gmt) from a machine not so heavily protected. Yes I loaded to my server but it simply wanted to download the ASP page. I thought my server would handle it as I have (bought) databases working there ~ I am awaiting a reply from my host. If necessary I will have to get a different server as this is something I really want to get right. Regards Paul.

  10. #9
    Lounger
    Join Date
    Apr 2008
    Location
    Colchester, Essex, United Kingdom
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Update Google Eartk KLM file in real time (200

    Hi John,

    OK, two sets of bad news today :-)
    1) I get dumped to an error page from home as well.
    This time I get an error message

    Microsoft JET Database Engine error '80040e21'
    Scaling of decimal value resulted in data truncation.
    /johnh/tracking/tracking.asp, line 42

    I was inputing as folows
    Lat: 51.87544692293899
    Long: 0.7657988369464874

    so I'm guessing the table field size needs to be increased?

    I'm also guessing that Dim strlat (which to me means string lat) is OK for a numeric field ~ I have no ASP experience so am groping under the table on this error.

    (I'm also assuming most folk will not know their lat/long so I will direct them here to get it.http://mapmaker.donkeymagic.co.uk/
    I therefore need to accept the largest number that site produces, although it seems hellish accurate to me!)

    2) My host does not support ASP (and is quite down in the mouth about it - HIS words, not mine before I get jumped on.

    Tracking.asp is probably not working because your web server is NOT Windows 2000 NT.
    Your web server is UNIX so, therefore an asp webpage/script will not work on it.
    Only html, php, perl and cgi pages/scripts can work on a UNIX server.
    Because Windows asp language is too buggy and unreliable, 99% of web hosting accounts are UNIX (PHP)
    Better ask if he has a php or cgi version of the script.

    I really want this to work so will look for an ASP host unless you can also write PHP or CGI?
    Regards Paul

  11. #10
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Update Google Eartk KLM file in real time (200

    Sorry I don't have a PHP version of the script, although I might be able to work it out. I did a tiny bit of PHP once.

    The data with lots of decimal points causes an error as you say. I will experiment with different settings for the fields data type, and see what effect it has. On a quick look it seems that 15 dec points is the most that is supported.

    The data that comes from the web page is just a string, and VBScript is not a typed language.
    When you declare a variable you don't give it a type.

    The conversion to numbers happens when you insert the data into the database.
    Regards
    John



  12. #11
    Lounger
    Join Date
    Apr 2008
    Location
    Colchester, Essex, United Kingdom
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Update Google Eartk KLM file in real time (200

    I think you are right John, 15 numbers after the decimal seems to be the limit.
    http://msdn.microsoft.com/en-us/library/aa...office.11).aspx

    I think the properties of tbl_core for Lat and Long are wrong ~ Precision 18, scale 15 decimal places 8 should (I think) be decimal places 15 in both cases.

    This still could lead to an overflow of 1 number ~ can that (if it exists) be trimmed by code?
    Or should/could it be stored as text and reconverted when we 'write' to Google Earth?

    Does any other lurker know? <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  13. #12
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Update Google Eartk KLM file in real time (200

    I have had another look at this and taken it a bit further.

    It seems to me that we can leave the latitude and longitude as strings all the time. The format for the KLM file treats them as strings as well.

    here is a link that accepts coordinates, name and description. When you click submit (and hit OK to opening the file.) the location you have entered is shown to you using Google Earth. The location is also written to the database.

    It is best to have Google Earth running already to avoid having to wait for the login and initialisation.

    How you get this to work with multiple sites I still don't know. In fact still very vague on how this all works.

    This post at another forum gave the idea on how to do this.

    I now use a plain html form to make the submission, which passes the data to tracking.asp, which is attached.
    Attached Files Attached Files
    Regards
    John



  14. #13
    Lounger
    Join Date
    Apr 2008
    Location
    Colchester, Essex, United Kingdom
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Update Google Eartk KLM file in real time (200

    Hi John, Its been a public holiday here ~ sorry, was not allowed to pack my computer <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    I tried your new form ~ that works a treat, so impressed. Did you catch the code I appended a few posts ago ~ someone on a Google Earth forum sent it to me but I don't read ASP so it went over my head.

    NB are you still capturing this to the database ~ there are two targets, keep users interest by showing the results in (ideally a timeline) Google Earth map, and to capture the info for later analysis. I don't care if lat/long are captured as "strings" to Access ~ I have enough knowledge to decode later.

    I have found this site http:// http://www.asphost4free.com/ ~ I'll sign up for a trial then I can save you scratching your brain over converting the code to my hosts format!

    This is really starting to get somewhere, thanks a lot for the work to date.

    Regards Paul

  15. #14
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Update Google Eartk KLM file in real time (200

    Glad it worked for you this time.

    Yes I am still capturing stuff to the database, and I can see your entry is there.

    When I looked at this again last night I forgot to look at the code you mention. I will have a look at this some time soon.
    Regards
    John



  16. #15
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Update Google Eartk KLM file in real time (200

    Does it work for you? Have you put the mdb file there as well?

    This is what I got when I clicked the submit button.
    Attached Images Attached Images
    Regards
    John



Page 1 of 4 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •