Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[FEATURE][processing] allow to create points on all parts in point on…
… surface alg
- Loading branch information
Showing
with
172 additions
and 6 deletions.
- +46 −0 python/plugins/processing/tests/testdata/expected/point_on_multipoly.gml
- +45 −0 python/plugins/processing/tests/testdata/expected/point_on_multipoly.xsd
- +12 −0 python/plugins/processing/tests/testdata/qgis_algorithm_tests.yaml
- +60 −6 src/analysis/processing/qgsalgorithmpointonsurface.cpp
- +9 −0 src/analysis/processing/qgsalgorithmpointonsurface.h
@@ -0,0 +1,46 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ogr:FeatureCollection | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://ogr.maptools.org/ point_on_multipoly.xsd" | ||
xmlns:ogr="http://ogr.maptools.org/" | ||
xmlns:gml="http://www.opengis.net/gml"> | ||
<gml:boundedBy> | ||
<gml:Box> | ||
<gml:coord><gml:X>0.5</gml:X><gml:Y>0.5</gml:Y></gml:coord> | ||
<gml:coord><gml:X>8</gml:X><gml:Y>5.5</gml:Y></gml:coord> | ||
</gml:Box> | ||
</gml:boundedBy> | ||
|
||
<gml:featureMember> | ||
<ogr:point_on_multipoly fid="multipolys.0"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>3.5,2.5</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
<ogr:Bname>Test</ogr:Bname> | ||
<ogr:Bintval>1</ogr:Bintval> | ||
<ogr:Bfloatval>0.12300</ogr:Bfloatval> | ||
</ogr:point_on_multipoly> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:point_on_multipoly fid="multipolys.1"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>7.5,1.0</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
<ogr:Bname xsi:nil="true"/> | ||
<ogr:Bintval xsi:nil="true"/> | ||
<ogr:Bfloatval xsi:nil="true"/> | ||
</ogr:point_on_multipoly> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:point_on_multipoly fid="multipolys.1"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>8.0,5.5</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
<ogr:Bname xsi:nil="true"/> | ||
<ogr:Bintval xsi:nil="true"/> | ||
<ogr:Bfloatval xsi:nil="true"/> | ||
</ogr:point_on_multipoly> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:point_on_multipoly fid="multipolys.2"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>0.5,0.5</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
<ogr:Bname>Test</ogr:Bname> | ||
<ogr:Bintval>2</ogr:Bintval> | ||
<ogr:Bfloatval>-0.12300</ogr:Bfloatval> | ||
</ogr:point_on_multipoly> | ||
</gml:featureMember> | ||
</ogr:FeatureCollection> |
@@ -0,0 +1,45 @@ | ||
<?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="point_on_multipoly" type="ogr:point_on_multipoly_Type" substitutionGroup="gml:_Feature"/> | ||
<xs:complexType name="point_on_multipoly_Type"> | ||
<xs:complexContent> | ||
<xs:extension base="gml:AbstractFeatureType"> | ||
<xs:sequence> | ||
<xs:element name="geometryProperty" type="gml:PointPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/> | ||
<xs:element name="Bname" nillable="true" minOccurs="0" maxOccurs="1"> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:string"> | ||
<xs:maxLength value="4"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:element> | ||
<xs:element name="Bintval" nillable="true" minOccurs="0" maxOccurs="1"> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:integer"> | ||
<xs:totalDigits value="10"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:element> | ||
<xs:element name="Bfloatval" nillable="true" minOccurs="0" maxOccurs="1"> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:decimal"> | ||
<xs:totalDigits value="21"/> | ||
<xs:fractionDigits value="5"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:element> | ||
</xs:sequence> | ||
</xs:extension> | ||
</xs:complexContent> | ||
</xs:complexType> | ||
</xs:schema> |