Spatial Database
Enable your spatial database and learn how it works
Last updated
Enable your spatial database and learn how it works
Last updated
In Pro, you can really superpower your Wordpress site and turn it into a proper spatial backend for other apps, external users, or other types of spatial queries. The database Wordpress uses, MySQL, does contain quite a bit of spatial functionality -- not as much as PostGIS and PostgreSQL, but enough for most usage for most spatial projects.
To create a spatial table in your Mapster WP Maps installation, make sure you have Pro installed, and go to Maps > Settings. Click on the Advanced Options tab and scroll down to the Spatial API option. Once this is enabled, on the next page load your spatial database will be created and populated with all the features that currently exist in your installation.
The mapster_maps_geometry
table contains just three columns: an identifying ID, a post_id corresponding to the post, and a coordinates column containing the geometry for that post. The geometry column will be used for spatial queries and space is minimized by not storing any additional information.
As long as the Spatial API option is enabled, the database will continue to be updated as you create new geometries and update existing geometries.
SQL has a number of spatial queries you can do if you're into writing your own SQL queries. You can find a list of them at the Microsoft documentation here. Your spatial data is stored as geometries in the coordinates column.