When geocoding a gpx file that contains more than one features (tracks and waypoints), the leaflet_process_geofield() function in the leaflet.formatters.inc file returns empty data[] array. The geo_type of the geofield is geometrycollection, that is not handled in the above mentioned function.

Example of the geofield 'geom' string: GEOMETRYCOLLECTION (POINT (25.9186362 42.5791489), POINT (26.2962133 42.1546311), POINT (26.2951551 42.1359542), POINT (26.2952237 42.1352874), POINT (26.2857745 42.1522796), POINT (26.2850159 42.1519984), POINT (26.2840865 42.1524652), POINT (25.571382 41.9529739), POINT (20.0358468 47.9019474), POINT (20.3159616 47.5072132), POINT (20.3149705 47.5073412), POINT (20.0305933 47.8984178), POINT (20.0213634 47.8926575), POINT (19.8413791 47.8953517), POINT (20.0316074 47.8936014), POINT (20.0215046 47.8958223), POINT (20.0312725 47.8936983), LINESTRING (20.03624 47.9022243, 20.0361933 47.9022289, 20.0362102 47.9022034, 20.0362435 47.9021819, 20.036252 47.9021677), LINESTRING (20.260004 47.3452188, 20.2600114 47.3452157, 20.2600135 47.3452164, 20.2600158 47.345217, 20.2600183 47.3452178))

CommentFileSizeAuthor
#1 2126475.patch1.39 KBbalagan

Comments

balagan’s picture

StatusFileSize
new1.39 KB

I suppose gpx files only contain points and linestrings (waypoints and tracks). The enclosed patch handles geometrycollections with points and linestrings.

balagan’s picture

Status: Active » Needs review
gcb’s picture

Status: Needs review » Fixed

Excellent, thanks. And thanks for the demo data, very useful for testing. Rolled into Dev, look for it in the next point release.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.