-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Geography and Geometry. Putting the Genie Back in the Bottle... #764
Comments
Don't know if this will be helpful to you or not but I recently came up against the same challenge of inserting Geog/Geom into the DB -- specifically in the context of bulk loading... |
It sounds like there's a lot of work to be done around geometry/geography with this library. It's not something I have the knowledge or time to deal with, tbh. So this is going to remain a problem until someone who wants it has the time/inclination to fix it. |
Why don't you use a computed column for that? CREATE TABLE [geoms]( |
I have a similar problem. I select from one table, use toTable on it to get sql.Table object and try to bulk load that into another db. The geometry field wants it as varbinary. Checking github it's replaced at node-mssql/lib/tedious/request.js Line 604 in 26f5aab
Would be nice if a way to get the original binary for these insert and bulk purposes |
You can supply your own value handlers to avoid the built in geometry parsing if you want to keep the raw buffer. you can then parse it on demand if you need to. |
Thanks! Didn't see that. Then get a bcp issue about wrong type when using the buffer. However I think that's a tedious issue and not mssql. tediousjs/tedious#487 |
If I select a Georgraphy column, such as SpatialLocation in AdventureWorks.HumanResources.Address I get a nicely formatted JSON representation of the data in the column in SRID 4326 format.
Unfortunately If I attempt to insert that format back to the a geography column using a prepared statement I get a System.FormatException. I am currently forced to define the input as NVarChar(4000) since binding a Geometry doesn't appear to work. (#743).
I suspect that I am going to covert the JSON representation into some other format in order for the database to be able to consume it. Does anyone have any suggestions on a javascript library or SQL operator that can be used to perform the required conversion
The text was updated successfully, but these errors were encountered: