diff --git a/gschliefgraben_glasfaser/import_feature_sensor.py b/gschliefgraben_glasfaser/import_feature_sensor.py index 1df55db..95e7cc9 100644 --- a/gschliefgraben_glasfaser/import_feature_sensor.py +++ b/gschliefgraben_glasfaser/import_feature_sensor.py @@ -45,6 +45,9 @@ def main(): # "Inklinometer inclino1_02, Gschliefgraben Glasfaser" # ) # procedure = Procedure( "inclino1_02","inclino1_02") + # foi = FoI("degree", "m", (13.774966, 47.910849, 0.0), + # "inclino1-glasfaser-gschliefgraben", + # "Glasfaser Untersuchungen am Gschliefgraben (Gmunden)") # offering = Offering( # "https://geomon.geologie.ac.at/52n-sos-webapp/api/offerings/", @@ -52,6 +55,19 @@ def main(): # "Inklinometer inclino1_05, Gschliefgraben Glasfaser" # ) # procedure = Procedure("inclino1_05", "inclino1_05") + # foi = FoI("degree", "m", (13.774966, 47.910849, 0.0), + # "inclino1-glasfaser-gschliefgraben", + # "Glasfaser Untersuchungen am Gschliefgraben (Gmunden)") + + # offering = Offering( + # "https://geomon.geologie.ac.at/52n-sos-webapp/api/offerings/", + # "inclino1_14", + # "Inklinometer inclino1_14, Gschliefgraben Glasfaser" + # ) + # procedure = Procedure("inclino1_14", "inclino1_14") + # foi = FoI("degree", "m", (13.774966, 47.910849, 0.0), + # "inclino1-glasfaser-gschliefgraben", + # "Glasfaser Untersuchungen am Gschliefgraben (Gmunden)") offering = Offering( "https://geomon.geologie.ac.at/52n-sos-webapp/api/offerings/", @@ -59,9 +75,9 @@ def main(): "Inklinometer inclino1_06, Gschliefgraben Glasfaser" ) procedure = Procedure("inclino1_06", "inclino1_06") - - foi = FoI("degree", "m", (47.910849, 13.774966, 0.0), - "FBGuard23", "Glasfaser Untersuchungen am Gschliefgraben (Gmunden)") + foi = FoI("degree", "m", (13.774966, 47.910849, 0.0), + "inclino1-glasfaser-gschliefgraben", + "Glasfaser Untersuchungen am Gschliefgraben (Gmunden)") sensor_type = SensorType("inclinometer") post_data = insert_sensor(offering, procedure, foi, sensor_type) diff --git a/insert_sensor/Untitled-2.txt b/insert_sensor/Untitled-2.txt new file mode 100644 index 0000000..fafe9ad --- /dev/null +++ b/insert_sensor/Untitled-2.txt @@ -0,0 +1,207 @@ +https://portal.ogc.org/files/?artifact_id=64353 +Seite 25 + +https://github.com/52North/SWE-Ingestion-Service/blob/dev/docs/ProcessDescription.md + + + + + + + + + + + 2019-11-19T17:46:15.000+00:00 + + + + + + 2019-11-19T13:50:00.000+00:00 + + + + + + + + pechgraben + Katastropheneinsatz in Pechgraben + + + + + 14.54621, 47.92861 + + + + + + + https://www.flickr.com/photos/username/123456789/ + + + + + + + + + + + + + + + + + + + I am text + + + + + true + + + + + + + + { + "request": "InsertObservation", + "service": "SOS", + "version": "2.0.0", + "offering": "camera1", + "observation": { + "identifier": { + "value": "ob_test", + "codespace": "http://www.opengis.net/def/nil/OGC/0/unknown" + }, + "type": "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement", + "procedure": "camera1", + "observedProperty": "Image", + "featureOfInterest": { + "identifier": { + "value": "pechgraben", + "codespace": "http://www.opengis.net/def/nil/OGC/0/unknown" + }, + "name": [ + { + "value": "Katastropheneinsatz in Pechgraben", + "codespace": "http://www.opengis.net/def/nil/OGC/0/unknown" + } + ], + "sampledFeature": [ + "http://www.52north.org/test/featureOfInterest/world" + ], + "geometry": { + "type": "Point", + "coordinates": [ + 14.54621, + 47.92861 + ], + "crs": { + "type": "name", + "properties": { + "name": "EPSG:4326" + } + } + } + }, + "phenomenonTime": "2019-11-19T17:45:15+00:00", + "resultTime": "2019-11-19T17:45:15+00:00", + "result": { + "uom": "m", + "value": 0.28 + } + } +} + + + + + + + + + camera1 + + + + + + 2021-11-19T17:45:15.000+00:00 + + + + + + + + + pechgraben + Katastropheneinsatz in Pechgraben + + + + + 14.54621 47.92861 + + + + + + + + https://www.flickr.com/photos/username/55555555/ + + + + + + + + diff --git a/insert_sensor/istSOS_insert.xml b/insert_sensor/istSOS_insert.xml new file mode 100644 index 0000000..d33e214 --- /dev/null +++ b/insert_sensor/istSOS_insert.xml @@ -0,0 +1,84 @@ + + + xxxxxxxxxxxxxxxxxxxxxxxxxxx + + + + + 2014-06-03T15:08:00Z + 2014-06-03T15:48:00Z + + + + + + + + + + + + + + + + 5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2014-06-03T14:10:00+0200,0.000000,200,20.000000,200@ + 2014-06-03T14:20:00+0200,0.000000,200,20.100000,200@ + 2014-06-03T14:30:00+0200,0.000000,200,20.200000,200@ + 2014-06-03T14:40:00+0200,0.000000,200,20.500000,200@ + 2014-06-03T14:50:00+0200,0.000000,200,20.500000,200@ + 2014-06-03T15:00:00+0200,0.000000,200,20.400000,200@ + 2014-06-03T15:10:00+0200,0.000000,200,20.400000,200@ + 2014-06-03T15:20:00+0200,0.100000,200,19.600000,200@ + 2014-06-03T15:30:00+0200,0.100000,200,19.100000,200@ + 2014-06-03T15:40:00+0200,0.000000,200,19.000000,200@ + 2014-06-03T15:50:00+0200,0.000000,200,20.600000,200 + + + + + \ No newline at end of file diff --git a/pechgraben_images/import_images.py b/pechgraben_images/import_images.py index 5b3f6e8..767f2f0 100644 --- a/pechgraben_images/import_images.py +++ b/pechgraben_images/import_images.py @@ -1,47 +1,52 @@ +''' +Sqlalchemy version: 1.2.15 +Python version: 3.7 +''' + import os -from datetime import datetime, date, timedelta +from datetime import datetime from exif import Image + def main(): - folder_path = 'C:/Users/arno/Documents/Fotos' + ''' main method ''' + folder_path = 'C:/Users/kaiarn/Documents/Fotos' # img_filename = '_DSC9548.JPG' # img_path = f'{folder_path}/{img_filename}' - + # Get the list of image files in the directory that exifread supports directory = os.listdir(folder_path) - + for files in directory: - if files.endswith (('jpg','JPG','png','PNG','tiff','TIFF')): + if files.endswith(('jpg', 'JPG', 'png', 'PNG', 'tiff', 'TIFF')): file_path = os.path.join(folder_path, files) - print (file_path) + # print(file_path) img_file = open(file_path, 'rb') - img: Image = Image(img_file) + img: Image = Image(img_file) if img.has_exif: info = f" has the EXIF {img.exif_version}" else: - info = "does not contain any EXIF information" + info = "does not contain any EXIF information" print(f"Image {img_file.name}: {info}") - + # Original datetime that image was taken (photographed) # print(f'DateTime (Original): {img.get("datetime_original")}') datetime_original = img.get("datetime_original") # print(datetime_original) # Grab the date - date_obj = datetime.strptime(datetime_original, '%Y:%m:%d %H:%M:%S') - # print(date_obj) - + date_obj = datetime.strptime( + datetime_original, '%Y:%m:%d %H:%M:%S') + print(date_obj) + # print(f"Longitude: {img.get('gps_longitude')} {img.get('gps_longitude_ref')}\n") - # with open(img_path, 'rb') as img_file: - # img = Image(img_file) + # img = Image(img_file) # if img.has_exif: # info = f" has the EXIF {img.exif_version}" # else: # info = "does not contain any EXIF information" # print(f"Image {img_file.name}: {info}") - - - + # print(img.list_all()) # print(img.has_exif) # # Make of device which captured image: NIKON CORPORATION @@ -50,7 +55,7 @@ def main(): # # Model of device: NIKON D7000 # print(f'Model: {img.get("model")}') - # # Software involved in uploading and digitizing image: Ver.1.04 + # # Software involved in uploading and digitizing image: Ver.1.04 # print(f'Software: {img.get("software")}') # # Name of photographer who took the image: not defined @@ -61,14 +66,13 @@ def main(): # # Details of flash function # print(f'Flash Details: {img.get("flash")}') - + # print(f"Coordinates - Image") # print("---------------------") # print(f"Latitude: {img.copyright} {img.get('gps_latitude_ref')}") # print(f"Longitude: {img.get('gps_longitude')} {img.get('gps_longitude_ref')}\n") - if __name__ == "__main__": # load_dotenv(find_dotenv()) # print('sensors: {}'.format(os.environ.get( # 'GLASFASER_GSCHLIEFGRABEN_SENSORS', []))) - main() \ No newline at end of file + main()