mysql-spatial

Mysql function MBRContains is not accurate

感情迁移 提交于 2020-01-22 11:58:47
问题 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 4.7234105978214,-74.04636526925401 4.7233310730989,-74.046191260944 4.72327293317,-74.04579027069599 4.7232007594583,-74.04141290558402 4.7214258184083,-74.03746201170497 4.7197791822891,-74.03565688503801 4.7189879401666,-74.033484295736 4.7180897723398

Create geometry (f.e. LineString()) from stored points. MySQL spatial

故事扮演 提交于 2019-12-23 05:52:13
问题 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 line; Thanks! 回答1: I had a similar problem and solved it in this way: SELECT pt1, pt2, pt3, pt4, @Line_string := GEOMFROMTEXT(CONCAT('LINESTRING(',pt1,' ',pt2,', ',pt3,' ',pt4,')')) FROM table; 回答2: LineString(pt1,pt2) MySQL and MariaDB both support

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

对着背影说爱祢 提交于 2019-12-12 10:10:45
问题 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? 回答1: There aren't units here, or in any of the spatial analysis functions. These functions are commonly used with geometriy values with coordinates using degrees latitude and longitude, but the spatial capabilities can be used with data from any arbitrary grid coordinate system, and the server's capabilities

Conversion of MySQL binary GEOMETRY fields in PHP

╄→гoц情女王★ 提交于 2019-12-12 08:56:48
问题 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 stored as geometry type field. Conversely, a user looking at their account should see the latitude and longitude information that was entered. In an earlier simplified codebase I achieved this directly in the MySQL query, by using the MySQL

Why I obtain this error when I try to create this funcion (that use point data type) on a MariaDB database?

こ雲淡風輕ζ 提交于 2019-12-12 05:38:42
问题 I am not so into database and I have the following doubt implementing this tutorial: https://mariadb.org/jquery-and-gis-distance-in-mariadb/ So basically my doubt is relate to this SQL statment that create a function to calculate the distance between two point on a MariaDB database: CREATE FUNCTION earth_circle_distance(point1 point, point2 point) RETURNS double DETERMINISTIC begin declare lon1, lon2 double; declare lat1, lat2 double; declare td double; declare d_lat double; declare d_lon

Mysql: ST_Contains with borders to detect if multipolygon contains point

穿精又带淫゛_ 提交于 2019-12-07 10:55:02
问题 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 switching to the functions ST_Contains . But I found out that if I use polygon(from multipolygon) vertex as argument - function returns false but I want to unclude all multipolygon borders. P.S. I found that where are function: ST_Touches(g1, g2) Two

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

*爱你&永不变心* 提交于 2019-12-06 05:41:56
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? There aren't units here, or in any of the spatial analysis functions. These functions are commonly used with geometriy values with coordinates using degrees latitude and longitude, but the spatial capabilities can be used with data from any arbitrary grid coordinate system, and the server's capabilities don't have any awareness of the nature of the particular "space" being mapped. The distance, then, would be in

Conversion of MySQL binary GEOMETRY fields in PHP

末鹿安然 提交于 2019-12-04 14:49:56
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 stored as geometry type field. Conversely, a user looking at their account should see the latitude and longitude information that was entered. In an earlier simplified codebase I achieved this directly in the MySQL query, by using the MySQL functions AsText and GeomFromText . But now I’m on CodeIgniter and need to do the conversion in PHP Is there

Mysql function MBRContains is not accurate

亡梦爱人 提交于 2019-12-03 06:28:42
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 4.7234105978214,-74.04636526925401 4.7233310730989,-74.046191260944 4.72327293317,-74.04579027069599 4.7232007594583,-74.04141290558402 4.7214258184083,-74.03746201170497 4.7197791822891,-74.03565688503801 4.7189879401666,-74.033484295736 4.7180897723398,-74.03098447693401 4.7170526009038,-74.028731840457 4.7161167561787,-74.02852820211899 4.7150714370973

How to insert point in mySQL table

流过昼夜 提交于 2019-12-02 09:16:12
问题 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) VALUES ('Testing',geomfromtext('Point(10.20.45 34.23.79)')) Another way INSERT INTO address (ADDRESS_NICKNAME,ADDRESS_LONGI_LATIT_LOCATION) VALUES ('Testing',pointfromtext('10.20.45 34.23.79')) 回答1: As per the specification of ST_geomFromText() (