MCPcopy Create free account
hub / github.com/dolthub/doltgresql / FromSpatialObject

Function FromSpatialObject

postgres/parser/json/json.go:958–964  ·  view source on GitHub ↗

FromSpatialObject transforms a SpatialObject into the json.JSON type.

(so geopb.SpatialObject, numDecimalDigits int)

Source from the content-addressed store, hash-verified

956
957// FromSpatialObject transforms a SpatialObject into the json.JSON type.
958func FromSpatialObject(so geopb.SpatialObject, numDecimalDigits int) (JSON, error) {
959 j, err := geo.SpatialObjectToGeoJSON(so, numDecimalDigits, geo.SpatialObjectToGeoJSONFlagZero)
960 if err != nil {
961 return nil, err
962 }
963 return ParseJSON(string(j))
964}
965
966// FromDecimal returns a JSON value given a apd.Decimal.
967func FromDecimal(v apd.Decimal) JSON {

Callers

nothing calls this directly

Calls 2

SpatialObjectToGeoJSONFunction · 0.92
ParseJSONFunction · 0.85

Tested by

no test coverage detected