Skip to content

Using Geocoder::geocode within a loop gets Server Time Out. #43

Closed
@emarino0411

Description

@emarino0411

Hi I have this code:

foreach ($results as $result) {
$barangay = DB::table('rbrgy')->where('bgycode', $result->barangay)->first();
$loc = getBrgyName($barangay->bgycode) . ', '
. getCityName($barangay->citycode) . ', '
. getProvName($barangay->provcode) . ', '
. getRegion($barangay->regcode) . ', '
. 'Philippines';
$geocode = Geocoder::geocode($loc);
}

When the $results array is <= 10, it works fine but when $results is > 10, the I get a server timeout. Is there a way on how I can get multiple geocodes with one function call?

Please help. Tried searching the issues but there seems to be no issues related to this. Thanks in advance!

~May

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions