// NewPointSetFromWKB will take raw WKB and set the data for a new point set.
// The WKB data must be of type LineString, Polygon or MultiPoint.
// Will return nil if invalid WKB.
345577
func NewPointSetFromWKB(wkb []byte) *PointSet {
	ps := &PointSet{}
	if err := ps.unmarshalWKB(wkb); err != nil {
		return nil
	}

	return ps
}
294071
func NewSetGlobalPositionSetpointInt(LATITUDE int32, LONGITUDE int32, ALTITUDE int32, YAW int16, COORDINATE_FRAME uint8) *SetGlobalPositionSetpointInt {
	m := SetGlobalPositionSetpointInt{}
	m.LATITUDE = LATITUDE
	m.LONGITUDE = LONGITUDE
	m.ALTITUDE = ALTITUDE
	m.YAW = YAW
	m.COORDINATE_FRAME = COORDINATE_FRAME
	return &m
}
278702
func newBboxFromMarkers(m []Marker) (bbox, error) {
	var geom string
	switch len(m) {
	case 0:
		return bbox{}, fmt.Errorf("zero length markers, can't determine map bounds")
	case 1:
		geom = fmt.Sprintf("POINT(%f %f)", m[0].longitude, m[0].latitude)
	default:
		geom = "LINESTRING("
		for _, mr := range m {
			geom = geom + fmt.Sprintf("%f %f,", mr.longitude, mr.latitude)
		}
		geom = strings.TrimSuffix(geom, ",")
		geom = geom + ")"
	}

	for _, b := range mapBounds {
		var in bool
		err := db.QueryRow(`select ST_Within(ST_Shift_Longitude(st_setsrid(ST_GeomFromText($1), 4326)), 
		ST_Shift_Longitude(ST_MakeEnvelope($2,$3,$4,$5, 4326)))`, geom, b.llx, b.lly, b.urx, b.ury).Scan(&in)
		if err != nil {
			return bbox{}, err
		}

		if in {
			return b, nil
		}
	}

	return world, nil
}
632267
func NewGeoPointFieldMapping() *FieldMapping {
	return &FieldMapping{
		Type:         "geopoint",
		Store:        true,
		Index:        true,
		IncludeInAll: true,
		DocValues:    true,
	}
}
956948
func NewPointFromSeries(key []byte, fields Fields, t time.Time) Point {
	return &point{
		key:    key,
		time:   t,
		fields: fields.MarshalBinary(),
	}
}
1248526
func newNonTS() *SetNonTS {
	s := &SetNonTS{}
	s.m = make(map[interface{}]struct{})

	// Ensure interface compliance
	var _ Interface = s

	return s
}
537892
func FromWKB(wkb []byte) (*Geometry, error) {
	decoder := newWkbDecoder()
	return decoder.decode(wkb)
}
604445
func NewBoundFromPoints(corner, oppositeCorner *Point) *Bound {
	b := &Bound{
		sw: corner.Clone(),
		ne: corner.Clone(),
	}

	b.Extend(oppositeCorner)
	return b
}
607299
func NewBitset(length uint, indexs ...uint) *Bitset {
	nonZeroLen(length)
	s := &Bitset{
		length: length,
		set:    newUnits(unitCount(length)),
	}

	for _, i := range indexs {
		s.Set(i)
	}

	return s
}
834432
func NewLineFromWKB(wkb []byte) *Line {
	l := &Line{}
	if err := l.unmarshalWKB(wkb); err != nil {
		return nil
	}

	return l
}
640357
func (s *S3CopyObjectOperation) SetNewObjectMetadata(v *S3ObjectMetadata) *S3CopyObjectOperation {
	s.NewObjectMetadata = v
	return s
}
553655
func (mp MultiPolygon) WKT() string {
	var result string
	switch len(mp.Coordinates) {
	case 0:
		result = "MULTIPOLYGON EMPTY"
	default:
		result = fmt.Sprintf("MULTIPOLYGON (%v)", array4ToWKTCoordinates(mp.Coordinates))
	}
	return result
}
1044732
func newCPartsFromTopicPartitions(partitions []TopicPartition) (cparts *C.rd_kafka_topic_partition_list_t) {
	cparts = C.rd_kafka_topic_partition_list_new(C.int(len(partitions)))
	for _, part := range partitions {
		ctopic := C.CString(*part.Topic)
		defer C.free(unsafe.Pointer(ctopic))
		rktpar := C.rd_kafka_topic_partition_list_add(cparts, ctopic, C.int32_t(part.Partition))
		rktpar.offset = C.int64_t(part.Offset)
	}

	return cparts
}
69071
func NewPointFlat(l Layout, flatCoords []float64) *Point {
	g := new(Point)
	g.layout = l
	g.stride = l.Stride()
	g.flatCoords = flatCoords
	return g
}
794657
func NewPoint(lat float64, lng float64) *Point {
	return &Point{lat: lat, lng: lng}
}
454475
func MultiPointFromBytes(bytes []byte) (*MultiPoint, error) {
	var result MultiPoint
	err := json.Unmarshal(bytes, &result)
	return &result, err
}
186236
func NewUnknownEndpointError(p, s, r string, known []string) UnknownEndpointError {
	return UnknownEndpointError{
		awsError: awserr.New("UnknownEndpointError",
			"could not resolve endpoint", nil),
		Partition: p,
		Service:   s,
		Region:    r,
		Known:     known,
	}
}