'ford'='yes'",1, "barrier is not null and (access='yes' or access='permissive' or foot='yes' or foot='permissive' or foot='designated' or foot='official')",1, "barrier like '%gate%' and (foot!='no' and foot!='private') ",1, "barrier like '%caddle%' and (foot!='no' and foot!='private') ",1, "barrier like '%bollard%' and (foot!='no' and foot!='private') ",1, "barrier like '%kerb%' and (foot!='no' and foot!='private') ",1, "barrier like '%block%' and (foot!='no' and foot!='private') ",1, "barrier like '%cycle%' and (foot!='no' and foot!='private') ",1, "barrier like '%stile%' and (foot!='no' and foot!='private') ",1, "barrier like '%debris%' and (foot!='no' and foot!='private') ",1 ); $query="select osm_id,st_astext(way) as way from osm_pedestrian;"; echo "delete and fill osm_pedestrian\n"; $query2="delete from osm_pedestrian;\n"; $result2=pg_query($db,$query2); $query2="select osm_id,st_astext(ST_ForceRHR(way)) as way from osm_polygon where ((((nature='beach') or (tags->'public_transport'='platform')) and (access in ('yes','permissive') and foot is null or foot in ('yes','permissive'))) or (highway in ('residential','track','pedestrian','footway','path','living_street','pathless') or man_made='pier' )) and (access is null or access='yes' or access='designated' or foot='yes') and (foot is null or foot !='no') and (layer is null or layer='0') and geometrytype(way)='POLYGON';"; $result2=pg_query($db,$query2); while($r=pg_fetch_array($result2)) { $osm_id=$r['osm_id']; $way=$r['way']; $query3="insert into osm_pedestrian (osm_id,service,way) values ($osm_id,'polycopy',ST_GeomFromText('$way',900913));\n"; $result3=pg_query($db,$query3); } for($h=0;$h