This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Base | |
server { | |
list 8080: | |
server_name localhost; | |
location / { | |
proxdy_pass $BACKEND_URL; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_cache_bypass $http_upgrade; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.9" | |
services: | |
postgis: | |
image: "kartoza/postgis:14-3.3--v2022.08.30" # postgresql 14.0, postgis 3.3 | |
environment: | |
- "POSTGRES_USER=fotoshi" | |
- "POSTGRES_PASS=chris" | |
- "POSTGRES_DBNAME=gis" | |
- "POSTGRES_INITDB_WALDIR=/opt/postgres/pg_wal" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plot_images(all_images) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import requests | |
from PIL import Image | |
from urllib.request import urlopen | |
all_images = [] | |
os.makedirs('img') | |
for iter in image_id_list: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib | |
import numpy | |
import typing | |
matplotlib.pyplot.tick_params( | |
axis='x', # changes apply to the x-axis | |
which='both', # both major and minor ticks are affected | |
bottom=False, # ticks along the bottom edge are off | |
top=False, # ticks along the top edge are off | |
labelbottom=False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Lets first save all of the data as a JSON | |
with open('image_id_list.json', 'w') as file_pointer: | |
json.dump(image_id_list, file_pointer, indent=4) | |
# For each collection item, lets remove the property data to get a smaller JSON version | |
for iter in image_id_list: | |
del iter['property_data'] | |
# Lets save this version of the data as a JSON to recollect at any point in time | |
with open('image_id_list_without_property.json', 'w') as file_pointer: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from mapillary.models.client import Client | |
from mapillary.config.api.entities import Entities | |
# Useful list of fields we can use | |
# For a complete list of possible values, please visit the below link | |
# https://mapillary.github.io/mapillary-python-sdk/docs/mapillary.config.api/mapillary.config.api.entities#static-get_imageimage_id-str-fields-list | |
fields_to_pass_for_the_image: list = ['thumb_2048_url', 'merge_cc', 'mesh', | |
'sfm_cluster', 'atomic_scale', | |
'camera_parameters', 'camera_type', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import the geojson model from mapillary | |
from mapillary.models.geojson import GeoJSON | |
image_id_list: list = [] | |
# Iterating over the rows of the df | |
for index, row in enumerate(safegraph_df.iterrows()): | |
# An empty dictionary that will hold our data as we go along | |
coordinates_to_image_id_dict: dict = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!pip install mapillary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data = mly.get_image_looking_at( | |
looker={ | |
"lng": 21.3967128843, | |
"lat": 41.9946319051, | |
}, | |
at={ | |
"lng": 21.3967117108, | |
"lat": 41.9946228527, | |
}, | |
radius=1000000, |
NewerOlder