-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
I have a table with geometry(point,4326) column. When trying to insert a record using a PostGISPoint type, postgres gives the following error:
ERROR: parse error - invalid geometry at character ...
HINT: "\x" <-- parse error at position 2 within geometry
STATEMENT: INSERT INTO "devices" ("geolocation") VALUES ('\x535249443d343332363b504f494e542833372e3431333332333530202d3132322e303831323637303029')
After some search, I discovered that if I don't convert a point value to byte array, it works fine (postgis.go, line 21):
// this
return fmt.Sprintf("SRID=4326;POINT(%.8f %.8f)", p.Lon, p.Lat), nil
// instead of this
return []byte(fmt.Sprintf("SRID=4326;POINT(%.8f %.8f)", p.Lon, p.Lat)), nil
Maybe I don't understand completely how postgis works. So can you please clarify why conversion to byte array is needed and how do I make it work without modifying your library?
Metadata
Metadata
Assignees
Labels
No labels