|
156 | 156 | {
|
157 | 157 | echo "WARNING: external UK postcode table not found.\n";
|
158 | 158 | }
|
159 |
| - pgsqlRunScriptFile(CONST_BasePath.'/data/us_statecounty.sql'); |
160 |
| - pgsqlRunScriptFile(CONST_BasePath.'/data/us_state.sql'); |
161 |
| - pgsqlRunScriptFile(CONST_BasePath.'/data/us_postcode.sql'); |
| 159 | + if (CONST_Use_Extra_US_Postcodes) |
| 160 | + { |
| 161 | + pgsqlRunScriptFile(CONST_BasePath.'/data/us_postcode.sql'); |
| 162 | + } |
162 | 163 |
|
163 | 164 | if ($aCMDResult['no-partitions'])
|
164 | 165 | {
|
|
509 | 510 | $sSQL .= "from placex where postcode is not null group by calculated_country_code,postcode) as x";
|
510 | 511 | if (!pg_query($oDB->connection, $sSQL)) fail(pg_last_error($oDB->connection));
|
511 | 512 |
|
512 |
| - $sSQL = "insert into placex (osm_type,osm_id,class,type,postcode,calculated_country_code,geometry) "; |
513 |
| - $sSQL .= "select 'P',nextval('seq_postcodes'),'place','postcode',postcode,'us',"; |
514 |
| - $sSQL .= "ST_SetSRID(ST_Point(x,y),4326) as geometry from us_postcode"; |
515 |
| - if (!pg_query($oDB->connection, $sSQL)) fail(pg_last_error($oDB->connection)); |
| 513 | + if (CONST_Use_Extra_US_Postcodes) |
| 514 | + { |
| 515 | + $sSQL = "insert into placex (osm_type,osm_id,class,type,postcode,calculated_country_code,geometry) "; |
| 516 | + $sSQL .= "select 'P',nextval('seq_postcodes'),'place','postcode',postcode,'us',"; |
| 517 | + $sSQL .= "ST_SetSRID(ST_Point(x,y),4326) as geometry from us_postcode"; |
| 518 | + if (!pg_query($oDB->connection, $sSQL)) fail(pg_last_error($oDB->connection)); |
| 519 | + } |
516 | 520 | }
|
517 | 521 |
|
518 | 522 | if ($aCMDResult['osmosis-init'] || ($aCMDResult['all'] && !$aCMDResult['drop'])) // no use doing osmosis-init when dropping update tables
|
|
0 commit comments