Questions tagged [mysql]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
22 views

Display all trajectories location along with dummy location

I'm trying to display the all trajectory location on Google map along with dummy location. I have tried to display dummy locations with sample location and it works fine, but when I try to connect to ...
1
vote
0answers
21 views

Multiple layer data in one delimited text layer

I am a GIS beginner. I'm exporting several point coords from a Mysql database, and importing into QGIS using delimited text layer. I need to plot all the points and set the symbology to distinguish ...
0
votes
0answers
11 views

showing GeoJSON result on googlemap [duplicate]

I want to get some point (in Geometry type) from my sql database with AJAX and show them on googlemap my table name is location_flat which has a column named position conatained my geometry points. ...
0
votes
0answers
39 views

MySQL Query for Getting Records within Radius

Coordinates in the table are stored in 3 separate columns x, y and zone and are formatted in UTM. Here is the idea: I get the current position of the user (in lat long but I can convert it to UTM if ...
0
votes
0answers
19 views

Extract data table with extended description from Google MyMaps

I would like to extract data table from Google MyMaps and make it usable i.e in Excel. The issue is straightforward at first glance. I know, that I must download the map in .kml and convert it, as per ...
1
vote
1answer
49 views

How to make query of MySQL connection in QGIS?

i have added a connection with a MySQL database in QGIS (Add vector layer - Database - MySQL). Is there an option to make a query over the database in QGIS?
0
votes
0answers
33 views

MySQL update geometry field

I have MySQL database with table in X varchar(50) latin1_swedish_ci No None Change Change Drop Drop More More 11 Y varchar(50) latin1_swedish_ci No None ...
0
votes
1answer
55 views

ArcCatalog connecting to MySQL DB [closed]

Looking to connect to MySQL DB from ArcCatalog. As of now I have ArcCatalog 10.5 running on machine 1. I have a MySQL 8 instance running on machine 2 (server). I am able to connect to machine 2 from ...
1
vote
2answers
67 views

MySQL, geoPHP, select sites near the current site

I'm working with archaeological sites, stored as polygons in a MariaDB 10.3 table, and I have PHP 7.2 with GEOS and geoPHP available. I'm creating a page that displays all the related information for ...
0
votes
0answers
169 views

How to save marker and polyline in database?

I want to store marker and polyline in the database. In this script, I have 3 functions, that is to draw a polyline, marker and the point of destination. Can anyone fix my script below? var map; var ...
0
votes
0answers
52 views

Query and display MySQL DB data from HTML

I want to link MySQL DB to the HTML and get the data according to the query below. SELECT * FROM feature1 WHERE place = 'feature2' php seems one of the way to do this, since I am one day old with ...
0
votes
1answer
64 views

MySQL spatial slowed after upgrade to 8

After I updated MySQL from 5.7 to 8, spatial functions have become very slow. Specifically, this query: SELECT points3_.track_id AS track_id FROM waypoint points3_ WHERE ST_CONTAINS(ST_POLYFROMTEXT(...
0
votes
1answer
111 views

Unable to save point features to QGIS on MySQL database

I created a table with point geometry in MySQL. Subsequently added a vector layer from MySQL table. The table could be accessed from QGIS. However on pressing the add button the system threw warning ...
1
vote
0answers
222 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
35 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
33 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) - ...
2
votes
0answers
430 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
32 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
285 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
55 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
10 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
105 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
566 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
568 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
306 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
553 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....
0
votes
1answer
196 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
2answers
300 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
98 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
90 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
248 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
181 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
244 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
878 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
492 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
182 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,...
1
vote
0answers
41 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
508 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 ...
5
votes
0answers
120 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
1k 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
354 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
578 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
675 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
1answer
208 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
213 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
vote
2answers
2k 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
495 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
110 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 ...