How to enter "empty" value of POINT () geometry in MySQL field of type POINT?

I have a table with a POINT geometry field. I enter latitude / longitude points in it as follows:

 INSERT INTO table( point ) VALUES( POINT( lon_value, lat_value ); 

Sometimes I don't have lat / lon values ​​for input. I cannot enter empty, NULL, or empty POINT () ... since POINT (0,0) is actually a location on the globe, and that won't work either.

What is the solution here?

+6
source share
1 answer

I would use the coordinates of the North Pole

 INSERT INTO table( point ) VALUES( POINT(0.0000,90.0000); 

If the actual coordinates of the pole could be a problem, I would change the lon value from 0.0000.

+3
source

Source: https://habr.com/ru/post/989040/


All Articles