# Changes between Version 88 and Version 89 of WKTRaster/SpecificationWorking01

Show
Ignore:
Timestamp:
12/21/09 14:06:12 (3 years ago)
Comment:

--

Unmodified
Added
Removed
Modified
• ## WKTRaster/SpecificationWorking01

v88 v89
320320 Variant 2 proceeds in a very similar way except that convex hulls of both rasters are computed and compared in step 2) and both shape of raster are computed and compared in step 3).
321321
322  If you want to limit the intersection test to the first condition, simply use the && operator:
322 If you want to limit the intersection test to the first condition, simply use the && operator. The raster and the geometry will be casted to their respective bounding box (box2d objects):
323323
324324  raster && geometry

334334 It might be faster to skip test 2) if this test is not signicantly faster than test 3).
335335
336 '''ST_Intersection(raster, geometry) -> geometry'''
337
338  Variant 1: ST_Intersection(geometry, raster) -> geometry
336'''ST_Intersection(raster, geometry) -> geometry''' - Returns a geometry that represents the shared portion of the geometry and the raster.
337
338 Variant 1:
339
340  ST_Intersection(geometry, raster) -> geometry
339341
340342 Variant 2 & 3:

350352  ST_Intersection(raster, raster, 'geometry') -> geometry
351353
352
354 Returns a geometry that represents the point set intersection of the geometry and the raster. The raster is first polygonised using ST_AsPolygon(raster) and ST_Intersection(geometry, geometry) is then performed between the provided geometry and all the geometries resulting from the polygonisation of the raster.
355
356 If the geometries do not share any space (are disjoint), then an empty geometry collection is returned.
357
358 ST_Intersection in conjunction with ST_Intersects is very useful for clipping geometries such as in bounding box, buffer, region queries where you only want to return that portion of a geometry that sits in a country or region of interest.
359
360 If you only want to compute the intersection between the convex hull of the raster without polygonising it to group of contiguous pixels sharing a common value, do:
361
362  ST_Intersection(ST_ConvexHull(raster, 'WITHNODATA'), geometry)
363
364 If you only want to compute the intersection between the shape of the raster without polygonising it to group of contiguous pixels sharing a common value, do:
365
366 ST_Intersection(ST_Shape(raster), geometry)
367
368 '''Implementation details'''
369
370 This function should be implemented as a pl/pgSQL function (possibly only a SQL function) performing the intersection between the provided geometry and the table generated by ST_AsPolygon(raster).
371
372
353373
354374----