Select only neighbour rows who pass a where-test
I don't know if this will work in sqlite3, but you didn't tag the question with that, so here is an Oracle solution.  

SELECT ID, Speed FROM
(
    SELECT ID, Speed, MIN(Speed) OVER (ORDER BY ID) InSequence  
    FROM
    (
        SELECT ID, Speed, SUM(Speed) OVER (ORDER BY ID) SpeedSum
        FROM location 
    )
    WHERE SpeedSum &gt; 0 
) 
WHERE InSequence &gt; 0
ORDER BY ID;


The SUM(Speed) analytic removed the leading zero speed rows and the MIN(Speed) analytic allows us to eliminate rows starting with the first zero speed row remaining.  The sample data can be created as follows:

drop table location;

create table location as (select level id, 
   case when level between 3 and 5 then 3 
        when level between 9 and 11 then 3
        else 0 end speed from dual connect by level &lt;=12);

select * from location;


It seems to behave correctly through all the following variations, but there could be a pattern I've missed:

UPDATE location SET Speed=1 WHERE ID=2;
UPDATE location SET Speed=2 WHERE ID=3;
UPDATE location SET Speed=1 WHERE ID=6;
DELETE FROM location WHERE ID IN (7,9);


UPDATE location SET Speed=0 WHERE ID=2;
UPDATE location SET Speed=5 WHERE ID=1;


This solution only requires one full table scan rather than the two Noam's solution requires, but it only finds the first set of values whereas Noam's finds all the sets.  It also assumes a threshold of zero, but could be modified for any threshold.