<div dir="ltr"><div>Good !</div><div><br></div>Something is strange with the result,<div>you get only 190k lines intersecting road buffer,</div><div>it is very few , I expected at least 10times this!</div><div>How many time took this computing by the way?</div>
<div><br></div><div>How many road buffer geom do you have ? (select count(*) from <span style="font-family:arial,sans-serif;font-size:12.800000190734863px">ukmajrdbuffer</span><span style="font-family:arial,sans-serif;font-size:12.800000190734863px"> </span>).</div>
<div><br></div><div>Cheers,</div><div>Rémi-C</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/11/15 James David Smith <span dir="ltr"><<a href="mailto:james.david.smith@gmail.com" target="_blank">james.david.smith@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey.<br>
<br>
Yes, it's done. Was just getting some lunch! :-)<br>
<br>
select count(*) from lines_for_each_road<br>
Result = 187033<br>
<br>
I have also just ran 'VACUUM ANALYZE' on the tables<br>
'lines_for_each_road' as well as the table 'all_lines'<br>
<br>
I also can confirm that I have ran the following commands:<br>
<br>
CREATE INDEX all_lines_index ON all_lines USING GIST ( the_geom )<br>
CREATE INDEX ukmajrdbuffer_index ON ukmajrdbuffer USING GIST (geom);<br>
<br>
Should we now uncomment this line from the previous query?<br>
<div class="im"><br>
"  SELECT row_number() over() AS id--,*  "<br>
<br>
</div>Thanks again Remi,<br>
<br>
James<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
On 15 November 2013 13:14, Rémi Cura <<a href="mailto:remi.cura@gmail.com">remi.cura@gmail.com</a>> wrote:<br>
> Also if you do have indexes,<br>
> can you run a "VACUUM ANALYZE", so that the indexes will be used?<br>
><br>
> Cheers,<br>
><br>
> Rémi-C<br>
><br>
><br>
> 2013/11/15 Rémi Cura <<a href="mailto:remi.cura@gmail.com">remi.cura@gmail.com</a>><br>
>><br>
>> It should be finished by now,<br>
>> can you check you have geom indexes on :<br>
>> "ukmajrdbuffer.geom" and  "all_lines.the_geom"<br>
>><br>
>><br>
>> How many geoms do you have in "ukmajrdbuffer"?<br>
>><br>
>> Cheers,<br>
>> Rémi-C<br>
>><br>
>><br>
>> 2013/11/15 Rémi Cura <<a href="mailto:remi.cura@gmail.com">remi.cura@gmail.com</a>><br>
>>><br>
>>> Hey Sandro,<br>
>>><br>
>>> Thanks for this, it is at least twice faster =)<br>
>>><br>
>>> Cheers,<br>
>>> Rémi-C<br>
>>><br>
>>><br>
>>><br>
>>><br>
>>> 2013/11/15 James David Smith <<a href="mailto:james.david.smith@gmail.com">james.david.smith@gmail.com</a>><br>
>>>><br>
>>>> Thanks both. Geometries now fixed.<br>
>>>><br>
>>>> The query 'CREATE TABLE lines_for_each_road....' has now been set<br>
>>>> running. Will report back when it's done. I suspect it may take a<br>
>>>> while!<br>
>>>><br>
>>>> James<br>
>>>><br>
>>>> On 15 November 2013 11:03, Sandro Santilli <<a href="mailto:strk@keybit.net">strk@keybit.net</a>> wrote:<br>
>>>> > On Fri, Nov 15, 2013 at 11:50:42AM +0100, Rémi Cura wrote:<br>
>>>> >> Yep, maybe something like<br>
>>>> >><br>
>>>> >> UPDATE ukmajrdbuffer SET the_geom = ST_MakeValid(the_geom)<br>
>>>> >> WHERE ST_IsValid(the_geom) = FALSE<br>
>>>> ><br>
>>>> > ST_MakeValid internally checks for ST_IsValid, so no need<br>
>>>> > to add the condition (which would run the test twice).<br>
>>>> ><br>
>>>> > --strk;<br>
>>>> > _______________________________________________<br>
>>>> > postgis-users mailing list<br>
>>>> > <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
>>>> > <a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
>>>> _______________________________________________<br>
>>>> postgis-users mailing list<br>
>>>> <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
>>>> <a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
>>><br>
>>><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> postgis-users mailing list<br>
> <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
</div></div></blockquote></div><br></div>