-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9241 from m-kuhn/merge-lines-on-dissolve
[processing] Merge lines on dissolve
- Loading branch information
Showing
5 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
python/plugins/processing/tests/testdata/custom/consecutivelines.gml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ogr:FeatureCollection | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://ogr.maptools.org/ consecutivelines.xsd" | ||
xmlns:ogr="http://ogr.maptools.org/" | ||
xmlns:gml="http://www.opengis.net/gml"> | ||
<gml:boundedBy> | ||
<gml:Box> | ||
<gml:coord><gml:X>-0.9142351900972591</gml:X><gml:Y>-0.1405835543766578</gml:Y></gml:coord> | ||
<gml:coord><gml:X>0.5411140583554377</gml:X><gml:Y>0.6870026525198939</gml:Y></gml:coord> | ||
</gml:Box> | ||
</gml:boundedBy> | ||
|
||
<gml:featureMember> | ||
<ogr:consecutivelines fid="consecutivelines.0"> | ||
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>-0.914235190097259,0.687002652519894 -0.799292661361627,0.184792219274978 -0.36604774535809,0.19893899204244</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty> | ||
<ogr:id xsi:nil="true"/> | ||
</ogr:consecutivelines> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:consecutivelines fid="consecutivelines.1"> | ||
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>-0.199823165340407,0.679929266136163 -0.076038903625111,0.315649867374005 0.541114058355438,-0.09814323607427</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty> | ||
<ogr:id xsi:nil="true"/> | ||
</ogr:consecutivelines> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:consecutivelines fid="consecutivelines.2"> | ||
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>0.541114058355438,-0.09814323607427 0.173297966401415,-0.140583554376658</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty> | ||
<ogr:id xsi:nil="true"/> | ||
</ogr:consecutivelines> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:consecutivelines fid="consecutivelines.3"> | ||
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>0.173297966401415,-0.140583554376658 -0.205128205128205,-0.057471264367816</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty> | ||
<ogr:id xsi:nil="true"/> | ||
</ogr:consecutivelines> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:consecutivelines fid="consecutivelines.4"> | ||
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>-0.364279398762157,0.013262599469496 -0.205128205128205,-0.057471264367816</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty> | ||
<ogr:id xsi:nil="true"/> | ||
</ogr:consecutivelines> | ||
</gml:featureMember> | ||
</ogr:FeatureCollection> |
30 changes: 30 additions & 0 deletions
30
python/plugins/processing/tests/testdata/custom/consecutivelines.xsd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xs:schema targetNamespace="http://ogr.maptools.org/" xmlns:ogr="http://ogr.maptools.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="1.0"> | ||
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/> | ||
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/> | ||
<xs:complexType name="FeatureCollectionType"> | ||
<xs:complexContent> | ||
<xs:extension base="gml:AbstractFeatureCollectionType"> | ||
<xs:attribute name="lockId" type="xs:string" use="optional"/> | ||
<xs:attribute name="scope" type="xs:string" use="optional"/> | ||
</xs:extension> | ||
</xs:complexContent> | ||
</xs:complexType> | ||
<xs:element name="consecutivelines" type="ogr:consecutivelines_Type" substitutionGroup="gml:_Feature"/> | ||
<xs:complexType name="consecutivelines_Type"> | ||
<xs:complexContent> | ||
<xs:extension base="gml:AbstractFeatureType"> | ||
<xs:sequence> | ||
<xs:element name="geometryProperty" type="gml:MultiLineStringPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/> | ||
<xs:element name="id" nillable="true" minOccurs="0" maxOccurs="1"> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:long"> | ||
<xs:totalDigits value="10"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:element> | ||
</xs:sequence> | ||
</xs:extension> | ||
</xs:complexContent> | ||
</xs:complexType> | ||
</xs:schema> |
20 changes: 20 additions & 0 deletions
20
python/plugins/processing/tests/testdata/expected/dissolved_consecutive_lines.gml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ogr:FeatureCollection | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://ogr.maptools.org/ dissolved_consecutive_lines.xsd" | ||
xmlns:ogr="http://ogr.maptools.org/" | ||
xmlns:gml="http://www.opengis.net/gml"> | ||
<gml:boundedBy> | ||
<gml:Box> | ||
<gml:coord><gml:X>-0.914235190097259</gml:X><gml:Y>-0.140583554376658</gml:Y></gml:coord> | ||
<gml:coord><gml:X>0.541114058355438</gml:X><gml:Y>0.687002652519894</gml:Y></gml:coord> | ||
</gml:Box> | ||
</gml:boundedBy> | ||
|
||
<gml:featureMember> | ||
<ogr:dissolved_consecutive_lines fid="consecutivelines.0"> | ||
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>-0.914235190097259,0.687002652519894 -0.799292661361627,0.184792219274978 -0.36604774535809,0.19893899204244</gml:coordinates></gml:LineString></gml:lineStringMember><gml:lineStringMember><gml:LineString><gml:coordinates>-0.199823165340407,0.679929266136163 -0.076038903625111,0.315649867374005 0.541114058355438,-0.09814323607427 0.173297966401415,-0.140583554376658 -0.205128205128205,-0.057471264367816 -0.364279398762157,0.013262599469496</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty> | ||
<ogr:id xsi:nil="true"/> | ||
</ogr:dissolved_consecutive_lines> | ||
</gml:featureMember> | ||
</ogr:FeatureCollection> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters