Search This Blog

Thursday, May 18, 2017

mySQL Error Code: 3037 Invalid GIS data provided to function st_geometryfromtext.

If you have been trying to find what's wrong with your geometry objects and why your sql insert statement is failing, check this, which reveals the cause (congrats to all of us who went "as far as completing a BSc degree in computer science" (and how far is that?) and could yet miss this...).

I was startled because, in cloning some tables from one DB schema to another, I was facing this error. But how come values that do exist in one table cannot be inserted (are treated as invalid) in another ?

Later on I heard that this was a change made in later versions of mySQL. So I assume the records were inserted at the time this constraint was not there yet. And they must have kept existing data as valid for backward compatibility.

No comments:

Post a Comment