Problem/Motivation

Some file format variants (eg. in KML/GeoJSON) aren't geocoded properly - it appears sensitive to variations in file format syntax. If geocoding fails, geocoder module should at least throw an error message and/or log the failure.

How to repeat:

* Add a file upload field
* Add a geofield using the "geocode from another field" widget
* In settings, geocode from the file upload field and select KML as the handler
* Upload a KML file known to fail to the file field (see attached, nb. I have had to add the "txt" extension here)
* Save
* No error message is displayed or logged

On a quick look, there is no error handler in the KML/GPX/JSON/WKT handler plugins, after sending them to GeoPHP. For example, see:

* geocoder/plugins/geocoder_handler/kml.inc
* geocoder/plugins/geocoder_handler/gpx.inc
* geocoder/plugins/geocoder_handler/json.inc
* geocoder/plugins/geocoder_handler/wkt.inc

Compare this to "google.inc" where errors returned by the service are handled and sent to watchdog (https://www.drupal.org/node/2123403).

Proposed resolution

Handle errors returned by GeoPHP (assuming they are), and send to watchdog.

In this case (file uploads), it would help to display an informational message to the user, so they would know and potentially be able to correct the problem (eg. by exporting the file from a different tool).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Pol’s picture

Status: Active » Closed (outdated)
sano’s picture

I wonder why was this issue closed? What makes it outdated? I am seeing a problem of similar nature when uploading a (particular) gpx file, which is not getting geocoded. No error messages are generated, which obviously makes site development harder than it could be.