Tak, można to zrobić bardzo łatwo. Pokazuje to poniższy przykład.
Przygotowanie
Aby przesyłać zapytania internetowe do Geo-Zone Tool za pomocą Pythona, potrzebne są:
- Edytor lub IDE (Integrated Development Environment) do pisania skryptu
-
Python - python.org
-
Żądania biblioteki Python
-
Biblioteka Python Pandas
(opcjonalnie)
Aby przesłać zapytanie online o narzędzie do geolokalizacji, wymagane są informacje dla narzędzia do geolokalizacji. Wyjaśnimy to na przykładzie struktury adresu URL w zapytaniu:
→
Controlling WebService (API)
W tym przykładzie wykorzystane zostały następujące informacje, które należy zastąpić w skrypcie własnymi:
- Język: pl (niemiecki)
- Logowanie: jan [email protected]
- linia krzyżująca: 123456ABCD
- Mapa: wiatr-DIN-EN-1991-1-4 (obciążenie wiatrem zgodnie z niemieckim załącznikiem EC1)
- Położenie: Dlubal, Tiefenbach (siedziba Dlubal GmbH)
- Pozycja: 49.4353975, 12.5894907 (szerokość i długość geograficzna)
Wykonaj żądanie sieciowe i odczytaj dane
Poniższy skrypt wysyła zapytanie do usługi sieciowej Narzędzia do geolokalizacji i dokumentuje wymagane czasy oraz zawartość.
Prowadzi to na przykład do następujących wyników:
- kod.wyjście#
Znacznik czasu: 2024-08-22 13:24:32.727006
Długość: 2,214527
Kod statusu: 200
Nagłówek: text/html; charset=utf-8
Tekst wniosku:
Wynik 1, Wynik 2, Strefa, Szerokość, Długość geograficzna, Wysokość, Ulica, Kod pocztowy, Miasto, Norma, Załącznik, Notatka(i), Nota prawna
22,5 m/s,0,32 kN/m2,1,49.4353975,12.5894907,520.69384765625,Am Zellweg 2,9346,Tiefenbach,EN 1991-1-4,DIN EN 1991-1-4
#/code#
Dodanie: Przygotowywanie treści żądania internetowego
Poniższy skrypt konwertuje tekst uzyskany z usługi sieciowej Geo-Zone Tool do postaci tabelarycznej. Ponadto wartości wyników są oddzielane od ich jednostek i ostatecznie zapisywane jako plik CSV i Excel.
Daje to na przykład następujące wyniki:
- kod.wyjście#
Oryginalny Dataframe:
- Wynik 1, Wynik 2, Strefa, szerokość, długość geograficzna, wysokość, ulica, kod pocztowy, kod pocztowy, norma miejska Załącznik Uwagi
0 22,5 m/s 0,32 kN/m2 1 49.435398 12.589491 520.693848 Am Zellweg 2 93464 Tiefenbach EN 1991-1-4 DIN EN 1991-1-4 NaN
Manipulowana ramka danych:
- (Wynik 1, wartość) (Wynik 1, jednostka) (Wynik 2, wartość) (Wynik 2, jednostka) Strefa Szerokość Długość Wysokość Ulica ZIP Miasto Standard Załącznik Uwagi
0 22,5 m/s 0,32 kN/m2 1 49.435398 12.589491 520.693848 Am Zellweg 2 93464 Tiefenbach EN 1991-1-4 DIN EN 1991-1-4 NaN
Przykładowe dane wyjściowe:
- Pierwszy wynik ma wartość 22,5. (m/s)
#/code#
Pokaż więcej