Repeated crashing when loading kml-file

Hello,
I’m very new to all of this, and attempting to load a .kml file into AOG. Drew a simple polygon geometry in QGIS (as this is how we will proceed in our project), successfully exported it as a .kml file. Then, upon loading and saving it, AOG keeps going non-responsive/freezes. Any things I need to be aware of? Thank you. Koen
image

Have you tried with Google Earth created KML? From recollection the XML is parsed “manually” and possibly there is some nuance about the KML GE generates vs QGIS. Perhaps post a short example KML that causes a crash so people can take a look.

Hi, thank you for your response.
no I haven’t tried the Google Earth approach (as many state it is not very accurate I thought I’d go to importing from QGIS directly) Will try GE first thing this evening, maybe I better take it one step at a time to become familiar with the process. Not quite sure what you mean by : posting a short example kml…do you mean read the kml’s code in python and post it here? If so I will have to look into that (as you can probably tell: total noob here on the subject)

By posting an example I simply mean a .KML file created in QGIS that causes your AOG to crash… no code required :slight_smile:

[Note to myself- consider GitHub - samcragg/sharpkml: SharpKML is an implementation of the Open Geospatial Consortium (OGC) KML 2.2 standard developed in C#, able to read/write both KML files and KMZ files. if there are issues with current code]

From the very big field (in red 17068,17 Ha) I think the position in not set to your place.
Find settings at top left and set Sim cords.

1 Like

You are right that is big. Weird because the shape I drew was about three times the size of a a rugby field only. Should’ve noticed that… Also thanks for the hint, will check this out

I’ve seen someone upload a .kml by appending it with .txt, so I did the same hope it works…
AOG_TestField.kml.txt (1007 Bytes)

AOG is looking for a single line that says coordinates, then on the next line a single string of x,y,z,x,y,z,… I’m not sure it can pick up coordinates in the middle of a string. Export from Google earth. That is the format it is looking for.

Edit: I also crashed AOG once when I put it in the Yukon and went to work. About 15 miles in it crashed. Figured it was just too far, but never researched it.

1 Like

No problem , I am converted online on net WGS84 cordinates to CSV , and CSV to KML. AOG working , no problem.

https://kmltools.appspot.com/

So , I have re-drawn a test-field in QGIS , changed projection to the CRS Google Earth needs (pseudo-mercator) and exported my polygon as a kml file. If I try to open it in Google Earth that works just fine: I get the exact location with the field marked with it’s boundary.
Then importing the file in AOG also works fine now( no more crash, must’ve been the size of the area that was way too big) but I don’t get to see anything. I followed this video here to the detail KML, creating a boundary - YouTube but without success.

I also tried to draw a boundary in Google earth directly and export/import that : same result → no display in AOG.
If I go check my field’s directory I do get a lot of correct (?) info about the area:
image

Has someone encountered this problem as well? In the video there is mention of doubles/decimals/comma’s getting mixed up…but I have no other source to compare with. Any hints would be greatly appreciated!

Your sim position is not where the field is, that is why you cant see it!

1 Like

Right…maybe things get mixed up there…
image

Ok , there it is… lat and long were inverted. My silly mistake
image

I’ll have to be careful not to fall off the edge of the world though… (so it is flat after all)

thanks!

3 Likes

Set the sim cords to somewhere in the field. Down to several decimal points. It will make things much bettter.

1 Like

When drawing fields in Google earth or qgis there are a few things to consider especially when using a the simulator.

  1. First, set the simulator coordinates to roughly somewhere inside the boundary you are drawing. Then restart AOG. This is important.

  2. Start a new field int that new position.

  3. Then start a new boundary for that field, create new outer, load the kml.

  4. If using QGIS generated, load the kml in google earth, save it, then use that saved file to make a boundary.

  5. double check the E:xxx N:xxxx are low numbers once the field is open, and that your zone is correct.

  6. A sim positioned somewhere in the world far from your field will only cause lots of grief. This of course never happens using tractor GPS as you know pretty well what field you are in already.

  7. I need to make the kml import more robust to include QGIS formatted kml files.

  8. If you click the GE icon ( the globe on the boundaries form ) you will be taken to GE where it will show you with a flag marker exactly where in the world your sim is set to. It should be within the bounds of the field of concern.

Hope these tips help.

2020-01-21

3 Likes

A bit more looking into this shows you need to save the kml properly from within QGIS and it works just fine. Be sure to save it with z dimension and clamped. Otherwise you only save latitude and longitude without an elevation value (even though it is 0) and AOG is looking for all 3. Which is why when you save the QGIS kml in Google earth, GE saves it with altitude and then aog can read it.

Also be sure to save it as a LineString for the Geometry type.

2020-01-25 (1)

4 Likes

Thanks for taking the time! Followed your instructions step by step and things went smoothly. (now my vehicle is in the field instead of way off) One thing I might perhaps add: there is no need to go via Google Earth: changing (“re-projecting”) to the CRS that Google earth uses (in the same dialog) saves another step–>
image

Thanks again!

2 Likes

Correct, there is no need to save in google earth if saved correctly in QGIS.

I followed the QGIS procedure starting from a survey shapefile made with Reach. Saved, including the Pseudo Mercator projection. However AOG can’t import the KML file. Here is the structure of the resulting KML. I toggled all attributes (name, fix, time, …) off when saving. Otherwise they end up in the KML file too. Opening in Google Earth and saving it from there does not change the structure.

Has the ‘Placemark’ something to do with it? Maybe somehow manipulate or simplify the original QGIS layer before saving?

<?xml version="1.0" encoding="utf-8" ?> <kml xmlns="http://www.opengis.net/kml/2.2"> <Document id="root_doc"> <Folder><name>test2</name> <Placemark> <Point><coordinates>2.x,50.y,0</coordinates></Point> </Placemark> <Placemark> <Point><coordinates>2.x,50.y,0</coordinates></Point> </Placemark> ... </Folder> </Document></kml>

Hi Karel, I am far away from having thorough knowledge of these things, yet, if you start following the QGIS training manual about here: 7.1. Lesson: Reprojecting and Transforming Data — QGIS Documentation documentation and take into account Brian’s remarks posted above, you should be able to import a geofence saved in QGIS directly into AOG. I haven’t had to change anything in the KML file… I can’t tell you what exactly will solve your specific problem though. As I said, I’m only a beginner…