This requires a bunch of changes since the types on these tables are much closer to the underlying types of the Fieldseeker data we are getting back from the API. I now need to use proper UUID types everywhere, which means I had to modify the bob gen config to consistently use google UUID, my UUID library of choice. I also had to add the organization_id to all the fieldseeker tables since we rely on them existing for some of our compound queries. There were some changes to the API type signatures to get things to build. I may yet regret those.
26 lines
645 B
Go
26 lines
645 B
Go
package main
|
|
import (
|
|
"encoding/json"
|
|
"errors"
|
|
//"fmt"
|
|
|
|
"github.com/stephenafamo/bob/types"
|
|
"github.com/uber/h3-go/v4"
|
|
)
|
|
func getPoint(geom types.JSON[json.RawMessage]) (h3.LatLng, error) {
|
|
/*
|
|
I need to figure out how to convert from the weird bob
|
|
type of types.JSON[json.RawMessage] to a X/Y coordinate to
|
|
here, but I need an Internet connection to do that effectively.
|
|
*/
|
|
return h3.LatLng{}, errors.New("need to implement this")
|
|
/*
|
|
msg, err := geom.Value()
|
|
if err != nil {
|
|
return h3.LatLng{}, fmt.Errorf("Can't get underlying JSON value: %w", err)
|
|
}
|
|
x := msg.Get("x")
|
|
y := msg.Get("y")
|
|
return h3.NewLatLng(x, y), nil
|
|
*/
|
|
}
|