I have a portal set up where geographical regions are shown on maps. The regions are created from gpx files where lat/long value of the first trkpt gpx element is the same as the last one (in document order). Is there a way to import/convert such gpx files so that the geocode conversion will produce a polygon instead of linestring? OpenLayers FillColor style can not be applied to linestrings (so it seems) and as a result I am unable to show the imported regions filled with solid color in the maps.

I tried to attach an example gpx file, but that file type is not supported. Will send it upon request.