Skip to content

Commit 01cd784

Browse files
lbartolettinyalldawson
authored andcommittedJan 19, 2017
[FEATURE][processing] Add overlay option to GridLine and GridPolygon
1 parent 1f3c67f commit 01cd784

11 files changed

+1443
-41
lines changed
 

‎python/plugins/processing/algs/qgis/GridLine.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ class GridLine(GeoAlgorithm):
5454
EXTENT = 'EXTENT'
5555
HSPACING = 'HSPACING'
5656
VSPACING = 'VSPACING'
57+
HOVERLAY = 'HOVERLAY'
58+
VOVERLAY = 'VOVERLAY'
5759
CRS = 'CRS'
5860
OUTPUT = 'OUTPUT'
5961

@@ -71,6 +73,10 @@ def defineCharacteristics(self):
7173
self.tr('Horizontal spacing'), 0.0, 1000000000.0, default=0.0001))
7274
self.addParameter(ParameterNumber(self.VSPACING,
7375
self.tr('Vertical spacing'), 0.0, 1000000000.0, default=0.0001))
76+
self.addParameter(ParameterNumber(self.HOVERLAY,
77+
self.tr('Horizontal overlay'), 0.0, 1000000000.0, default=0.0))
78+
self.addParameter(ParameterNumber(self.VOVERLAY,
79+
self.tr('Vertical overlay'), 0.0, 1000000000.0, default=0.0))
7480
self.addParameter(ParameterCrs(self.CRS, 'Grid CRS', 'EPSG:4326'))
7581

7682
self.addOutput(OutputVector(self.OUTPUT, self.tr('Grid'), datatype=[dataobjects.TYPE_VECTOR_LINE]))
@@ -79,6 +85,8 @@ def processAlgorithm(self, feedback):
7985
extent = self.getParameterValue(self.EXTENT).split(',')
8086
hSpacing = self.getParameterValue(self.HSPACING)
8187
vSpacing = self.getParameterValue(self.VSPACING)
88+
hOverlay = self.getParameterValue(self.HOVERLAY)
89+
vOverlay = self.getParameterValue(self.VOVERLAY)
8290
crs = QgsCoordinateReferenceSystem(self.getParameterValue(self.CRS))
8391

8492
bbox = QgsRectangle(float(extent[0]), float(extent[2]),
@@ -91,6 +99,10 @@ def processAlgorithm(self, feedback):
9199
raise GeoAlgorithmExecutionException(
92100
self.tr('Invalid grid spacing: %s/%s' % (hSpacing, vSpacing)))
93101

102+
if hSpacing <= hOverlay or vSpacing <= vOverlay:
103+
raise GeoAlgorithmExecutionException(
104+
self.tr('Invalid overlay: %s/%s' % (hOverlay, vOverlay)))
105+
94106
if width < hSpacing:
95107
raise GeoAlgorithmExecutionException(
96108
self.tr('Horizontal spacing is too small for the covered area'))
@@ -110,6 +122,16 @@ def processAlgorithm(self, feedback):
110122
writer = self.getOutputFromName(self.OUTPUT).getVectorWriter(fields,
111123
QgsWkbTypes.LineString, crs)
112124

125+
if hOverlay > 0:
126+
hSpace = [hSpacing - hOverlay, hOverlay]
127+
else:
128+
hSpace = [hSpacing, hSpacing]
129+
130+
if vOverlay > 0:
131+
vSpace = [vSpacing - vOverlay, vOverlay]
132+
else:
133+
vSpace = [vSpacing, vSpacing]
134+
113135
feat = QgsFeature()
114136
feat.initAttributes(len(fields))
115137

@@ -133,7 +155,7 @@ def processAlgorithm(self, feedback):
133155
id,
134156
y])
135157
writer.addFeature(feat)
136-
y = y - vSpacing
158+
y = y - vSpace[count % 2]
137159
id += 1
138160
count += 1
139161
if int(math.fmod(count, count_update)) == 0:
@@ -160,7 +182,7 @@ def processAlgorithm(self, feedback):
160182
id,
161183
x])
162184
writer.addFeature(feat)
163-
x = x + hSpacing
185+
x = x + hSpace[count % 2]
164186
id += 1
165187
count += 1
166188
if int(math.fmod(count, count_update)) == 0:

‎python/plugins/processing/algs/qgis/GridPolygon.py

Lines changed: 64 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ class GridPolygon(GeoAlgorithm):
4848
EXTENT = 'EXTENT'
4949
HSPACING = 'HSPACING'
5050
VSPACING = 'VSPACING'
51+
HOVERLAY = 'HOVERLAY'
52+
VOVERLAY = 'VOVERLAY'
5153
CRS = 'CRS'
5254
OUTPUT = 'OUTPUT'
5355

@@ -71,6 +73,10 @@ def defineCharacteristics(self):
7173
self.tr('Horizontal spacing'), 0.0, 1000000000.0, 0.0001))
7274
self.addParameter(ParameterNumber(self.VSPACING,
7375
self.tr('Vertical spacing'), 0.0, 1000000000.0, 0.0001))
76+
self.addParameter(ParameterNumber(self.HOVERLAY,
77+
self.tr('Horizontal overlay'), 0.0, 1000000000.0, 0.0))
78+
self.addParameter(ParameterNumber(self.VOVERLAY,
79+
self.tr('Vertical overlay'), 0.0, 1000000000.0, 0.0))
7480
self.addParameter(ParameterCrs(self.CRS, 'Grid CRS', 'EPSG:4326'))
7581

7682
self.addOutput(OutputVector(self.OUTPUT, self.tr('Grid'), datatype=[dataobjects.TYPE_VECTOR_POLYGON]))
@@ -80,6 +86,8 @@ def processAlgorithm(self, feedback):
8086
extent = self.getParameterValue(self.EXTENT).split(',')
8187
hSpacing = self.getParameterValue(self.HSPACING)
8288
vSpacing = self.getParameterValue(self.VSPACING)
89+
hOverlay = self.getParameterValue(self.HOVERLAY)
90+
vOverlay = self.getParameterValue(self.VOVERLAY)
8391
crs = QgsCoordinateReferenceSystem(self.getParameterValue(self.CRS))
8492

8593
bbox = QgsRectangle(float(extent[0]), float(extent[2]),
@@ -98,6 +106,10 @@ def processAlgorithm(self, feedback):
98106
raise GeoAlgorithmExecutionException(
99107
self.tr('Horizontal spacing is too small for the covered area'))
100108

109+
if hSpacing <= hOverlay or vSpacing <= vOverlay:
110+
raise GeoAlgorithmExecutionException(
111+
self.tr('Invalid overlay: %s/%s' % (hOverlay, vOverlay)))
112+
101113
if height < vSpacing:
102114
raise GeoAlgorithmExecutionException(
103115
self.tr('Vertical spacing is too small for the covered area'))
@@ -114,37 +126,36 @@ def processAlgorithm(self, feedback):
114126

115127
if idx == 0:
116128
self._rectangleGrid(
117-
writer, width, height, originX, originY, hSpacing, vSpacing, feedback)
129+
writer, width, height, originX, originY, hSpacing, vSpacing, hOverlay, vOverlay, feedback)
118130
elif idx == 1:
119131
self._diamondGrid(
120-
writer, width, height, originX, originY, hSpacing, vSpacing, feedback)
132+
writer, width, height, originX, originY, hSpacing, vSpacing, hOverlay, vOverlay, feedback)
121133
elif idx == 2:
122134
self._hexagonGrid(
123-
writer, width, height, originX, originY, hSpacing, vSpacing, feedback)
135+
writer, width, height, originX, originY, hSpacing, vSpacing, hOverlay, vOverlay, feedback)
124136

125137
del writer
126138

127139
def _rectangleGrid(self, writer, width, height, originX, originY,
128-
hSpacing, vSpacing, feedback):
140+
hSpacing, vSpacing, hOverlay, vOverlay, feedback):
129141
ft = QgsFeature()
130142

131-
columns = int(math.ceil(float(width) / hSpacing))
132-
rows = int(math.ceil(float(height) / vSpacing))
143+
columns = int(math.ceil(float(width) / (hSpacing-hOverlay)))
144+
rows = int(math.ceil(float(height) / (vSpacing-vOverlay)))
145+
133146
cells = rows * columns
134147
count_update = cells * 0.05
135148

136149
id = 1
137150
count = 0
138151

139152
for col in range(columns):
140-
# (column + 1) and (row + 1) calculation is used to maintain
141-
# topology between adjacent shapes and avoid overlaps/holes
142-
# due to rounding errors
143-
x1 = originX + (col * hSpacing)
144-
x2 = originX + ((col + 1) * hSpacing)
153+
x1 = originX + (col * hSpacing - col * hOverlay)
154+
x2 = x1 + hSpacing
155+
145156
for row in range(rows):
146-
y1 = originY - (row * vSpacing)
147-
y2 = originY - ((row + 1) * vSpacing)
157+
y1 = originY - (row * vSpacing - row * vOverlay)
158+
y2 = y1 - vSpacing
148159

149160
polyline = []
150161
polyline.append(QgsPoint(x1, y1))
@@ -156,20 +167,24 @@ def _rectangleGrid(self, writer, width, height, originX, originY,
156167
ft.setGeometry(QgsGeometry.fromPolygon([polyline]))
157168
ft.setAttributes([x1, y1, x2, y2, id])
158169
writer.addFeature(ft)
170+
159171
id += 1
160172
count += 1
161173
if int(math.fmod(count, count_update)) == 0:
162174
feedback.setProgress(int(count / cells * 100))
163175

164176
def _diamondGrid(self, writer, width, height, originX, originY,
165-
hSpacing, vSpacing, feedback):
177+
hSpacing, vSpacing, hOverlay, vOverlay, feedback):
166178
ft = QgsFeature()
167179

168180
halfHSpacing = hSpacing / 2
169181
halfVSpacing = vSpacing / 2
170182

171-
columns = int(math.ceil(float(width) / halfHSpacing))
172-
rows = int(math.ceil(float(height) / vSpacing))
183+
halfHOverlay = hOverlay / 2
184+
halfVOverlay = vOverlay / 2
185+
186+
columns = int(math.ceil(float(width) / (halfHSpacing - halfHOverlay)))
187+
rows = int(math.ceil(float(height) / (vSpacing - halfVOverlay)))
173188

174189
cells = rows * columns
175190
count_update = cells * 0.05
@@ -178,19 +193,21 @@ def _diamondGrid(self, writer, width, height, originX, originY,
178193
count = 0
179194

180195
for col in range(columns):
181-
x1 = originX + ((col + 0) * halfHSpacing)
182-
x2 = originX + ((col + 1) * halfHSpacing)
183-
x3 = originX + ((col + 2) * halfHSpacing)
196+
x = originX - (col * halfHOverlay)
197+
x1 = x + ((col + 0) * halfHSpacing)
198+
x2 = x + ((col + 1) * halfHSpacing)
199+
x3 = x + ((col + 2) * halfHSpacing)
184200

185201
for row in range(rows):
202+
y = originY + (row * halfVOverlay)
186203
if (col % 2) == 0:
187-
y1 = originY - (((row * 2) + 0) * halfVSpacing)
188-
y2 = originY - (((row * 2) + 1) * halfVSpacing)
189-
y3 = originY - (((row * 2) + 2) * halfVSpacing)
204+
y1 = y - (((row * 2) + 0) * halfVSpacing)
205+
y2 = y - (((row * 2) + 1) * halfVSpacing)
206+
y3 = y - (((row * 2) + 2) * halfVSpacing)
190207
else:
191-
y1 = originY - (((row * 2) + 1) * halfVSpacing)
192-
y2 = originY - (((row * 2) + 2) * halfVSpacing)
193-
y3 = originY - (((row * 2) + 3) * halfVSpacing)
208+
y1 = y - (((row * 2) + 1) * halfVSpacing)
209+
y2 = y - (((row * 2) + 2) * halfVSpacing)
210+
y3 = y - (((row * 2) + 3) * halfVSpacing)
194211

195212
polyline = []
196213
polyline.append(QgsPoint(x1, y2))
@@ -208,18 +225,26 @@ def _diamondGrid(self, writer, width, height, originX, originY,
208225
feedback.setProgress(int(count / cells * 100))
209226

210227
def _hexagonGrid(self, writer, width, height, originX, originY,
211-
hSpacing, vSpacing, feedback):
228+
hSpacing, vSpacing, hOverlay, vOverlay, feedback):
212229
ft = QgsFeature()
213230

214231
# To preserve symmetry, hspacing is fixed relative to vspacing
215232
xVertexLo = 0.288675134594813 * vSpacing
216233
xVertexHi = 0.577350269189626 * vSpacing
217234
hSpacing = xVertexLo + xVertexHi
218235

219-
halfVSpacing = vSpacing / 2
236+
hOverlay = hSpacing - hOverlay
237+
if hOverlay < 0:
238+
raise GeoAlgorithmExecutionException(
239+
self.tr('To preserve symmetry, hspacing is fixed relative to vspacing\n \
240+
hspacing is fixed at: %s and hoverlay is fixed at: %s\n \
241+
hoverlay cannot be negative. Increase hoverlay.' % (hSpacing, hOverlay)))
242+
243+
halfHSpacing = hSpacing / 2.0
244+
halfVSpacing = vSpacing / 2.0
220245

221-
columns = int(math.ceil(float(width) / hSpacing))
222-
rows = int(math.ceil(float(height) / vSpacing))
246+
columns = int(math.ceil(float(width) / hOverlay))
247+
rows = int(math.ceil(float(height) / (vSpacing - vOverlay)))
223248

224249
cells = rows * columns
225250
count_update = cells * 0.05
@@ -231,20 +256,20 @@ def _hexagonGrid(self, writer, width, height, originX, originY,
231256
# (column + 1) and (row + 1) calculation is used to maintain
232257
# topology between adjacent shapes and avoid overlaps/holes
233258
# due to rounding errors
234-
x1 = originX + (col * hSpacing) # far left
235-
x2 = x1 + (xVertexHi - xVertexLo) # left
236-
x3 = originX + ((col + 1) * hSpacing) # right
237-
x4 = x3 + (xVertexHi - xVertexLo) # far right
259+
x1 = originX + (col * hOverlay) # far left
260+
x2 = x1 + (xVertexHi - xVertexLo) # left
261+
x3 = originX + (col * hOverlay) + hSpacing # right
262+
x4 = x3 + (xVertexHi - xVertexLo) # far right
238263

239264
for row in range(rows):
240265
if (col % 2) == 0:
241-
y1 = originY - (((row * 2) + 0) * halfVSpacing) # hi
242-
y2 = originY - (((row * 2) + 1) * halfVSpacing) # mid
243-
y3 = originY - (((row * 2) + 2) * halfVSpacing) # lo
266+
y1 = originY + (row * vOverlay) - (((row * 2) + 0) * halfVSpacing) # hi
267+
y2 = originY + (row * vOverlay) - (((row * 2) + 1) * halfVSpacing) # mid
268+
y3 = originY + (row * vOverlay) - (((row * 2) + 2) * halfVSpacing) # lo
244269
else:
245-
y1 = originY - (((row * 2) + 1) * halfVSpacing) # hi
246-
y2 = originY - (((row * 2) + 2) * halfVSpacing) # mid
247-
y3 = originY - (((row * 2) + 3) * halfVSpacing) # lo
270+
y1 = originY + (row * vOverlay) - (((row * 2) + 1) * halfVSpacing) # hi
271+
y2 = originY + (row * vOverlay) - (((row * 2) + 2) * halfVSpacing) # mid
272+
y3 = originY + (row * vOverlay) - (((row * 2) + 3) * halfVSpacing) # lo
248273

249274
polyline = []
250275
polyline.append(QgsPoint(x1, y2))
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<GMLFeatureClassList>
2+
<GMLFeatureClass>
3+
<Name>grid_diamond_overlay</Name>
4+
<ElementPath>grid_diamond_overlay</ElementPath>
5+
<!--POLYGON-->
6+
<GeometryType>3</GeometryType>
7+
<SRSName>EPSG:4326</SRSName>
8+
<DatasetSpecificInfo>
9+
<FeatureCount>45</FeatureCount>
10+
<ExtentXMin>-1.00000</ExtentXMin>
11+
<ExtentXMax>16.00000</ExtentXMax>
12+
<ExtentYMin>-8.00000</ExtentYMin>
13+
<ExtentYMax>6.50000</ExtentYMax>
14+
</DatasetSpecificInfo>
15+
<PropertyDefn>
16+
<Name>left</Name>
17+
<ElementPath>left</ElementPath>
18+
<Type>Real</Type>
19+
</PropertyDefn>
20+
<PropertyDefn>
21+
<Name>top</Name>
22+
<ElementPath>top</ElementPath>
23+
<Type>Real</Type>
24+
</PropertyDefn>
25+
<PropertyDefn>
26+
<Name>right</Name>
27+
<ElementPath>right</ElementPath>
28+
<Type>Real</Type>
29+
</PropertyDefn>
30+
<PropertyDefn>
31+
<Name>bottom</Name>
32+
<ElementPath>bottom</ElementPath>
33+
<Type>Real</Type>
34+
</PropertyDefn>
35+
<PropertyDefn>
36+
<Name>id</Name>
37+
<ElementPath>id</ElementPath>
38+
<Type>Integer</Type>
39+
</PropertyDefn>
40+
</GMLFeatureClass>
41+
</GMLFeatureClassList>

‎python/plugins/processing/tests/testdata/expected/grid_diamond_overlay.gml

Lines changed: 464 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<GMLFeatureClassList>
2+
<GMLFeatureClass>
3+
<Name>grid_hexagon_overlay</Name>
4+
<ElementPath>grid_hexagon_overlay</ElementPath>
5+
<!--POLYGON-->
6+
<GeometryType>3</GeometryType>
7+
<SRSName>EPSG:4326</SRSName>
8+
<DatasetSpecificInfo>
9+
<FeatureCount>18</FeatureCount>
10+
<ExtentXMin>-1.00000</ExtentXMin>
11+
<ExtentXMax>16.42414</ExtentXMax>
12+
<ExtentYMin>-9.00000</ExtentYMin>
13+
<ExtentYMax>6.50000</ExtentYMax>
14+
</DatasetSpecificInfo>
15+
<PropertyDefn>
16+
<Name>left</Name>
17+
<ElementPath>left</ElementPath>
18+
<Type>Real</Type>
19+
</PropertyDefn>
20+
<PropertyDefn>
21+
<Name>top</Name>
22+
<ElementPath>top</ElementPath>
23+
<Type>Real</Type>
24+
</PropertyDefn>
25+
<PropertyDefn>
26+
<Name>right</Name>
27+
<ElementPath>right</ElementPath>
28+
<Type>Real</Type>
29+
</PropertyDefn>
30+
<PropertyDefn>
31+
<Name>bottom</Name>
32+
<ElementPath>bottom</ElementPath>
33+
<Type>Real</Type>
34+
</PropertyDefn>
35+
<PropertyDefn>
36+
<Name>id</Name>
37+
<ElementPath>id</ElementPath>
38+
<Type>Integer</Type>
39+
</PropertyDefn>
40+
</GMLFeatureClass>
41+
</GMLFeatureClassList>
Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ogr:FeatureCollection
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation=""
5+
xmlns:ogr="http://ogr.maptools.org/"
6+
xmlns:gml="http://www.opengis.net/gml">
7+
<gml:boundedBy>
8+
<gml:Box>
9+
<gml:coord><gml:X>-1</gml:X><gml:Y>-9</gml:Y></gml:coord>
10+
<gml:coord><gml:X>16.42413778650723</gml:X><gml:Y>6.5</gml:Y></gml:coord>
11+
</gml:Box>
12+
</gml:boundedBy>
13+
14+
<gml:featureMember>
15+
<ogr:grid_hexagon_overlay fid="grid_hexagon_overlay.0">
16+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,4 0.443375672974065,6.5 3.33012701892219,6.5 4.77350269189626,4.0 3.33012701892219,1.5 0.443375672974065,1.5 -1,4</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
17+
<ogr:left>-1.0000000000000000</ogr:left>
18+
<ogr:top>6.5000000000000000</ogr:top>
19+
<ogr:right>4.7735026918962600</ogr:right>
20+
<ogr:bottom>1.5000000000000000</ogr:bottom>
21+
<ogr:id>1</ogr:id>
22+
</ogr:grid_hexagon_overlay>
23+
</gml:featureMember>
24+
<gml:featureMember>
25+
<ogr:grid_hexagon_overlay fid="grid_hexagon_overlay.1">
26+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,0 0.443375672974065,2.5 3.33012701892219,2.5 4.77350269189626,0.0 3.33012701892219,-2.5 0.443375672974065,-2.5 -1,0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
27+
<ogr:left>-1.0000000000000000</ogr:left>
28+
<ogr:top>2.5000000000000000</ogr:top>
29+
<ogr:right>4.7735026918962600</ogr:right>
30+
<ogr:bottom>-2.5000000000000000</ogr:bottom>
31+
<ogr:id>2</ogr:id>
32+
</ogr:grid_hexagon_overlay>
33+
</gml:featureMember>
34+
<gml:featureMember>
35+
<ogr:grid_hexagon_overlay fid="grid_hexagon_overlay.2">
36+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-4 0.443375672974065,-1.5 3.33012701892219,-1.5 4.77350269189626,-4.0 3.33012701892219,-6.5 0.443375672974065,-6.5 -1,-4</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
37+
<ogr:left>-1.0000000000000000</ogr:left>
38+
<ogr:top>-1.5000000000000000</ogr:top>
39+
<ogr:right>4.7735026918962600</ogr:right>
40+
<ogr:bottom>-6.5000000000000000</ogr:bottom>
41+
<ogr:id>3</ogr:id>
42+
</ogr:grid_hexagon_overlay>
43+
</gml:featureMember>
44+
<gml:featureMember>
45+
<ogr:grid_hexagon_overlay fid="grid_hexagon_overlay.3">
46+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1.33012701892219,1.5 2.77350269189626,4.0 5.66025403784439,4.0 7.10362971081845,1.5 5.66025403784439,-1.0 2.77350269189626,-1.0 1.33012701892219,1.5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
47+
<ogr:left>1.3301270189221945</ogr:left>
48+
<ogr:top>4.0000000000000000</ogr:top>
49+
<ogr:right>7.1036297108184545</ogr:right>
50+
<ogr:bottom>-1.0000000000000000</ogr:bottom>
51+
<ogr:id>4</ogr:id>
52+
</ogr:grid_hexagon_overlay>
53+
</gml:featureMember>
54+
<gml:featureMember>
55+
<ogr:grid_hexagon_overlay fid="grid_hexagon_overlay.4">
56+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1.33012701892219,-2.5 2.77350269189626,0.0 5.66025403784439,0.0 7.10362971081845,-2.5 5.66025403784439,-5.0 2.77350269189626,-5.0 1.33012701892219,-2.5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
57+
<ogr:left>1.3301270189221945</ogr:left>
58+
<ogr:top>0.0000000000000000</ogr:top>
59+
<ogr:right>7.1036297108184545</ogr:right>
60+
<ogr:bottom>-5.0000000000000000</ogr:bottom>
61+
<ogr:id>5</ogr:id>
62+
</ogr:grid_hexagon_overlay>
63+
</gml:featureMember>
64+
<gml:featureMember>
65+
<ogr:grid_hexagon_overlay fid="grid_hexagon_overlay.5">
66+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1.33012701892219,-6.5 2.77350269189626,-4.0 5.66025403784439,-4.0 7.10362971081845,-6.5 5.66025403784439,-9.0 2.77350269189626,-9.0 1.33012701892219,-6.5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
67+
<ogr:left>1.3301270189221945</ogr:left>
68+
<ogr:top>-4.0000000000000000</ogr:top>
69+
<ogr:right>7.1036297108184545</ogr:right>
70+
<ogr:bottom>-9.0000000000000000</ogr:bottom>
71+
<ogr:id>6</ogr:id>
72+
</ogr:grid_hexagon_overlay>
73+
</gml:featureMember>
74+
<gml:featureMember>
75+
<ogr:grid_hexagon_overlay fid="grid_hexagon_overlay.6">
76+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3.66025403784439,4.0 5.10362971081845,6.5 7.99038105676658,6.5 9.43375672974065,4.0 7.99038105676658,1.5 5.10362971081845,1.5 3.66025403784439,4.0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
77+
<ogr:left>3.6602540378443891</ogr:left>
78+
<ogr:top>6.5000000000000000</ogr:top>
79+
<ogr:right>9.4337567297406490</ogr:right>
80+
<ogr:bottom>1.5000000000000000</ogr:bottom>
81+
<ogr:id>7</ogr:id>
82+
</ogr:grid_hexagon_overlay>
83+
</gml:featureMember>
84+
<gml:featureMember>
85+
<ogr:grid_hexagon_overlay fid="grid_hexagon_overlay.7">
86+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3.66025403784439,0.0 5.10362971081845,2.5 7.99038105676658,2.5 9.43375672974065,0.0 7.99038105676658,-2.5 5.10362971081845,-2.5 3.66025403784439,0.0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
87+
<ogr:left>3.6602540378443891</ogr:left>
88+
<ogr:top>2.5000000000000000</ogr:top>
89+
<ogr:right>9.4337567297406490</ogr:right>
90+
<ogr:bottom>-2.5000000000000000</ogr:bottom>
91+
<ogr:id>8</ogr:id>
92+
</ogr:grid_hexagon_overlay>
93+
</gml:featureMember>
94+
<gml:featureMember>
95+
<ogr:grid_hexagon_overlay fid="grid_hexagon_overlay.8">
96+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3.66025403784439,-4.0 5.10362971081845,-1.5 7.99038105676658,-1.5 9.43375672974065,-4.0 7.99038105676658,-6.5 5.10362971081845,-6.5 3.66025403784439,-4.0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
97+
<ogr:left>3.6602540378443891</ogr:left>
98+
<ogr:top>-1.5000000000000000</ogr:top>
99+
<ogr:right>9.4337567297406490</ogr:right>
100+
<ogr:bottom>-6.5000000000000000</ogr:bottom>
101+
<ogr:id>9</ogr:id>
102+
</ogr:grid_hexagon_overlay>
103+
</gml:featureMember>
104+
<gml:featureMember>
105+
<ogr:grid_hexagon_overlay fid="grid_hexagon_overlay.9">
106+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5.99038105676658,1.5 7.43375672974065,4.0 10.3205080756888,4.0 11.7638837486628,1.5 10.3205080756888,-1.0 7.43375672974065,-1.0 5.99038105676658,1.5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
107+
<ogr:left>5.9903810567665836</ogr:left>
108+
<ogr:top>4.0000000000000000</ogr:top>
109+
<ogr:right>11.7638837486628436</ogr:right>
110+
<ogr:bottom>-1.0000000000000000</ogr:bottom>
111+
<ogr:id>10</ogr:id>
112+
</ogr:grid_hexagon_overlay>
113+
</gml:featureMember>
114+
<gml:featureMember>
115+
<ogr:grid_hexagon_overlay fid="grid_hexagon_overlay.10">
116+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5.99038105676658,-2.5 7.43375672974065,0.0 10.3205080756888,0.0 11.7638837486628,-2.5 10.3205080756888,-5.0 7.43375672974065,-5.0 5.99038105676658,-2.5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
117+
<ogr:left>5.9903810567665836</ogr:left>
118+
<ogr:top>0.0000000000000000</ogr:top>
119+
<ogr:right>11.7638837486628436</ogr:right>
120+
<ogr:bottom>-5.0000000000000000</ogr:bottom>
121+
<ogr:id>11</ogr:id>
122+
</ogr:grid_hexagon_overlay>
123+
</gml:featureMember>
124+
<gml:featureMember>
125+
<ogr:grid_hexagon_overlay fid="grid_hexagon_overlay.11">
126+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5.99038105676658,-6.5 7.43375672974065,-4.0 10.3205080756888,-4.0 11.7638837486628,-6.5 10.3205080756888,-9.0 7.43375672974065,-9.0 5.99038105676658,-6.5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
127+
<ogr:left>5.9903810567665836</ogr:left>
128+
<ogr:top>-4.0000000000000000</ogr:top>
129+
<ogr:right>11.7638837486628436</ogr:right>
130+
<ogr:bottom>-9.0000000000000000</ogr:bottom>
131+
<ogr:id>12</ogr:id>
132+
</ogr:grid_hexagon_overlay>
133+
</gml:featureMember>
134+
<gml:featureMember>
135+
<ogr:grid_hexagon_overlay fid="grid_hexagon_overlay.12">
136+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>8.32050807568878,4.0 9.76388374866284,6.5 12.650635094611,6.5 14.094010767585,4.0 12.650635094611,1.5 9.76388374866284,1.5 8.32050807568878,4.0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
137+
<ogr:left>8.3205080756887781</ogr:left>
138+
<ogr:top>6.5000000000000000</ogr:top>
139+
<ogr:right>14.0940107675850381</ogr:right>
140+
<ogr:bottom>1.5000000000000000</ogr:bottom>
141+
<ogr:id>13</ogr:id>
142+
</ogr:grid_hexagon_overlay>
143+
</gml:featureMember>
144+
<gml:featureMember>
145+
<ogr:grid_hexagon_overlay fid="grid_hexagon_overlay.13">
146+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>8.32050807568878,0.0 9.76388374866284,2.5 12.650635094611,2.5 14.094010767585,0.0 12.650635094611,-2.5 9.76388374866284,-2.5 8.32050807568878,0.0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
147+
<ogr:left>8.3205080756887781</ogr:left>
148+
<ogr:top>2.5000000000000000</ogr:top>
149+
<ogr:right>14.0940107675850381</ogr:right>
150+
<ogr:bottom>-2.5000000000000000</ogr:bottom>
151+
<ogr:id>14</ogr:id>
152+
</ogr:grid_hexagon_overlay>
153+
</gml:featureMember>
154+
<gml:featureMember>
155+
<ogr:grid_hexagon_overlay fid="grid_hexagon_overlay.14">
156+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>8.32050807568878,-4.0 9.76388374866284,-1.5 12.650635094611,-1.5 14.094010767585,-4.0 12.650635094611,-6.5 9.76388374866284,-6.5 8.32050807568878,-4.0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
157+
<ogr:left>8.3205080756887781</ogr:left>
158+
<ogr:top>-1.5000000000000000</ogr:top>
159+
<ogr:right>14.0940107675850381</ogr:right>
160+
<ogr:bottom>-6.5000000000000000</ogr:bottom>
161+
<ogr:id>15</ogr:id>
162+
</ogr:grid_hexagon_overlay>
163+
</gml:featureMember>
164+
<gml:featureMember>
165+
<ogr:grid_hexagon_overlay fid="grid_hexagon_overlay.15">
166+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>10.650635094611,1.5 12.094010767585,4.0 14.9807621135332,4.0 16.4241377865072,1.5 14.9807621135332,-1.0 12.094010767585,-1.0 10.650635094611,1.5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
167+
<ogr:left>10.6506350946109727</ogr:left>
168+
<ogr:top>4.0000000000000000</ogr:top>
169+
<ogr:right>16.4241377865072309</ogr:right>
170+
<ogr:bottom>-1.0000000000000000</ogr:bottom>
171+
<ogr:id>16</ogr:id>
172+
</ogr:grid_hexagon_overlay>
173+
</gml:featureMember>
174+
<gml:featureMember>
175+
<ogr:grid_hexagon_overlay fid="grid_hexagon_overlay.16">
176+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>10.650635094611,-2.5 12.094010767585,0.0 14.9807621135332,0.0 16.4241377865072,-2.5 14.9807621135332,-5.0 12.094010767585,-5.0 10.650635094611,-2.5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
177+
<ogr:left>10.6506350946109727</ogr:left>
178+
<ogr:top>0.0000000000000000</ogr:top>
179+
<ogr:right>16.4241377865072309</ogr:right>
180+
<ogr:bottom>-5.0000000000000000</ogr:bottom>
181+
<ogr:id>17</ogr:id>
182+
</ogr:grid_hexagon_overlay>
183+
</gml:featureMember>
184+
<gml:featureMember>
185+
<ogr:grid_hexagon_overlay fid="grid_hexagon_overlay.17">
186+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>10.650635094611,-6.5 12.094010767585,-4.0 14.9807621135332,-4.0 16.4241377865072,-6.5 14.9807621135332,-9.0 12.094010767585,-9.0 10.650635094611,-6.5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
187+
<ogr:left>10.6506350946109727</ogr:left>
188+
<ogr:top>-4.0000000000000000</ogr:top>
189+
<ogr:right>16.4241377865072309</ogr:right>
190+
<ogr:bottom>-9.0000000000000000</ogr:bottom>
191+
<ogr:id>18</ogr:id>
192+
</ogr:grid_hexagon_overlay>
193+
</gml:featureMember>
194+
</ogr:FeatureCollection>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<GMLFeatureClassList>
2+
<GMLFeatureClass>
3+
<Name>grid_lines_overlay</Name>
4+
<ElementPath>grid_lines_overlay</ElementPath>
5+
<!--LINESTRING-->
6+
<GeometryType>2</GeometryType>
7+
<SRSName>EPSG:4326</SRSName>
8+
<DatasetSpecificInfo>
9+
<FeatureCount>12</FeatureCount>
10+
<ExtentXMin>-1.00000</ExtentXMin>
11+
<ExtentXMax>11.20000</ExtentXMax>
12+
<ExtentYMin>-4.00000</ExtentYMin>
13+
<ExtentYMax>6.50000</ExtentYMax>
14+
</DatasetSpecificInfo>
15+
<PropertyDefn>
16+
<Name>left</Name>
17+
<ElementPath>left</ElementPath>
18+
<Type>Real</Type>
19+
</PropertyDefn>
20+
<PropertyDefn>
21+
<Name>top</Name>
22+
<ElementPath>top</ElementPath>
23+
<Type>Real</Type>
24+
</PropertyDefn>
25+
<PropertyDefn>
26+
<Name>right</Name>
27+
<ElementPath>right</ElementPath>
28+
<Type>Real</Type>
29+
</PropertyDefn>
30+
<PropertyDefn>
31+
<Name>bottom</Name>
32+
<ElementPath>bottom</ElementPath>
33+
<Type>Real</Type>
34+
</PropertyDefn>
35+
<PropertyDefn>
36+
<Name>id</Name>
37+
<ElementPath>id</ElementPath>
38+
<Type>Integer</Type>
39+
</PropertyDefn>
40+
<PropertyDefn>
41+
<Name>coord</Name>
42+
<ElementPath>coord</ElementPath>
43+
<Type>Real</Type>
44+
</PropertyDefn>
45+
</GMLFeatureClass>
46+
</GMLFeatureClassList>
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ogr:FeatureCollection
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation=""
5+
xmlns:ogr="http://ogr.maptools.org/"
6+
xmlns:gml="http://www.opengis.net/gml">
7+
<gml:boundedBy>
8+
<gml:Box>
9+
<gml:coord><gml:X>-1</gml:X><gml:Y>-4</gml:Y></gml:coord>
10+
<gml:coord><gml:X>11.2</gml:X><gml:Y>6.5</gml:Y></gml:coord>
11+
</gml:Box>
12+
</gml:boundedBy>
13+
14+
<gml:featureMember>
15+
<ogr:grid_lines_overlay fid="grid_lines_overlay.0">
16+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>-1.0,6.5 11.2,6.5</gml:coordinates></gml:LineString></ogr:geometryProperty>
17+
<ogr:left>-1.0000000000000000</ogr:left>
18+
<ogr:top>6.5000000000000000</ogr:top>
19+
<ogr:right>11.1999999999999993</ogr:right>
20+
<ogr:bottom>6.5000000000000000</ogr:bottom>
21+
<ogr:id>1</ogr:id>
22+
<ogr:coord>6.500000000000000</ogr:coord>
23+
</ogr:grid_lines_overlay>
24+
</gml:featureMember>
25+
<gml:featureMember>
26+
<ogr:grid_lines_overlay fid="grid_lines_overlay.1">
27+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>-1.0,4.5 11.2,4.5</gml:coordinates></gml:LineString></ogr:geometryProperty>
28+
<ogr:left>-1.0000000000000000</ogr:left>
29+
<ogr:top>4.5000000000000000</ogr:top>
30+
<ogr:right>11.1999999999999993</ogr:right>
31+
<ogr:bottom>4.5000000000000000</ogr:bottom>
32+
<ogr:id>2</ogr:id>
33+
<ogr:coord>4.500000000000000</ogr:coord>
34+
</ogr:grid_lines_overlay>
35+
</gml:featureMember>
36+
<gml:featureMember>
37+
<ogr:grid_lines_overlay fid="grid_lines_overlay.2">
38+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>-1.0,3.5 11.2,3.5</gml:coordinates></gml:LineString></ogr:geometryProperty>
39+
<ogr:left>-1.0000000000000000</ogr:left>
40+
<ogr:top>3.5000000000000000</ogr:top>
41+
<ogr:right>11.1999999999999993</ogr:right>
42+
<ogr:bottom>3.5000000000000000</ogr:bottom>
43+
<ogr:id>3</ogr:id>
44+
<ogr:coord>3.500000000000000</ogr:coord>
45+
</ogr:grid_lines_overlay>
46+
</gml:featureMember>
47+
<gml:featureMember>
48+
<ogr:grid_lines_overlay fid="grid_lines_overlay.3">
49+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>-1.0,1.5 11.2,1.5</gml:coordinates></gml:LineString></ogr:geometryProperty>
50+
<ogr:left>-1.0000000000000000</ogr:left>
51+
<ogr:top>1.5000000000000000</ogr:top>
52+
<ogr:right>11.1999999999999993</ogr:right>
53+
<ogr:bottom>1.5000000000000000</ogr:bottom>
54+
<ogr:id>4</ogr:id>
55+
<ogr:coord>1.500000000000000</ogr:coord>
56+
</ogr:grid_lines_overlay>
57+
</gml:featureMember>
58+
<gml:featureMember>
59+
<ogr:grid_lines_overlay fid="grid_lines_overlay.4">
60+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>-1.0,0.5 11.2,0.5</gml:coordinates></gml:LineString></ogr:geometryProperty>
61+
<ogr:left>-1.0000000000000000</ogr:left>
62+
<ogr:top>0.5000000000000000</ogr:top>
63+
<ogr:right>11.1999999999999993</ogr:right>
64+
<ogr:bottom>0.5000000000000000</ogr:bottom>
65+
<ogr:id>5</ogr:id>
66+
<ogr:coord>0.500000000000000</ogr:coord>
67+
</ogr:grid_lines_overlay>
68+
</gml:featureMember>
69+
<gml:featureMember>
70+
<ogr:grid_lines_overlay fid="grid_lines_overlay.5">
71+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>-1.0,-1.5 11.2,-1.5</gml:coordinates></gml:LineString></ogr:geometryProperty>
72+
<ogr:left>-1.0000000000000000</ogr:left>
73+
<ogr:top>-1.5000000000000000</ogr:top>
74+
<ogr:right>11.1999999999999993</ogr:right>
75+
<ogr:bottom>-1.5000000000000000</ogr:bottom>
76+
<ogr:id>6</ogr:id>
77+
<ogr:coord>-1.500000000000000</ogr:coord>
78+
</ogr:grid_lines_overlay>
79+
</gml:featureMember>
80+
<gml:featureMember>
81+
<ogr:grid_lines_overlay fid="grid_lines_overlay.6">
82+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>-1.0,-2.5 11.2,-2.5</gml:coordinates></gml:LineString></ogr:geometryProperty>
83+
<ogr:left>-1.0000000000000000</ogr:left>
84+
<ogr:top>-2.5000000000000000</ogr:top>
85+
<ogr:right>11.1999999999999993</ogr:right>
86+
<ogr:bottom>-2.5000000000000000</ogr:bottom>
87+
<ogr:id>7</ogr:id>
88+
<ogr:coord>-2.500000000000000</ogr:coord>
89+
</ogr:grid_lines_overlay>
90+
</gml:featureMember>
91+
<gml:featureMember>
92+
<ogr:grid_lines_overlay fid="grid_lines_overlay.7">
93+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>-1.0,6.5 -1,-4</gml:coordinates></gml:LineString></ogr:geometryProperty>
94+
<ogr:left>-1.0000000000000000</ogr:left>
95+
<ogr:top>6.5000000000000000</ogr:top>
96+
<ogr:right>-1.0000000000000000</ogr:right>
97+
<ogr:bottom>-4.0000000000000000</ogr:bottom>
98+
<ogr:id>8</ogr:id>
99+
<ogr:coord>-1.000000000000000</ogr:coord>
100+
</ogr:grid_lines_overlay>
101+
</gml:featureMember>
102+
<gml:featureMember>
103+
<ogr:grid_lines_overlay fid="grid_lines_overlay.8">
104+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>2.0,6.5 2,-4</gml:coordinates></gml:LineString></ogr:geometryProperty>
105+
<ogr:left>2.0000000000000000</ogr:left>
106+
<ogr:top>6.5000000000000000</ogr:top>
107+
<ogr:right>2.0000000000000000</ogr:right>
108+
<ogr:bottom>-4.0000000000000000</ogr:bottom>
109+
<ogr:id>9</ogr:id>
110+
<ogr:coord>2.000000000000000</ogr:coord>
111+
</ogr:grid_lines_overlay>
112+
</gml:featureMember>
113+
<gml:featureMember>
114+
<ogr:grid_lines_overlay fid="grid_lines_overlay.9">
115+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>4.0,6.5 4,-4</gml:coordinates></gml:LineString></ogr:geometryProperty>
116+
<ogr:left>4.0000000000000000</ogr:left>
117+
<ogr:top>6.5000000000000000</ogr:top>
118+
<ogr:right>4.0000000000000000</ogr:right>
119+
<ogr:bottom>-4.0000000000000000</ogr:bottom>
120+
<ogr:id>10</ogr:id>
121+
<ogr:coord>4.000000000000000</ogr:coord>
122+
</ogr:grid_lines_overlay>
123+
</gml:featureMember>
124+
<gml:featureMember>
125+
<ogr:grid_lines_overlay fid="grid_lines_overlay.10">
126+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>7.0,6.5 7,-4</gml:coordinates></gml:LineString></ogr:geometryProperty>
127+
<ogr:left>7.0000000000000000</ogr:left>
128+
<ogr:top>6.5000000000000000</ogr:top>
129+
<ogr:right>7.0000000000000000</ogr:right>
130+
<ogr:bottom>-4.0000000000000000</ogr:bottom>
131+
<ogr:id>11</ogr:id>
132+
<ogr:coord>7.000000000000000</ogr:coord>
133+
</ogr:grid_lines_overlay>
134+
</gml:featureMember>
135+
<gml:featureMember>
136+
<ogr:grid_lines_overlay fid="grid_lines_overlay.11">
137+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>9.0,6.5 9,-4</gml:coordinates></gml:LineString></ogr:geometryProperty>
138+
<ogr:left>9.0000000000000000</ogr:left>
139+
<ogr:top>6.5000000000000000</ogr:top>
140+
<ogr:right>9.0000000000000000</ogr:right>
141+
<ogr:bottom>-4.0000000000000000</ogr:bottom>
142+
<ogr:id>12</ogr:id>
143+
<ogr:coord>9.000000000000000</ogr:coord>
144+
</ogr:grid_lines_overlay>
145+
</gml:featureMember>
146+
</ogr:FeatureCollection>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<GMLFeatureClassList>
2+
<GMLFeatureClass>
3+
<Name>grid_rectangle_overlay</Name>
4+
<ElementPath>grid_rectangle_overlay</ElementPath>
5+
<!--POLYGON-->
6+
<GeometryType>3</GeometryType>
7+
<SRSName>EPSG:4326</SRSName>
8+
<DatasetSpecificInfo>
9+
<FeatureCount>30</FeatureCount>
10+
<ExtentXMin>-1.00000</ExtentXMin>
11+
<ExtentXMax>16.00000</ExtentXMax>
12+
<ExtentYMin>-6.50000</ExtentYMin>
13+
<ExtentYMax>6.50000</ExtentYMax>
14+
</DatasetSpecificInfo>
15+
<PropertyDefn>
16+
<Name>left</Name>
17+
<ElementPath>left</ElementPath>
18+
<Type>Real</Type>
19+
</PropertyDefn>
20+
<PropertyDefn>
21+
<Name>top</Name>
22+
<ElementPath>top</ElementPath>
23+
<Type>Real</Type>
24+
</PropertyDefn>
25+
<PropertyDefn>
26+
<Name>right</Name>
27+
<ElementPath>right</ElementPath>
28+
<Type>Real</Type>
29+
</PropertyDefn>
30+
<PropertyDefn>
31+
<Name>bottom</Name>
32+
<ElementPath>bottom</ElementPath>
33+
<Type>Real</Type>
34+
</PropertyDefn>
35+
<PropertyDefn>
36+
<Name>id</Name>
37+
<ElementPath>id</ElementPath>
38+
<Type>Integer</Type>
39+
</PropertyDefn>
40+
</GMLFeatureClass>
41+
</GMLFeatureClassList>

‎python/plugins/processing/tests/testdata/expected/grid_rectangle_overlay.gml

Lines changed: 314 additions & 0 deletions
Large diffs are not rendered by default.

‎python/plugins/processing/tests/testdata/qgis_algorithm_tests.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,6 +1763,74 @@ tests:
17631763
geometry:
17641764
precision: 7
17651765

1766+
- algorithm: qgis:creategridlines
1767+
name: Create grid (lines with overlay)
1768+
params:
1769+
CRS: EPSG:4326
1770+
EXTENT: -1,11.2,-4,6.5
1771+
HOVERLAY: 2.0
1772+
HSPACING: 5.0
1773+
VOVERLAY: 1.0
1774+
VSPACING: 3.0
1775+
results:
1776+
OUTPUT:
1777+
name: expected/grid_lines_overlay.gml
1778+
type: vector
1779+
1780+
- algorithm: qgis:creategridpolygon
1781+
name: Create grid (rectangle with overlay)
1782+
params:
1783+
CRS: EPSG:4326
1784+
EXTENT: -1,11.2,-4,6.5
1785+
HOVERLAY: 2.0
1786+
HSPACING: 5.0
1787+
TYPE: '0'
1788+
VOVERLAY: 1.0
1789+
VSPACING: 3.0
1790+
results:
1791+
OUTPUT:
1792+
name: expected/grid_rectangle_overlay.gml
1793+
type: vector
1794+
compare:
1795+
geometry:
1796+
precision: 7
1797+
1798+
- algorithm: qgis:creategridpolygon
1799+
name: Create grid (diamond with overlay)
1800+
params:
1801+
CRS: EPSG:4326
1802+
EXTENT: -1,11.2,-4,6.5
1803+
HOVERLAY: 2.0
1804+
HSPACING: 5.0
1805+
TYPE: '1'
1806+
VOVERLAY: 1.0
1807+
VSPACING: 3.0
1808+
results:
1809+
OUTPUT:
1810+
name: expected/grid_diamond_overlay.gml
1811+
type: vector
1812+
compare:
1813+
geometry:
1814+
precision: 7
1815+
1816+
- algorithm: qgis:creategridpolygon
1817+
name: Create grid (hexagon with overlay)
1818+
params:
1819+
CRS: EPSG:4326
1820+
EXTENT: -1,11.2,-4,6.5
1821+
HOVERLAY: 2.0
1822+
HSPACING: 5.0
1823+
TYPE: '2'
1824+
VOVERLAY: 1.0
1825+
VSPACING: 5.0
1826+
results:
1827+
OUTPUT:
1828+
name: expected/grid_hexagon_overlay.gml
1829+
type: vector
1830+
compare:
1831+
geometry:
1832+
precision: 7
1833+
17661834
- algorithm: qgis:deleteholes
17671835
name: Delete holes (no min)
17681836
params:

0 commit comments

Comments
 (0)
Please sign in to comment.