<div dir="ltr"><div class="gmail_quote"><div>Hi Paul, in the past I've solved this type of problem using some plpgsql.</div><div>Create two polygon geometries covering longitudes 0 to180, and 0 to -180.</div><div>For polygon_geom, use ST_Intersection(polygon_geom, line_string_geom) to split and keep the linestring contained by each polygon.  Then stitch the two linestring geoms back to form a single multi-linestring feature using...</div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;white-space:pre">ST_Multi(ST_Union(wkb_geometry)</span><br></div><div><br></div><div>I've done something similar here...</div><div><a href="http://dimensionaledge.com/bezier-curves-a-more-flexible-alternative-to-great-circles/">http://dimensionaledge.com/bezier-curves-a-more-flexible-alternative-to-great-circles/</a><br></div><div><br></div><div>The related github code is here</div><div><a href="https://github.com/dimensionaledge/cf_public/blob/master/tutorials/bezier_curve_flight_paths.sh">https://github.com/dimensionaledge/cf_public/blob/master/tutorials/bezier_curve_flight_paths.sh</a><br></div><div><br></div><div><br></div><div>HTH</div><div>Mark</div><div> </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Message: 1<br>
Date: Tue, 24 Sep 2019 07:18:22 +0000<br>
From: <<a href="mailto:paul.malm@lfv.se" target="_blank">paul.malm@lfv.se</a>><br>
To: <<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a>><br>
Subject: [postgis-users] Lines crossing longitude 180 -180<br>
Message-ID: <<a href="mailto:785199B14156764C8EB14EF96CEDC44EE3FAB7@xw-exch03.lfv.se" target="_blank">785199B14156764C8EB14EF96CEDC44EE3FAB7@xw-exch03.lfv.se</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hi,<br>
I'm creating a table with LineStrings in SRID 4326 from lines with coordinates like this:<br>
S37323578E178560795<br>
S38161687W179595994<br>
S38270000W179440000<br>
S38414463E179595994<br>
S39394800E178553000<br>
S40224800E178060600<br>
S41504422E176164722<br>
S42513000E175030000<br>
S43372622E174062536<br>
S45135100E172134000<br>
S48090000E168160000<br>
S45550000E165180000<br>
S42254200E169201800<br>
S41580000E169501800<br>
S41253091E170232389<br>
As you can see the crosses 180/-180 longitude several times which results in long line segments all over the map from east to west.<br>
Is there anyone who have solved this problem in a fairly easy way?<br>
I appreciate all help I can get.<br>
<br>
Kind regards,<br>
Paul Malm<br>
</blockquote></div></div>