KML import from Google Earth

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.

   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.

indywestge_mar14.txt (55.3 KB)

i tried with ours farm instance different error occurred.

The website encountered an unexpected error. Try again later.Exception:

>  Serialization of 'SimpleXMLElement' is not allowed in serialize()

(line 14 of core/lib/Drupal/Component/Serialization/PhpSerialize.php). Drupal\\Component\\Serialization\\PhpSerialize::encode() (Line: 111)\nDrupal\\Core\\KeyValueStore\\DatabaseStorageExpirable->doSetWithExpire() (Line: 127)\nDrupal\\Core\\KeyValueStore\\DatabaseStorageExpirable->setWithExpire() (Line: 193)\nDrupal\\Core\\Form\\FormCache->setCache() (Line: 463)\nDrupal\\Core\\Form\\FormBuilder->setCache() (Line: 441)\nDrupal\\Core\\Form\\FormBuilder->rebuildForm() (Line: 633)\nDrupal\\Core\\Form\\FormBuilder->processForm() (Line: 325)\nDrupal\\Core\\Form\\FormBuilder->buildForm() (Line: 73)\nDrupal\\Core\\Controller\\FormController->getContentResult()\ncall_user_func_array() (Line: 123)\nDrupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->Drupal\\Core\\EventSubscriber\\{closure}() (Line: 627)\nDrupal\\Core\\Render\\Renderer->executeInRenderContext() (Line: 124)\nDrupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)\nDrupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->Drupal\\Core\\EventSubscriber\\{closure}() (Line: 181)\nSymfony\\Component\\HttpKernel\\HttpKernel->handleRaw() (Line: 76)\nSymfony\\Component\\HttpKernel\\HttpKernel->handle() (Line: 54)\nDrupal\\simple_oauth\\HttpMiddleware\\BasicAuthSwap->handle() (Line: 58)\nDrupal\\Core\\StackMiddleware\\Session->handle() (Line: 48)\nDrupal\\Core\\StackMiddleware\\KernelPreHandle->handle() (Line: 28)\nDrupal\\Core\\StackMiddleware\\ContentLength->handle() (Line: 32)\nDrupal\\big_pipe\\StackMiddleware\\ContentLength->handle() (Line: 106)\nDrupal\\page_cache\\StackMiddleware\\PageCache->pass() (Line: 85)\nDrupal\\page_cache\\StackMiddleware\\PageCache->handle() (Line: 48)\nDrupal\\Core\\StackMiddleware\\ReverseProxyMiddleware->handle() (Line: 51)\nDrupal\\Core\\StackMiddleware\\NegotiationMiddleware->handle() (Line: 36)\nDrupal\\Core\\StackMiddleware\\AjaxPageState->handle() (Line: 51)\nDrupal\\Core\\StackMiddleware\\StackedHttpKernel->handle() (Line: 704)\nDrupal\\Core\\DrupalKernel->handle() (Line: 19)\n", name: "AjaxError", stack: "@

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.


  • John

Glad you figured it out @jgm48!

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.


1 Like