Questions tagged [mysql-spatial]

MySQL spatial refers to the Extensions for Spatial Data, that enable the generation, storage, and analysis of geographic features.

For more information on the MySQL Extensions for Spatial Data see:

http://dev.mysql.com/doc/refman/5.7/en/spatial-extensions.html

61 questions
14
votes
2 answers

Data types for storing lng/lat in MySQL

I'm storing a large list of lnt/lat points in a MySQL database. At the moment these are projected points for the UK in M, but in the long term I would like to make sure that I can store the coordinates of points for all over the world. What…
djq
  • 16,297
  • 31
  • 110
  • 182
4
votes
2 answers

MySQL normalizing points with latitude > 90

Facing very strange problem, I've points table for storing location of users in location(POINT) column. Problem with st_distance_sphere function where I've stored some specific location. update points set location = point(30.492039, 76.587216) WHERE…
Govind Samrow
  • 143
  • 1
  • 6
3
votes
0 answers

Query WKT from BLOB in mysql

I am trying to query a table in MySQL which contains spatial data. Out of all the columns, I have one column called "pt". Each entry in this field is specified as 'BLOB'. In my MySQL workbench 6.3,when I right click on any of these entries, it takes…
R.N.
  • 31
  • 1
2
votes
1 answer

Is there a way of doing ST_SnapToGrid in MySql?

Given that MySQL 5.7 has spatial data types Is there an equivalent to PostGIS's ST_SnapToGrid in MySQL? Looking at the reference: http://dev.mysql.com/doc/refman/5.7/en/spatial-function-reference.html I can't find one. Is there something else I…
zod
  • 555
  • 1
  • 5
  • 16
1
vote
1 answer

MySQL: Query the envelope (mbr, extents) of a spatial table?

this question provides a solution to get the evelope (aka: mbr, aka: extents) of a spatial table in PostGIS, but I'm having trouble doing the same in MySQL. The ogr MySQL driver does this, and a solution is noted here on a Ruby forum (circa 2006),…
elrobis
  • 6,456
  • 1
  • 31
  • 53
1
vote
1 answer

MySql select points contained in polygon

I am extremely new to mysql, but I cannot find the error in this query SELECT latitude, longitude from mytable where ST_CONTAINS(ST_GEOMFROMTEXT('POLYGON((47 -67, 47 -123, 21 -78, 47 -67)'), point(longitude, latitude)) The polygon is a triangle…
0
votes
0 answers

Calculate latitude and longitude based on distance (miles)

I have been trying to get location details based on miles with the below query, SELECT * FROM (SELECT id,loc1, zipcode, latitude,longitude, (3959 * acos(cos(radians(36.0411)) * cos(radians(latitude)) * cos(radians(longitude) - radians(-115.2163)) +…
0
votes
1 answer

mySQL Spatial ST_contains does not include all Results

I when I run the first command, mySQL 5.7 only shows a sub-collection of all results. Only when I run the 2nd command I get the correct answer. The problem with the 2nd command: I cannot use the performance boost of the spatial index anymore…
frizzer
  • 1
  • 1