<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><div data-html-editor-font-wrapper="true" style="font-family: arial, sans-serif; font-size: 13px;">Hi Marek,<br><br>This is a way of making arcs in Mapserver that is based on using VRTs and sql<br>The data source doesn't need to be in spatialite though. It can be a shapefile<br>or a CSV file or anything that gdal can handle.<br><br>Simon Mercier at Mapgears and I developed this for making litehouse circles<br>for Sea charts a couple of years ago. In the current version of the<br>SMAC-M project this is done with preprocessing in another way.<br><br>But I still like the idea that You can draw anything with sql.<br><br>I was going to make a small separate example this morning.<br>But I ran into some problems. It seems like my current gdal is not<br>compiled with a version of libspatialite that should use<br>librttopo instead of the lwgeom. In the version I used before I had the<br>sql function ST_project. In the version I had today on my machine and in some docker<br>containers I didn't. I guess I have to build a gdal-mapserver with<br>the right libspatialite and librttopo versions where I can do<br>these trix again some time.<br><br>Anyway this is the VRT file that can draw an arc in Mapserver.<br>The data source contains points in EPSG 4326 and we are drawing the arc<br>in EPSG 3857 in this case. valnmr is the radius and sectr1 and sectr2 are<br>starting and ending angles of the arc.<br><br>To use the vrt in mapserver you use:<br><br> CONNECTION "arc.vrt"<br> CONNECTIONTYPE OGR<br> DATA "arc"<br><br>###### arc.vrt #####<br><OGRVRTLayer name='arc'><br> <SrcDataSource>coastal.sqlite</SrcDataSource><br> <SrcSQL dialect='sqlite'><br> SELECT rcid,fidn,valnmr,sectr1,sectr2,colour,SIGGRP,SIGPER,HEIGHT,<br> MakeArc(ST_X(Transform(Geometry,3857)),ST_Y(Transform(Geometry,3857)),<br> GLength(Transform(MakeLine( MakePoint( X(Geometry), Y(Geometry),4326),<br> ST_Project( MakePoint( X(Geometry), Y(Geometry), 4326 ),<br> valnmr*1852/10, Radians( sectr1-180 ))),3857)),<br> (180-(sectr2-90)),(180-(sectr1-90)),3857,2) AS geometry<br> FROM lights_point<br> WHERE sectr1 NOT NULL AND sectr2 NOT NULL AND sectr1!=0 AND sectr2!=360<br> </SrcSQL><br></OGRVRTLayer><br>#######################<br><br>If You would like to check what version of various libraries that You<br>have, You can use this VRT and run ogrinfo on it. E.g ogrinfo debug.vrt debug<br><br>##### debug.vrt #####<br> <OGRVRTDataSource><br> <OGRVRTLayer name='debug'><br> <SrcDataSource>coastal.sqlite</SrcDataSource><br> <SrcSQL dialect='sqlite'><br> select<br> sqlite_version(),<br> spatialite_version(),<br> lwgeom_version(),<br> geos_version(),<br> proj4_version()<br> FROM lights_point<br> </SrcSQL><br> </OGRVRTLayer><br>##################### <br><br>Have fun !<br><br>Lars Schylberg<br> </div></body></html>