Questions tagged [mysql-spatial]

MySQL implements spatial extensions following the specification of the Open Geospatial Consortium (OGC).

52 questions
12
votes
1 answer

Mysql function MBRContains is not accurate

I have the following POLYGON (in the image you can see the area it covers) POLYGON((-74.05100448502202 4.7239278424321,-74.05092938316898 4.7241416902206,-74.04830618275201 4.7237460717602,-74.04643668306903 4.7234306460692,-74.04635688735101…
Oscar Gallardo
  • 2,240
  • 3
  • 27
  • 47
11
votes
3 answers

Query points within a given radius in MySQL

I have created the following MySQL table to store latitude/longitude coordinates along with a name for each point: CREATE TABLE `points` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(128) NOT NULL, `location` point NOT NULL, …
gjb
  • 6,237
  • 7
  • 43
  • 71
5
votes
2 answers

Mysql: ST_Contains with borders to detect if multipolygon contains point

I use mysql spatial functions. I have to understand if points lies withing multipolygon. Initially I used MBRContains but it works in a strange way, so I faced the following error: Mysql function MBRContains is not accurate My next step was…
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
5
votes
2 answers

What is the unit of measurement used in MySQL's spatial Buffer call?

The Buffer call is formatted Buffer(g,d). g is a geometry value (e.g. point, linestring, and polygon). d is a distance. What unit of measurement is d using? Meters? Miles? Kilometers?
James Chevalier
  • 10,604
  • 5
  • 48
  • 74
4
votes
2 answers

Symfony2/Doctrine2-spatial : Class 'Contains' is not defined

i am using https://github.com/djlambert/doctrine2-spatial and i have an error when trying a query with the "contains" function firstly, if i put this : dql: numeric_functions: Contains: …
Naeh
  • 119
  • 7
3
votes
1 answer

Get min/max POINTs from a POLYGON object

I have a table with a geom column containing polygons. e.g.: POLYGON((-104.98075 25.83706,-84.659531 25.83706,-84.659531 49.38449,-104.98075 49.38449,-104.98075 25.83706)),4326 How can I extract the minimum and maximum latitude and longitude…
Colin
  • 2,109
  • 1
  • 20
  • 22
3
votes
1 answer

How to insert point in mySQL table

I get an mySQL error saying 'ADDRESS_LONGI_LATIT_LOCATION' can not be null. Likely that 'geomfromtext/pointfromtext' is returning a null. Whats wrong here? Any help is appreciated. INSERT INTO address (ADDRESS_NICKNAME,ADDRESS_LONGI_LATIT_LOCATION)…
PCG
  • 2,049
  • 5
  • 24
  • 42
3
votes
2 answers

Doctrine 2 Spatial Data

I am having extreme difficulty making this doctrine2 extension works. It is https://github.com/djlambert/doctrine2-spatial and theres not a lot of doc on how to create a polygon. I got the config file working and all but I am struggling with…
delmalki
  • 1,326
  • 1
  • 13
  • 31
3
votes
0 answers

Construct lineString from points in mysql

Giving the following table (Position) +--------------------+---------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra …
3
votes
2 answers

Conversion of MySQL binary GEOMETRY fields in PHP

I’m working on an application integrating mapquest maps and using the mapquest API. At this moment I want to achieve the following: the registered user has to input latitude and longitude information, and in the database this information has to be…
G. Trennert
  • 561
  • 3
  • 12
  • 23
2
votes
2 answers

Import spatial data from PostGIS into MySQL

I have a PostgreSQL DB that contains KML data in one column of a table. I query it with postGIS commands with a query like this: SELECT ST_geomFromKML(geometry) ST_Intersects(ST_SetSRID(ST_Buffer(ST_MakePoint(11.255492,43.779251),0.002), 4326),…
DaFois
  • 2,197
  • 8
  • 26
  • 43
2
votes
0 answers

How to insert an mpoly in Mysql using WKB data

I'm trying to insert a mpoly WKB data into MySQL, which I get from a PostgreSQL dump. My table looks like this: CREATE TABLE `region` ( `id` int(11) NOT NULL AUTO_INCREMENT, `is_active` tinyint(1) NOT NULL, `sort_order` int(11) DEFAULT NULL, …
Nuschk
  • 518
  • 4
  • 14
1
vote
0 answers

How to get all the objects in a table where the coordinates intersects with polygon with SQL Spatial Data

I have an SQL table which called DATAB which contains thousands of objects ordered by the following colunms: [id] [angel] [latitude] [longitude] And i have this polygon set with STPolyFromText: DECLARE @polygon geography; SET @polygon =…
JonasBH
  • 31
  • 1
1
vote
1 answer

ST_EQUALS is not returning correct result?

I've come to these weird results when running ST_EQUALS on two Polygons: SELECT ST_EQUALS( ST_GEOMFROMTEXT( 'POLYGON((81.65 34.8667,81.65 5.9167,75.9833 34.8667,75.9833 5.9167,81.65 34.8667))',4326), ST_GEOMFROMTEXT( 'POLYGON((81.65 34.8667,81.65…
1
vote
1 answer

doctrine querybuilder syntax error expected =, <, <=, <>, >, >=, !=, got end of string

Having following error: "[Syntax Error] line 0, col -1: Error: Expected =, <, <=, <>, >, >=, !=, got end of string." building this query with doctrine querybuiler : SELECT * FROM area WHERE ST_Contains(polygon, ST_GeomFromText('POINT(13.405584…
jj-aa
  • 1,019
  • 5
  • 19
  • 39
1
2 3 4