QGIS/python/plugins/processing/tests/testdata/custom/antimeridian_lines.gml
Nyall Dawson 2a774d6dac [FEATURE][processing] New algorithm "Geodesic line split at antimeridian"
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.
2019-01-12 05:31:00 +10:00

51 lines
3.0 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_lines.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>-164.6491419175783</gml:X><gml:Y>-58.13530913536049</gml:Y></gml:coord>
<gml:coord><gml:X>158.1643794482545</gml:X><gml:Y>62.51129510894471</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>
<gml:featureMember>
<ogr:antimeridian_lines fid="antimeridian_lines.0">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>-80.891554628534,62.5112951089447 -26.2185771128241,-21.706771212382 52.802689984781,39.8338700993836</gml:coordinates></gml:LineString></ogr:geometryProperty>
<ogr:pk>1</ogr:pk>
</ogr:antimeridian_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:antimeridian_lines fid="antimeridian_lines.1">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>107.475667500491,60.0670531623558 106.811623239167,-46.1399448949947 154.180113880308,23.1390106826322 154.180113880308,23.1390106826322</gml:coordinates></gml:LineString></ogr:geometryProperty>
<ogr:pk>2</ogr:pk>
</ogr:antimeridian_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:antimeridian_lines fid="antimeridian_lines.2">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>135.808222650333,55.5956988168508 -150.925560516874,56.4614475462057</gml:coordinates></gml:LineString></ogr:geometryProperty>
<ogr:pk>3</ogr:pk>
</ogr:antimeridian_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:antimeridian_lines fid="antimeridian_lines.3">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>129.831824298413,-56.9474822647808 -150.482864342658,-58.1353091353605</gml:coordinates></gml:LineString></ogr:geometryProperty>
<ogr:pk>4</ogr:pk>
</ogr:antimeridian_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:antimeridian_lines fid="antimeridian_lines.4">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>137.800355434306,-52.6123900774682 147.539671267064,-12.4080274655396 -164.649141917578,54.5823408082887</gml:coordinates></gml:LineString></ogr:geometryProperty>
<ogr:pk>5</ogr:pk>
</ogr:antimeridian_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:antimeridian_lines fid="antimeridian_lines.5">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>143.998101873334,42.0078449653839 158.164379448254,33.2620367778 -154.90982608482,-49.5548177386129 -139.415459987251,28.9038080381852</gml:coordinates></gml:LineString></ogr:geometryProperty>
<ogr:pk>6</ogr:pk>
</ogr:antimeridian_lines>
</gml:featureMember>
</ogr:FeatureCollection>