LWGEOM Error for Azimuth

25 views
Skip to first unread message

Elham Peiravian

unread,
Jun 28, 2023, 1:01:17 PM6/28/23
to SpatiaLite Users
Hi All,

I am trying to run my query on an app and one of the lines is:

SET offsetA = ST_Project(ST_Transform(midpoint, 4326), 5, (Azimuth + pi()/2)- pi());

As you can tell, I am trying to create a point as an offset of another point. The distance is in degrees. When I try running this query in the app, I get the following error:

image

So I checked the maximum and minimum values of my Azimuth in the picture below:
Screenshot 2023-06-28 122136.png

An this is how I calculated Azimuth:

Insert into offsets(midpoint, Azimuth) select ST_Line_Interpolate_Point(geojson, 0.5), st_Azimuth(st_startpoint(geojson), st_endpoint(geojson)) from road_segmentation2;

I am not using the st_azimuth function because it does not produce the desired results for me.

So now I am wondering if there is something wrong with my query or if the issue is with the LWGEOM library?

a.fu...@lqt.it

unread,
Jun 28, 2023, 2:13:39 PM6/28/23
to spatiali...@googlegroups.com
On Wed, 28 Jun 2023 10:01:17 -0700 (PDT), Elham Peiravian wrote:
> Hi All,
>
> I am trying to run my query on an app and one of the lines is:
>
> SET offsetA = ST_Project(ST_Transform(midpoint, 4326), 5, (Azimuth +
> pi()/2)- pi());
>
> -------------------- <snip> ---------------------------------
>
> So now I am wondering if there is something wrong with my query or if
> the issue is with the LWGEOM library?
>


Hi Elham,

it looks like you're using an incredibly old and desperately outdated
version of SpatiaLite.

LWGEOM is a library that is part of PostGIS and has always given a lot
of problems.on SpatiaLite.
it is precisely for this reason that we have completely abandoned it
several years ago., and all recent versions of SpatiaLite now use
RTTOPO instead of LWGEOM.

hint: test your SQL query on spatialite_gui, and you'll see that
it works as expected.

hint: update your sotfware to some modern version.

ciao Sandro
Reply all
Reply to author
Forward
0 new messages