I recently created a few KML files in Google Earth. FarmOS imported some, but some it didn’t. An example of one that didn’t import. said Check your console for more details.
"kml:1 [Deprecation] The keyword ‘push-button’ specified to an ‘appearance’ property is not standardized. It will be removed in the future.
kml?ajax_form=1&_wrapper_format=drupal_ajax:1
Failed to load resource: the server responded with a status of 500 (500 Service unavailable (with message))
js_Llh0A90bS4Fwaiyc6b0p0Pp2Z6IhOUlmPL4p9_GXh_A.js?scope=footer&delta=0&language=en&theme=gin&include=eJx9UNGSgyAM_CGq33Bf4sQQNW0kXIDOeF9_WA879eEeGJLd7G4A1agPaisI_5BDAdN-Fh1BbilvwmF2M4e-Hof7rLcSQTrAzE-6Vf7R-IED51czGoFHK-t4coBI4WBTZnxsbgJbh8JDXmilflLNZB8RqCIQEx0gh8qHCt-_C9nWTXVnN7Gc43t9MV1I4oelN41jyVmDy6oygvV_96FEEAr-ip5-DW2Pan1JZC1irztGDeklZnqbgV_fooZ22Yj-obpFn_VjrhQlhEhfu-yypNHMNf0XP4y2nQ:89 Uncaught Drupal.AjaxError
kml:1 [Deprecation] The keyword ‘push-button’ specified to an ‘appearance’ property is not standardized. It will be removed in the future.
kml:1 Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received
"
Qgis is ok with this file. Any help will be appreciated.
Thanks for that info. I did three things, 1) removed spaces in the names of things 2) removed things related to appearance, eg. color and line width, and 3) removed outside boundaries.
I’m not sure which one of these changes did it but it finally imported.
We’ve had similar reports over the years that some KML files work and some do not. I think that it depends a lot on what is contained in the KML. I wouldn’t be surprised if removing the “things related to appearance, eg. color and line width” fixed it. But the “outside boundaries” could also have an effect.
It’s worth noting that the farmOS KML Import module code is custom. We wrote it ourselves as a simple extension of an XML encoder/decoder. It does not use an existing KML library. This means that it’s probably not perfect itself, and can’t handle every possible KML file. We might be able to improve that by using GeoPHP’s KML parsing (which is used when you upload individual KML files to assets/logs and click the “Load from file” button). So that might be a good next step if anyone wants to work on it.
I think the technical challenge is that we need to be able to intelligently split the file up into multiple distinct assets. Here is the custom KML decoder method in farmOS: farmOS/modules/core/kml/src/Encoder/Kml.php at 219e00c8744d38159d217c353245006374379e3a · farmOS/farmOS · GitHub
The link you included gives me the chance to “peep behind the curtain” of FarmOS. I think once I get my existing data into the system things will go much smoother.