Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE][processing] Add "raster pixels to points" algorithm
Refactor the existing "raster pixels to polygons" algorithm and create a new "pixels to points" algorithm, which creates a point feature at the center of every pixel. nodata pixels are skipped.
- Loading branch information
1 parent
64de2a2
commit 526e590
Showing
8 changed files
with
1,005 additions
and
50 deletions.
There are no files selected for viewing
734 changes: 734 additions & 0 deletions
734
python/plugins/processing/tests/testdata/expected/pixels_to_points.gml
Large diffs are not rendered by default.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
python/plugins/processing/tests/testdata/expected/pixels_to_points.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,31 @@ | ||
<?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="pixels_to_points" type="ogr:pixels_to_points_Type" substitutionGroup="gml:_Feature"/> | ||
<xs:complexType name="pixels_to_points_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="VALUE" nillable="true" minOccurs="0" maxOccurs="1"> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:decimal"> | ||
<xs:totalDigits value="21"/> | ||
<xs:fractionDigits value="8"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:element> | ||
</xs:sequence> | ||
</xs:extension> | ||
</xs:complexContent> | ||
</xs:complexType> | ||
</xs:schema> |
21 changes: 21 additions & 0 deletions
21
python/plugins/processing/tests/testdata/expected/pointsvoronoi1diagram.gfs
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,21 @@ | ||
<GMLFeatureClassList> | ||
<GMLFeatureClass> | ||
<Name>pointsvoronoi1diagram</Name> | ||
<ElementPath>pointsvoronoi1diagram</ElementPath> | ||
<!--POLYGON--> | ||
<GeometryType>3</GeometryType> | ||
<SRSName>EPSG:4326</SRSName> | ||
<DatasetSpecificInfo> | ||
<FeatureCount>6</FeatureCount> | ||
<ExtentXMin>-0.60000</ExtentXMin> | ||
<ExtentXMax>0.20000</ExtentXMax> | ||
<ExtentYMin>51.40000</ExtentYMin> | ||
<ExtentYMax>51.60000</ExtentYMax> | ||
</DatasetSpecificInfo> | ||
<PropertyDefn> | ||
<Name>id</Name> | ||
<ElementPath>id</ElementPath> | ||
<Type>Integer</Type> | ||
</PropertyDefn> | ||
</GMLFeatureClass> | ||
</GMLFeatureClassList> |
21 changes: 21 additions & 0 deletions
21
python/plugins/processing/tests/testdata/pointsvoronoi1.gfs
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,21 @@ | ||
<GMLFeatureClassList> | ||
<GMLFeatureClass> | ||
<Name>pointsvoronoi1</Name> | ||
<ElementPath>pointsvoronoi1</ElementPath> | ||
<!--POINT--> | ||
<GeometryType>1</GeometryType> | ||
<SRSName>EPSG:4326</SRSName> | ||
<DatasetSpecificInfo> | ||
<FeatureCount>6</FeatureCount> | ||
<ExtentXMin>-0.60000</ExtentXMin> | ||
<ExtentXMax>0.20000</ExtentXMax> | ||
<ExtentYMin>51.40000</ExtentYMin> | ||
<ExtentYMax>51.60000</ExtentYMax> | ||
</DatasetSpecificInfo> | ||
<PropertyDefn> | ||
<Name>id</Name> | ||
<ElementPath>id</ElementPath> | ||
<Type>Integer</Type> | ||
</PropertyDefn> | ||
</GMLFeatureClass> | ||
</GMLFeatureClassList> |
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
Oops, something went wrong.