<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi All,</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Thanks for all suggestions and ideas.
I've evaluated them using the ms4w binaries (v3.3.0):</div>
<div class="moz-cite-prefix">- there is no support for V8 at the
moment (unless built from sources),</div>
<div class="moz-cite-prefix">- adding ST_Project to spatialite
library is on roadmap (at the moment you need to compile
spatialite library yourself),<br>
</div>
<div class="moz-cite-prefix">- I failed with <span class="st">CIRCULARSTRING
- </span><span class="st">when I used select with
ST_GeomFromText and </span><span class="st"><span class="st">CIRCULARSTRING
as geometry the result was null (I guess that I've missed
something),<br>
</span></span></div>
<div class="moz-cite-prefix"><span class="st"><span class="st"><em>-
</em>I did not test PostGIS but I think that it should work (I
guess all required function are there).</span></span></div>
<div class="moz-cite-prefix"><span class="st"><span class="st"><br>
</span></span></div>
<div class="moz-cite-prefix"><span class="st"><span class="st">Instead
of all above, since I'm working on S-57 LIGHTS layer and I've
already needed a shape file for storing each light
description, I've decided to convert S-57 ENC LIGHTS layer to
two shape files (one for POINTS and one for LINES). I still
need to tweak that solution but it seems to work (one layer
became physically two but since I'm using GROUP attribute in
LAYER object logically it was one to one conversion).</span></span></div>
<div class="moz-cite-prefix"><span class="st"><span class="st"><br>
</span></span></div>
<div class="moz-cite-prefix"><span class="st"><span class="st">Regards,</span></span></div>
<div class="moz-cite-prefix"><span class="st"><span class="st">Marek<br>
</span></span></div>
<div class="moz-cite-prefix"><span class="st"><span class="st"><br>
</span></span></div>
<div class="moz-cite-prefix"><span class="st"><span class="st"><br>
</span></span></div>
<blockquote type="cite"
cite="mid:7dbd4baa85cef2fa86f40d148c884c3f@blixtmail.se">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<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>
</blockquote>
<p><br>
</p>
</body>
</html>