D 2012-11-10T11:59:21.901 L benchmark-4.0 P ac4d14b19870c304878d030920ae94afca7917fa U sandro W 12656
Fig. 1This one is the original set of Contour Lines to be clipped. |
![]() |
Fig. 2This is the final result of the clipping operation.
|
![]() |
Fig. 3This is a magnified detail of the Study Area and Clipped Contour Lines.As you can easily notice there are lots of Contour Lines; and each Line has many vertexes. This one is a rather complex problem to be resolved: and it surely represents a thorough and demanding test. |
![]() |
.loadshp parameters | Step #1simply a dot macro command understood by the SpatiaLite front-end tool, allowing to directly import an external Shapefile into a corresponding Spatial Table within the DB. |
Step #2this single SQL query performs all the actual Clipping task.ST_Intersection() is a Spatial SQL function computing the intersection between the Study Area (polygon) and each Contour Line (linestring). This could be:
| |
Step #3just a stupid post-processing step; the previous query has surely generated many NULL geometries, and we'll now get rid of all them. | |
Step #4the very final post-processing step: transforming the table containing all Clipped Contour Lines into a genuine Spatial Table supported by its own Spatial Index. | |
measuring the timethis simply is a weird SQL trick; we'll query the system clock immediately before and after performing each step, so to get full trace of the corresponding timings. |