GusApi icon indicating copy to clipboard operation
GusApi copied to clipboard

GusApi can not get street number

Open hkt5 opened this issue 8 years ago • 4 comments

look here plesae: array (size=1) 0 => object(GusApi\SearchReport)[59] private 'regon' => string '24193965000000' (length=14) private 'regon14' => string '24193965000000' (length=14) private 'name' => string 'SPRAWY SPÓŁKA Z OGRANICZONĄ ODPOWIEDZIALNOŚCIĄ' (length=51) private 'province' => string 'ŚLĄSKIE' (length=9) private 'district' => string 'm. Katowice' (length=11) private 'community' => string 'M. Katowice' (length=11) private 'city' => string 'Katowice' (length=8) private 'zipCode' => string '40-012' (length=6) private 'street' => string 'ul. św. Jana' (length=13) private 'type' => string 'p' (length=1) private 'silo' => int 6 {"success":true,"data":{"street":"ul. \u015bw. Jana","city":"Katowice","province":"\u015aL\u0104SKIE","zip_code":"40-012","name":"SPRAWY SP\u00d3\u0141KA Z OGRANICZON\u0104 ODPOWIEDZIALNO\u015aCI\u0104"}}

GusApi can not get local number,

hkt5 avatar Jun 27 '17 12:06 hkt5

Please see #13

johnzuk avatar Jun 27 '17 15:06 johnzuk

Hey there,

trying to figure out how the get the full address with house number. Is the answer from issue #13 still valid? Not quite sure, where the definition of ReportType should be changed.

Thank you in advance for your answer.

Best regards, Krzysztof

EDIT:

As I understand we can get the house number from the getFullReport object:

$fullReport = $gus->getFullReport(
                    $sessionId,
                    $gusReport,
                    $reportType
                );

dump($fullReport->dane->praw_adSiedzNumerLokalu->__toString());
dump($fullReport->dane->praw_adSiedzNumerNieruchomosci->__toString());

Is there any simpler way? I did not find any designated method for the house number.

zembrowski avatar Feb 08 '18 09:02 zembrowski

There is no simply way to get only the house number. Ony way is to getFullReport with ReportTypes::REPORT_PUBLIC_LAW eg.

use GusApi\ReportTypes;
....
 var_dump($gus->getFullReport(
    $sessionId,
    $gusReport,
    ReportTypes::ReportTypes::REPORT_PUBLIC_LAW
));

johnzuk avatar Feb 09 '18 08:02 johnzuk

Till version 5.x #77 (BIR1.1 https://api.stat.gov.pl/Home/RegonApi) You can get property number and apartment number directly from SearchReport properties: $propertyNumber, $apartmentNumber

johnzuk avatar Jun 02 '19 20:06 johnzuk