[GIS] How to draw circles with a radius based on lat/long data in DB

buffergeometryopenlayers-2sqlite

I have a . sqlite file with many columns, two of those columns being lat and long.

I've been searching around for a bit now (don't think I want to be using BuildCircleMbr from spatialite?) but I'm not entirely too sure how to go about it.

I'm thinking it has something to do with GeomFromText but can't get the query set up correctly.

Final product would be having these circles and display them on a map using MapServer/OpenLayers.

Best Answer

Yes, you will need the BuildCircleMbr. Define a SpatiaLite layer in mapfile, giving the DATA string like:

DATA "SELECT BuildCircleMbr(lat, long, radius) FROM your_table"

Create an OpenLayers.Layers.Mapserver layer (or WMS layer if you serve the mapfile in WMS) in OpenLayers js script.