D 2012-11-10T12:23:37.564 L benchmark-4.0 P df738fae756e09f6cc4b4ba9da6fa773390bc11a U sandro W 13331
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 very 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). The returned result 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. |