MySQL implements spatial extensions following the specification of the Open Geospatial Consortium (OGC).
Questions tagged [mysql-spatial]
52 questions
1
vote
1 answer
How to unpack MySQL Multipoint geometry data in PHP?
Okay, so I think I'm close here, but I'm hitting a limitation in my understanding of binary data.
I'm parsing some MySQL data inserted as geometry types, using PHP's unpack() as my parser, and everything was going swimmingly until I started trying…

wosevision
- 123
- 11
1
vote
2 answers
What type of data are returned by the X() and Y() MySql functions that take a point field as parameter
I am not so into database. Into a geospatial query I have something like this:
SELECT X(gps) AS longitude, Y(gps) AS latitude FROM MyTable
Where the gps field hve point as type.
And it returnes value like:
29,3715 -2,1790
My doubt is: what is…

AndreaNobili
- 40,955
- 107
- 324
- 596
1
vote
0 answers
MySQL ST_Buffer minimum radius
I have a series of polygons stored in a MySQL table that I need to return as exploded polygons which are a minimum of a given distance from the original.
The ST_Buffer function performs a very similar function to what I am after however the distance…

Nibbles
- 11
- 2
1
vote
1 answer
Invalid GIS data provided to function st_geometryfromtext in MySQL
Here is my error:
Error Number: 3037
Invalid GIS data provided to function st_geometryfromtext.
Here is my code:
SELECT ST_Within(ST_GEOMFROMTEXT('POINT(12.971201 077.652038)'),
ST_GEOMFROMTEXT('POLYGON((13.517837674890684…

Blesson Christy
- 380
- 3
- 13
1
vote
1 answer
What is the units of measure used in this MySQL geo query that finds all the points having a specific distance from a center point?
I am working on a MySQL geographical query.
So, following this tutorial: http://howto-use-mysql-spatial-ext.blogspot.it/2007/11/using-circular-area-selection.html
I have implemented this query that finds all the points having a specific distance…

AndreaNobili
- 40,955
- 107
- 324
- 596
1
vote
1 answer
Not getting expected output from doctrine query as getting mysql native sql query, I am using doctrine2-spatial extension
I am fetching sites which comes within a polygon, using following native sql query.
And its giving me number of site ids.
SELECT s.siteID from Sites s where st_contains( (SELECT polygon from Region where RegionId=9 ) , point( s.latitude,s.longitude…

vikram eklare
- 800
- 7
- 25
1
vote
0 answers
Executes when startPoint and endPoint are in same road
Can you suggest the code to find the routing when the startpoint and endpoint are in the same road in sql server
SET @e = (
SELECT TOP 1 a.target
FROM Routes a
WHERE a.geom.STIntersects(geometry::Point(@endLon ,@endLat…

JACK
- 11
- 2
1
vote
1 answer
MySQL: how to get lat/lgn values from GEOMETRY column?
If a series of latitude and longitude values are stored in a GEOMETRY column in MySQL, is there a way to get back those values once it's been stored as a geometry data type? Sample data:
CREATE TABLE poi_milan_fp
( idno INTEGER,
name…

StackOverflowNewbie
- 39,403
- 111
- 277
- 441
1
vote
1 answer
MySQL and splitting spacial data
I have a MySQL table that we are using for storing of some latitude and longitude. The coordinates are defined as a 'geometry' type column and can contain any number of coordinate pairs.
When I run this code, I get the conversion of the geometry…

user1721373
- 21
- 1
- 5
1
vote
1 answer
Mysql Join on three tables containing spatial data
I have three tables
Outlets (shopId, shopName,shopLatitude,shopLongitude,g) (450 Rows)
g is of type geometry and contains value point(latitude longitude)
Offers (offerId,offername,offerDescription) (450 Rows)
Offer_Outlets
(offerId,shopId) (503…

Zach
- 9,989
- 19
- 70
- 107
1
vote
2 answers
Create geometry (f.e. LineString()) from stored points. MySQL spatial
Is there any way to create some Geometry (f.e. LineString(pt1,pt2,...)) from MySQL query (where pt1,pt2,... is a result of another query, in other words pt1,pt2,... stored in MySQL table)?
Example: SELECT LineString(SELECT point FROM points) AS…

Yaroslav
- 651
- 2
- 9
- 17
1
vote
0 answers
Create a rectangle with user location as centre of it
I am trying fetch all points within 50 km radius of user location from MySQL. For this I am using spatial data. I am trying to execute this query
select lat, lon from geom where
MBRContains(
GeomFromText('Polygon((46 -123, 48 -123, 48 -121,…

Zach
- 9,989
- 19
- 70
- 107
1
vote
1 answer
Source data type [geometry] not supported
I am using Navicat Premium to Migrate my Data from Postgresql to Mysql.
I am facing a strang error while migration. It says that Migration is not possible due to Geometry object not available.
I am pasting the logs here..
[Msg] [Dtf] DataTransfer…

writeToBhuwan
- 3,233
- 11
- 39
- 67
0
votes
0 answers
MySQL ST_GeomFromText is not recognizing query LINESTRING('...')
Trying to transform a set of points in a LINESTRING gives me an error
SELECT way_nodes.way_id,
ST_GeomFromText(
CONCAT('LINESTRING(',
GROUP_CONCAT(CONCAT(ST_X(location), ' ', ST_Y(location)) ORDER BY…

Juliana Aragão
- 11
- 2
0
votes
0 answers
Mysql Query to get one co-ordinate in 10 mete radius
In the database we have multiple latitude and longitude in 10 meter circle. So I need a query which will fetch only one latitude and longitude in every 10 meter radius.
I am expecting to get only one co-ordinate in every 10 meter circle. If multiple…

subhashish
- 1
- 1