mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-12 00:02:25 -04:00
Ports the similar algorithm from the shape tools plugin to c++, and utilises built in QgsDistanceArea ellipsoidal calculations to split the lines. This algorithm splits a line into multiple geodesic segments, whenever the line crosses the antimeridian (±180 degrees longitude) Splitting at the antimeridian helps the visual display of the lines in some projections. The returned geometry will always be a multi-part geometry. Whenever line segments in the input geometry cross the antimeridian, they will be split into two segments, with the latitude of the breakpoint being determined using a geodesic line connecting the points either side of this segment. The current project ellipsoid setting will be used when calculating this breakpoint. If the input geometry contains M or Z values, these will be linearly interpolated for the new vertices created at the antimeridian. Supports in-place edit mode also.
33 lines
3.5 KiB
XML
33 lines
3.5 KiB
XML
<?xml version="1.0" encoding="utf-8" ?>
|
|
<ogr:FeatureCollection
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:schemaLocation="http://ogr.maptools.org/ antimeridian_multilines_split.xsd"
|
|
xmlns:ogr="http://ogr.maptools.org/"
|
|
xmlns:gml="http://www.opengis.net/gml">
|
|
<gml:boundedBy>
|
|
<gml:Box>
|
|
<gml:coord><gml:X>-20037508.34278924</gml:X><gml:Y>-9281844.407529537</gml:Y></gml:coord>
|
|
<gml:coord><gml:X>20037508.34278924</gml:X><gml:Y>8981409.887731699</gml:Y></gml:coord>
|
|
</gml:Box>
|
|
</gml:boundedBy>
|
|
|
|
<gml:featureMember>
|
|
<ogr:antimeridian_multilines_split fid="antimeridian_lines.3">
|
|
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:3857"><gml:lineStringMember><gml:LineString><gml:coordinates>15339865.3980791,-6911619.95475655 16424041.0772565,-1392180.13348932 20037508.3427892,5350428.8616031</gml:coordinates></gml:LineString></gml:lineStringMember><gml:lineStringMember><gml:LineString><gml:coordinates>-20037508.3427892,5350428.8616031 -18328658.6378142,7281225.29993063</gml:coordinates></gml:LineString></gml:lineStringMember><gml:lineStringMember><gml:LineString><gml:coordinates>15118102.1909746,7478348.15069018 20037508.3427892,8735532.58767424</gml:coordinates></gml:LineString></gml:lineStringMember><gml:lineStringMember><gml:LineString><gml:coordinates>-20037508.3427892,8735532.58767424 -16800956.5444278,7650830.64510478</gml:coordinates></gml:LineString></gml:lineStringMember><gml:lineStringMember><gml:LineString><gml:coordinates>14452812.5696611,-7749392.07048463 20037508.3427892,-9281844.40752954</gml:coordinates></gml:LineString></gml:lineStringMember><gml:lineStringMember><gml:LineString><gml:coordinates>-20037508.3427892,-9281844.40752954 -16751675.831738,-7995795.63393405</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
|
|
<ogr:pk>4</ogr:pk>
|
|
</ogr:antimeridian_multilines_split>
|
|
</gml:featureMember>
|
|
<gml:featureMember>
|
|
<ogr:antimeridian_multilines_split fid="antimeridian_lines.1">
|
|
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:3857"><gml:lineStringMember><gml:LineString><gml:coordinates>-9004806.67072468,8981409.8877317 -2918638.65352375,-2476355.8126668 5877968.56162091,4841830.02178128</gml:coordinates></gml:LineString></gml:lineStringMember><gml:lineStringMember><gml:LineString><gml:coordinates>11964136.5788218,8414681.69179801 11890215.5097871,-5802803.91923412 17163251.7676048,2648838.30708134</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
|
|
<ogr:pk>2</ogr:pk>
|
|
</ogr:antimeridian_multilines_split>
|
|
</gml:featureMember>
|
|
<gml:featureMember>
|
|
<ogr:antimeridian_multilines_split fid="antimeridian_lines.5">
|
|
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:3857"><gml:lineStringMember><gml:LineString><gml:coordinates>16029795.3757375,5162154.65426553 17606778.1818137,3930136.83701837 20037508.3427892,-1373758.73029182</gml:coordinates></gml:LineString></gml:lineStringMember><gml:lineStringMember><gml:LineString><gml:coordinates>-20037508.3427892,-1373758.73029182 -17244482.9586367,-6369532.11516781 -15519658.0144908,3363408.64108469</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
|
|
<ogr:pk>6</ogr:pk>
|
|
</ogr:antimeridian_multilines_split>
|
|
</gml:featureMember>
|
|
</ogr:FeatureCollection>
|