MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / ParseGeometryPointFromGeoHash

Function ParseGeometryPointFromGeoHash

pkg/geo/parse.go:203–214  ·  view source on GitHub ↗

ParseGeometryPointFromGeoHash converts a GeoHash to a Geometry Point using a Lng/Lat Point representation of the GeoHash.

(g string, precision int)

Source from the content-addressed store, hash-verified

201// ParseGeometryPointFromGeoHash converts a GeoHash to a Geometry Point
202// using a Lng/Lat Point representation of the GeoHash.
203func ParseGeometryPointFromGeoHash(g string, precision int) (Geometry, error) {
204 box, err := parseGeoHash(g, precision)
205 if err != nil {
206 return Geometry{}, err
207 }
208 point := box.Center()
209 geom, gErr := MakeGeometryFromPointCoords(point.Lon, point.Lat)
210 if gErr != nil {
211 return Geometry{}, gErr
212 }
213 return geom, nil
214}
215
216// ParseCartesianBoundingBoxFromGeoHash converts a GeoHash to a CartesianBoundingBox.
217func ParseCartesianBoundingBoxFromGeoHash(g string, precision int) (CartesianBoundingBox, error) {

Callers

nothing calls this directly

Calls 2

parseGeoHashFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…