Class GpxWriter

    • Constructor Detail

      • GpxWriter

        public GpxWriter​(java.io.PrintWriter out)
        Constructs a new GpxWriter.
        Parameters:
        out - The output writer
      • GpxWriter

        public GpxWriter​(java.io.OutputStream out)
        Constructs a new GpxWriter.
        Parameters:
        out - The output stream
    • Method Detail

      • getMetaTime

        public java.time.Instant getMetaTime()
        Returns the forced metadata time information, if any.
        Returns:
        the forced metadata time information, or null
        Since:
        18219
      • setMetaTime

        public void setMetaTime​(java.time.Instant metaTime)
        Sets the forced metadata time information.
        Parameters:
        metaTime - the forced metadata time information, or null to use the current time
        Since:
        18219
      • write

        public void write​(GpxData data)
        Writes the given GPX data.
        Parameters:
        data - The data to write
      • write

        public void write​(GpxData data,
                          GpxConstants.ColorFormat colorFormat,
                          boolean savePrefs)
        Writes the given GPX data.
        Parameters:
        data - The data to write
        colorFormat - determines if colors are saved and which extension is to be used
        savePrefs - whether layer specific preferences are saved
      • openln

        private void openln​(java.lang.String tag)
      • openln

        private void openln​(java.lang.String tag,
                            java.lang.String attributes)
      • open

        private void open​(java.lang.String tag)
      • open

        private void open​(java.lang.String tag,
                          java.lang.String attributes)
      • inline

        private void inline​(java.lang.String tag,
                            java.lang.String attributes)
      • close

        private void close​(java.lang.String tag)
      • closeln

        private void closeln​(java.lang.String tag)
      • simpleTag

        private void simpleTag​(java.lang.String tag,
                               java.lang.String content)
        if content not null, open tag, write encoded content, and close tag else do nothing.
        Parameters:
        tag - GPX tag
        content - content
      • simpleTag

        private void simpleTag​(java.lang.String tag,
                               java.lang.String content,
                               java.lang.String attributes)
      • gpxLink

        private void gpxLink​(GpxLink link)
        output link
        Parameters:
        link - link
      • wayPoint

        private void wayPoint​(WayPoint pnt,
                              int mode)
        output a point
        Parameters:
        pnt - waypoint
        mode - WAY_POINT for wpt, ROUTE_POINT for rtept, TRACK_POINT for trkpt