[OSM-talk] GPX upload via API

Tom Hughes tom at compton.nu
Thu Aug 16 09:16:15 BST 2007

In message <8b65902a0708160057r2273e4d1rcf387d22e5b758ee at mail.gmail.com>
        Guilhem Bonnefille <guilhem.bonnefille at gmail.com> wrote:

> On 7/25/07, Christof Dallermassl <cdaller.hw at gmx.at> wrote:
>> I just added a java class that allows to upload one or more gpx files in
>>   batch mode. Check out at
>> http://svn.openstreetmap.org/applications/utils/gps-tracks/jgpxupload/
> Reading at the code, I do not understand the 3 following lines:
>             String urlGpxName =
> URLEncoder.encode(gpxName.replaceAll("\\.","_"), "UTF-8");
>             String urlDesc =
> URLEncoder.encode(description.replaceAll("\\.","_"), "UTF-8");
>             String urlTags =
> URLEncoder.encode(tags.replaceAll("\\.","_"), "UTF-8");
> more precisly, what's the goal of the call ".replaceAll("\\.","_")"?
> I understand that this replace all dots by an underscore. Am I right?
> What's for?

The problem is that GPX upload API encodes those fields in the URL and
there are certain characters (including .) which you can't use in a
URL component with rails as it will treat then as starting a new


Tom Hughes (tom at compton.nu)

More information about the talk mailing list