func makeRect(s string) Rect {
	var rect Rect
	lls := parseLatLngs(s)
	if len(lls) > 0 {
		rect = RectFromLatLng(lls[0])
	}
	for _, ll := range lls[1:] {
		rect = rect.AddPoint(ll)
	}
	return rect
}
makeRect returns the minimal bounding Rect that contains the values in the input string.
package s2
import (
	"bytes"
	"fmt"
	"io"
	"strconv"
	"strings"
	"github.com/golang/geo/r3"
)
func writePoint(w io.Writer, p Point) {
	ll := LatLngFromPoint(p)
	fmt.Fprintf(w, "%.15g:%.15g", ll.Lat.Degrees(), ll.Lng.Degrees())
}
func writePoints(w io.Writer, pts []Point) {
	for i, pt := range pts {
		if i > 0 {
			fmt.Fprint(w, ", ")
		}
		writePoint(w, pt)
	}
}
func parsePoint(s string) Point {
	p := parsePoints(s)
	if len(p) > 0 {
		return p[0]
	}
	return Point{r3.Vector{0, 0, 0}}
}
func pointToString(point Point) string {
	var buf bytes.Buffer
	writePoint(&buf, point)
	return buf.String()
}
func parsePoints(s string) []Point {
	lls := parseLatLngs(s)
	if len(lls) == 0 {
		return nil
	}
	points := make([]Point, len(lls))
	for i, ll := range lls {
		points[i] = PointFromLatLng(ll)
	}
	return points
}
func pointsToString(points []Point) string {
	var buf bytes.Buffer
	writePoints(&buf, points)
	return buf.String()
}
func parseLatLngs(s string) []LatLng {
	var lls []LatLng
	if s == "" {
		return lls
	}
	for _, piece := range strings.Split(s, ",") {
		piece = strings.TrimSpace(piece)
		if piece == "" {
			continue
		}
		p := strings.Split(piece, ":")
		if len(p) != 2 {
			panic(fmt.Sprintf("invalid input string for parseLatLngs: %q", piece))
		}
		lat, err := strconv.ParseFloat(p[0], 64)
		if err != nil {
			panic(fmt.Sprintf("invalid float in parseLatLngs: %q, err: %v", p[0], err))
		}
		lng, err := strconv.ParseFloat(p[1], 64)
		if err != nil {
			panic(fmt.Sprintf("invalid float in parseLatLngs: %q, err: %v", p[1], err))
		}
		lls = append(lls, LatLngFromDegrees(lat, lng))
	}
	return lls
}