You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using your library to convert some mongodb documents into postgis rows.
The way I do it is simple, with mongodb I decode the bson into a struct with map[string]interface{},
Then I use your library to convert the geojson part into ewkb.
But to do so I have to first use json.Marshal, because the Unmarshal method from geojson needs a json (in bytes) to Unmarshal it.
So it's Bson -> map[string]interface{} -> json -> Geometry
Would it be possible to use mapstructure to encode/decode (using maybe separate functions to not break the API), to prevent this kind of pattern?
It should be pretty simple from my very short experience with mapstructure in the past.
The text was updated successfully, but these errors were encountered:
I would be concerned about the performance overhead of using mapstructure for every conversion, but there's no reason that such code couldn't be included as a separate encoding package and would happily review a PR adding it.
However, if you're doing a one-off conversion from MongoDB to PostGIS, do the extra steps that you have to perform really matter?
Hi,
I'm using your library to convert some mongodb documents into postgis rows.
The way I do it is simple, with mongodb I decode the bson into a struct with
map[string]interface{}
,Then I use your library to convert the geojson part into ewkb.
But to do so I have to first use json.Marshal, because the Unmarshal method from geojson needs a json (in bytes) to Unmarshal it.
So it's Bson -> map[string]interface{} -> json -> Geometry
Would it be possible to use mapstructure to encode/decode (using maybe separate functions to not break the API), to prevent this kind of pattern?
It should be pretty simple from my very short experience with mapstructure in the past.
The text was updated successfully, but these errors were encountered: