Changes between Version 41 and Version 42 of CLC Join
- Timestamp:
- Jun 1, 2010 12:30:38 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CLC Join
v41 v42 1 1 = This page describes the join of ccm21.catchments with the clc = 2 2 [wiki:"CookBook Eda"] 3 4 3 5 = First an example for Britany = 6 7 4 8 We chose to work on a reduced scale to build the queries as the clc is just damn too big for us, and raster approches are not yet avalaible in postgis, though we fancy using the functions displayed in the developpement page http://trac.osgeo.org/postgis/wiki/WKTRaster. 9 10 5 11 == building a table of clc only for Britany == 12 13 6 14 After several trial neither ''' ST_Crosses ''' nor ''' ST_Contains ''' did work, the example with ''' ST_Intersects ''' provides a surface that is larger than britany, but ST_Crosses missed the area near the coasts as the geom had to be fully within Britany. This is not really a problem as the clipped function in the next paragraph solves this problem and is not using the Britany layer. Howerver it could be usefull to work on a reduced dataset for the clc as the computing time is very high .... 7 15 '' A solution will be to build a single area from the catchments layer for the selected country (using the france.wso1_id) and use it in a similar way as we used Britany here.... '' … … 31 39 32 40 == Cutting the surface according to the catchments area == 41 42 33 43 Note this one took a long time to run on my computer, one hour for Britany... 34 44 It uses ''' ST_Intersects ''' to reduce the search list and ''' ST_Multi(ST_Intersection()) ''' to cut along the primary catchments borders. … … 63 73 The final file is effectively cut, the following layer was displayed with the purple layer on top of the brown (catchments) [[BR]] 64 74 [[Image(source:data/Docs/trac/coupure des couvertures anthropisées.png,600px)]] [[BR]] 75 76 65 77 == Grouping the surface by gid and code_00 == 78 79 66 80 The next steps is to group the different layers, we use the ''' ST_Multi(ST_Collect(()) ''' function to group the POLYGONS into MULTIPOLYGONS (one per line) and before this we do the reverse by transforming all MUTIPOLYGONS into POLYGONS using ''' ST_Dump() '''. So finally calculating the area using ''' ST_Area ''' is a very quick and simple step. Note the unicity constraint wich ensures that we have only one code_00 per unit catchment. 67 81