Dear all (or BMV),
I would like to continue with my problem posted in a previous thread. I have thousands of kml files that need to converted to geojson. For that I need to remove the accuracy that is integrated in the kml coordinate string (explained in the start of this threat). BMV provided me with a great solution to remove the accuracy string with VBA coding (see attached excel). Unfortunately, the solution does not cover my entire dataset. It appears that some of my kml records (coordinate strings) do not have an accuracy string at all (see example below at point b)). So I sometimes have the following coordinate combinations in my kml strings (each coordinate set seperated by a space):
Occurences of kml strings in my dataset (Lon , lat , accuracy):
a) [space]-43.483182,-22.544959,0.0[space]
b) [space]-43.483182,-22.544959[space]
c) [space]-43.483182,-22.544959,3.567[space]
d) [space]-43.48318266,-22.54495944,35.566[space]
The script of BMV nicely removes the accuracy from the kml coding (see excel provided by him/her in this threat), either 0.0's or other accuracy values (e.g. 3.567). However, the problem with the script that BMV provided is that it removes always the accuracy based on a comma, even in case of b) (so when there is no accuracy string) (see red cell in example excel). So in case there is no accuracy, the script removes the lat value... And that gives problems. For the rest, the script created by BMV works perfect. Is there a way the BMV script can be modified so that it only removes accuracy when it is there? So only in case there are 3 comma's in a string....? Many thanks in advance!
Bookmarks