+
+ $aQueriesPlacex = array();
+ $aQueriesOsmline = array();
+ // the query is divided into parcels, so that the work between the processes, i.e. the DBInstances, will be evenly distributed
+ $iNumberOfParcels = 100;
+ for($i = 0; $i < $iNumberOfParcels; $i++)
+ {
+ $sSQL = 'insert into placex (osm_type, osm_id, class, type, name, admin_level, ';
+ $sSQL .= 'housenumber, street, addr_place, isin, postcode, country_code, extratags, ';
+ $sSQL .= 'geometry) select * from place where osm_id % '.$iNumberOfParcels.' = '.$i.' and not ';
+ $sSQL .= '(class=\'place\' and type=\'houses\' and osm_type=\'W\' and ST_GeometryType(geometry) = \'ST_LineString\');';
+ array_push($aQueriesPlacex, $sSQL);
+ $sSQL = 'select insert_osmline (osm_id, housenumber, street, addr_place, postcode, country_code, ';
+ $sSQL .= 'geometry) from place where osm_id % '.$iNumberOfParcels.' = '.$i.' and ';
+ $sSQL .= 'class=\'place\' and type=\'houses\' and osm_type=\'W\' and ST_GeometryType(geometry) = \'ST_LineString\'';
+ array_push($aQueriesOsmline, $sSQL);
+ }
+