Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [mysql]

MySQL is an open-source, relational database management system. Place you question on MySQL Spatial Extensions here.

0
votes
0answers
13 views

How to save marker and polyline in database? [on hold]

I want to store marker and polyline in the database because the script that I had this, haven't been able to perform the function to store the coordinates in the database I have. In this script, I ...
0
votes
0answers
37 views

How to insert a Polygon into MySQL database Table?

I have shapefiles which I converted to .csv format. I want to insert those into a MySQL Database table. I used ST_PolyFromText according to the MySQL reference manual. ## create table cur.execute("...
1
vote
1answer
17 views

Can't get the correct geometry values after MySQL querying

I have large points data and also a small bounding boxes. I want all the points present within this bounding boxes. With the extent of the bbox , I want to get all the points within this bbox. With ...
0
votes
0answers
18 views

Matching MySQL Result to Great Circle Mapper

I can't figure out how to match the result of the Great Circle Mapper. SELECT 3959 * ACOS( COS(RADIANS(41.97444444)) * COS(RADIANS(28.42944444)) * COS(RADIANS(-87.90666667) - ...
1
vote
0answers
74 views

Find all points near a point within a radius MySql 8.0 (SRID 4326)

This question is targeted to MySQL 8.0 with its new spatial features. Given the following table: CREATE TABLE `places` ( `id` INT(11) UNSIGNED NOT NULL, `location` POINT NOT NULL SRID 4326, ...
0
votes
0answers
12 views

MySQL Query for Google Map Developer

Need your advice, i have used Google Map API for my WEB site based on MySQL database, I would like to know if MySQL Query can be implemented on Google Map API's. So it would display marker based on ...
0
votes
1answer
78 views

Check whether a point is inside a polygon or not in MySQL

I am trying to get the points those are within the shapefile. I have tried the Spatial functions and it's showing an error: 3033 - Binary geometry function st_contains given two geometries of ...
0
votes
0answers
23 views

Forming rectangle between two diagonal points using MySQL?

I've been working with Google Maps a bit lately and they provide a set of bounds (two points, northeast and southwest). ex. "bounds": { "northeast": { "lat": 34.111236 "lng": -118.2840872 ...
0
votes
0answers
9 views

MySQL group union

I want MySQL to merge many geographies together to form a single shape. A zipcode table has a row 'shape' containing a perimeter from Uncle Sam. Definition here: https://www.db-fiddle.com/f/...
1
vote
0answers
33 views

Result of ST_Contains gives false positive

I am trying to figure out the state that Berlin is in. So now my query SELECT * FROM states WHERE ST_Contains(Geo, Point(13.383068, 52.530644)); return two results. One for Berlin which is correct, ...
0
votes
1answer
246 views

Automatically refresh Leaflet Markers from MySQL

I have a leaflet map that loads marker details from a MySQL database. I have a timer that clears and reloads the layers (and therefore markers); however; it doesn't seem to be refreshing the data. ...
3
votes
1answer
241 views

Server side clustering with geohash

I need help with clustering algorithm. I have a mysql database with lat, lng, geohash(12 chars). I am usign this query to select all records for zoom level 2 (2 chars) SELECT COUNT( id ) , LEFT( `...
1
vote
0answers
214 views

Find single nearest point of point in mysql

I have an app that formerly used PostgreSQL with PostGIS but now the environment changes and I have to use MySql. In my app i had a database query that searches the nearest point to a point. Note ...
0
votes
1answer
377 views

Why does mysql ST_WITHIN work for some MultiPolygons but doesn't for others?

The mysql queries are to return all POI's within a certain country. This works (for Angola): SELECT poi.poi_id, poi.poi_address_full FROM poi WHERE ST_WITHIN( poi....
-1
votes
0answers
182 views

What msqyl field type to use for polygon and multipolygon city/country geojson from geonames

Which mysql field type should I use to store country and city boundaries? Mysql version: 5.7 Data source: Geonames shapes_all_low.txt (http://download.geonames.org/export/dump/) Issue: In this ...
0
votes
1answer
119 views

Spatial functions with MySQL, XAMPP, and Wordpress

I am trying to figure out how to using the ST_AsGeoJSON function in MySQL, but I keep getting an error that says that this function does not exist. I have found in the MySQL documentation that this ...
1
vote
1answer
207 views

MySQL 8 MBRIntersects 10 times slower than PostGIS equivalent

I'm trying to migrate a PostGIS database to MySQL 8 and am having a big performance hit when it comes to MBRIntersects. Using Mapbox to render vector tiles, I need to extract geometry intersecting ...
1
vote
0answers
60 views

Which approach is faster for getting all POIs from MySQL/MariaDB with PHP/Laravel [closed]

Correct me if I'm wrong. There are three approaches to get the nearest homes, users have created in my website: To create a table with two columns(latitude, longitude) that both of them are float ...
1
vote
0answers
70 views

MySQL ST_Contains returning empty recordset?

Using MySQL 5.6, I have converted lat and lng fields into Points - using AsText, I can see this is OK. I have another table to hold the polygon data, and again using AsText, I can see the correct ...
2
votes
0answers
176 views

Storing Shapely polygons in MySQL

I have to store some polygons in a MySQL database. The polygons are in Plate Carrée (ESPG 32662) projection, but I also tried to first converting them to the usual latitude-longitude projection (ESPG ...
0
votes
1answer
117 views

TurfJS + PHP + MySQL

I have a PHP endpoint/service that receives Lat/Long data from a 3rd party. The data is then processed in PHP code and saved into a MySQL database. This process works fine without any issues. I need ...
1
vote
1answer
131 views

Importing shapefile to SQL database, attributes are all NULL

I used ogr2ogr to import a shapefile into a MySQL database using the following: ogr2ogr MYSQL:"db,host=localhost,user=root" -nln "map" -a_srs "EPSG:4683" map.shp -overwrite -addfields -...
1
vote
0answers
646 views

Parsing GeoJSON in PHP?

i am trying to parse GeoJson from database with php but somehow i got an error and i cannot found any error in my script. here my script $id = 1; $db = new mysqli("localhost","root","","skriboo"); $...
0
votes
1answer
357 views

MySQL GPS distance calculation is failing

MySQL 5.6 here. I'm storing GPS coordinates as MySQL Point types in my DB and am trying to build a query that takes a single GPS coordinate (consisting of latitude and longitude components) and ...
2
votes
1answer
133 views

Lost geometry from QGIS mysql vector layer

I have a vector layer displaying geometry from a mysql view. This works fine for several days/weeks until suddenly it fails to refresh and my layer reverts to a non-geometry table, losing all symbols,...
0
votes
0answers
141 views

Get polygons within buffer Google Maps and MySQL

Problem statement: facing a small problem in get polygons within buffer // Select All polygons $command = $connection->createCommand("SELECT AsText(geom) as geom FROM `polygons` "); $...
1
vote
0answers
39 views

ArcGIS Near equivalent in MySQL?

I am trying to replicate a process in MySQL that I have had been through in ArcGIS thereby using MySQL to set up an automated system for extracting future climate predictions from downscaled data to ...
0
votes
0answers
372 views

MySQL GeoJSON query for polygons format error

Trying to take MySQL polygons to GeoJSON. My SQL query is Okay and works in PhpMyAdmin and I'm trying to modify some code that works for points. I think I'm close but stuck. In PhpMyAdmin the ...
15
votes
1answer
2k views

Where does the default Earth radius in ST_Distance_Sphere come from?

MySQL says in the docs for ST_Distance_Sphere Calculations use a spherical earth and a configurable radius. The optional radius argument should be given in meters. If omitted, the default radius is ...
4
votes
0answers
101 views

Position of vehicles relative to lead vehicle

I have a set of vehicles (think railway) that are in a (semi)fixed formation. I know the lead vehicle and I know the GPS coordinates of the lead vehicle at any given time. Sometimes, I can rely on the ...
1
vote
1answer
980 views

Correct method to save and restore leaftlet drawing into mysql database

I have the following code for saving my coordinates of what I draw. So what I do on drawing created I have the following function. map.on(L.Draw.Event.CREATED, function (e) { var type = e....
2
votes
0answers
276 views

Overpass API python wrapper to run requests on the endpoint of overpass-turbo

we have with Overpass API python wrapper a thin Python wrapper around the OpenStreetMap Overpass API https://github.com/mvexel/overpass-api-python-wrapper we have some Simple example: import ...
1
vote
0answers
544 views

Retrieve geolocation and image url from Blob in MySQL

I have a web form that collects three items: name, notes, and a geotagged img and stores it in mysql. The image is stored as a blob. I would like to scrape/access the blob's geo-location properties ...
1
vote
1answer
577 views

Select all points within a a geojson polygon from Mysql

I'm trying to get all points that are within each polygon from my database, but my sql query is not working. Can some one please help me out? The following is my sql code. Column cities_main_db....
1
vote
0answers
163 views

Exporting geodatabase attribute tables to MySQL database using ArcMap?

I've already created a mysql db connection using ODBC and tested it. Now I want to export the attribute tables data from ArcMap to mysql which is on my localhost. On export there are many options like ...
1
vote
2answers
167 views

Looking for geojson data host?

I want to use geojson data in google map application like this (enter link description here). The geojson data (see link enter link description here) is what I am looking for. Do I need a (online) ...
-1
votes
0answers
1k views

A store locator with multiple categories using google api,php and mysql

I have created a store locator using google api, php and mysql, it is working fine. Now I am creating a select option for selecting the store categories and trying to display the stores which fall in ...
1
vote
2answers
1k views

How to convert polygon shapefile to CSV?

I can convert shapefile (having points) to CSV file, import in MySQL databases and then i can execute my queries for searching. Now I want to do same for polygon shapefile; that is, I want to convert ...
2
votes
1answer
382 views

howto set ogr2ogr imported SRID to 0? Currently defaulting to SRID 1

I'm currently trying to import a bunch of boundaries into a legacy system with a specific SRID. its a mySQL db. After import and running some intersect code, i receive this error: Binary geometry ...
0
votes
1answer
1k views

Hibernate and Mysql gives “Geometry byte string must be little endian.” error

I'm using mysql and wildly. I want to look for points in a given polygon. My method looks like: public Response getGeoJsonByBox( @QueryParam("topLeftX") double ...
1
vote
0answers
95 views

Less detailed FIPS polygons?

I'm working on a project which takes the NOAA NWS alerts and places them onto a Google Map. https://alerts.weather.gov/cap/us.php?x=0 Most alerts use the FIPS or UGC codes. I don't think I need the ...
2
votes
1answer
3k views

Convert lat/lon mysql columns to geometry, check if point is in polygon, return polygon id

I have a mysql database table with many ids, each id has a "start lat", "start lon" "end lat" and "end lon" column. I want to check in wich polygon the start point belongs (and write this in a "start ...
3
votes
0answers
71 views

In MySQL are there unidirectional and directional graphs?

I'm new to MySQL and studying about geospatial data. I have read the documentation of MySQL and learned about the ST_Geometry type, its subtypes and its functions; but I didn't find anything about ...
3
votes
1answer
498 views

View database connections in QGIS with Python

I am designing a GUI for a QGIS plugin I am developing, which is intended to plot information from a MySQL database. In the GUI, I would like to have a combo box of all the database connections saved ...
0
votes
1answer
458 views

to be able to use mysql-connector-python inside QGIS python script

I am creating python script in QGIS python console to be able to connect to mysql db and manipulate data (retrieve from db, generate shapefile and show it as a layer). I tried to install mysql ...
1
vote
0answers
403 views

Import non spatial data from MySQL DB into QGIS using queries

I want to import data from MySQL DB. MySQL schema has a lot of tables with a huge amount of data. This is non spatial data. I want to import objects as vector layers using sql query which is selecting ...
1
vote
0answers
229 views

Is it possible to incorporate QGIS shapefile / polygon to XAMPP?

I want to make a website using XAMPP but it must include a map of our city. I used QGIS to produce a shapefile of our city. I also want to use MySQL / MariaDB as the database but I don't know how to ...
0
votes
0answers
130 views

Import shapefile to mysql - wrong point coordinate order

I'm importing .shp file (OSM cities) to mysql 5.6 using ogr2ogr tool from command line (on Ubuntu, qgis). As a result I get a table with SHAPE field of type geometry. This is a list of points (city ...
0
votes
1answer
78 views

ArcMap to MySQL using Modelbuilder

Is it possible to run a model in ArcMap 10.3 and export directly to a MySQL table? Preferably avoiding ArcSDE as well.
4
votes
1answer
270 views

Mapserver hide OGR exception

I use mapserver 7.0.2 to display Points which are taken from a MYSQL-database. If the the SQL-statement fails (for example the database can't be reached) the mapserver gives out an OGR error-message, ...