Skip to content

Commit 285153f

Browse files
authored
Merge pull request #144 from mapillary/Rubix982/ModificationFor__get_image_looking_at
Modification For `get_image_looking_at`
2 parents 4965876 + 2c65c43 commit 285153f

28 files changed

+3704
-2637
lines changed

.github/workflows/documentation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v1
1515
- uses: actions/setup-node@v1
1616
with:
17-
node-version: '12.x'
17+
node-version: '14.x'
1818
- name: Test Build
1919
run: |
2020
cd docs
@@ -33,7 +33,7 @@ jobs:
3333
- uses: actions/checkout@v1
3434
- uses: actions/setup-node@v1
3535
with:
36-
node-version: '12.x'
36+
node-version: '14.x'
3737
- uses: webfactory/[email protected]
3838
with:
3939
ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }}

.github/workflows/pytest.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ jobs:
2222
python-version: 3.9
2323
- name: Install dependencies
2424
run: |
25-
python -m pip install --upgrade pip
26-
pip install flake8 black pytest requests mercantile vt2geojson mapillary pandas
25+
python -m pip install --upgrade pip && make setup-dev && pip install flake8 black pytest requests mercantile vt2geojson pandas
2726
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
27+
- name: Locally install branch's mapillary
28+
run: |
29+
make build && pip3 install -e .
2830
- name: Formatting with black
2931
run: |
3032
make format
@@ -33,4 +35,4 @@ jobs:
3335
make lint
3436
- name: Test with pytest
3537
run: |
36-
make test
38+
make test

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
{
2-
"python.formatting.provider": "black"
2+
"python.formatting.provider": "black",
3+
"python.testing.unittestEnabled": false,
4+
"python.testing.pytestEnabled": true
35
}

Pipfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ python-dotenv = "==0.19.0"
4343
shapely = "==1.8.1"
4444
turfpy = "==0.0.7"
4545
geojson = "==2.5.0"
46-
pip = "==21.2.4"
4746

4847
[dev-packages]
4948
wheel = "==0.37.0"
@@ -70,7 +69,7 @@ regex = "==2021.4.4"
7069
toml = "==0.10.2"
7170
twine = "==1.13.0"
7271
check-manifest = "==0.46"
73-
sphinx = "==4.1.2"
72+
sphinx = "==5.1.1"
7473
sphinx-markdown-builder = "==0.5.4"
7574
sphinx-autodoc-typehints = "==1.12.0"
7675
python-dateutil = "*"

Pipfile.lock

Lines changed: 140 additions & 156 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/docs/Table Of Contents.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ sidebar position: 1
33
---
44

55
<!-- src documentation master file, created by
6-
sphinx-quickstart on Fri Sep 17 21:39:39 2021.
6+
sphinx-quickstart on Mon Aug 8 18:09:39 2022.
77
You can adapt this file completely to your liking, but it should at least
88
contain the root `toctree` directive. -->
99
# Welcome to the Mapillary’s Python SDK documentation!

docs/docs/mapillary.controller/mapillary.controller.detection.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ For more information, please check out [https://www.mapillary.com/developer/api-
1717
* License: MIT LICENSE
1818

1919

20-
### mapillary.controller.detection.get_image_detections_controller(image_id: Union[str, int], fields: Optional[list] = None)
20+
### mapillary.controller.detection.get_image_detections_controller(image_id: Union[str, int], fields: list = [])
2121
Get image detections with given (image) key
2222

2323

@@ -44,7 +44,7 @@ Get image detections with given (image) key
4444

4545

4646

47-
### mapillary.controller.detection.get_map_feature_detections_controller(map_feature_id: Union[str, int], fields: Optional[list] = None)
47+
### mapillary.controller.detection.get_map_feature_detections_controller(map_feature_id: Union[str, int], fields: list = [])
4848
Get image detections with given (map feature) key
4949

5050

docs/docs/mapillary.controller/mapillary.controller.image.md

Lines changed: 55 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ the list of fields/properties to be returned
160160

161161

162162

163-
### mapillary.controller.image.get_image_looking_at_controller(looker: dict, at: dict, filters: dict)
164-
Extracting the GeoJSON for the image data from a ‘looker’ and ‘at’ coordinate view
163+
### mapillary.controller.image.get_image_looking_at_controller(at: Union[dict, Coordinates, list], filters: dict)
164+
Checks if the image with coordinates ‘at’ is looked with the given filters.
165165

166166

167167
* **Parameters**
@@ -170,7 +170,7 @@ Extracting the GeoJSON for the image data from a ‘looker’ and ‘at’ coord
170170
* **filters** (*dict*) – Filters to pass the data through
171171

172172

173-
* **looker** (*dict*) – The dictionary of coordinates of the position of the looking from
173+
* **at** (*dict*) – The dict of coordinates of the position of the looking at
174174
coordinates. Format:
175175

176176
```
@@ -182,16 +182,7 @@ Extracting the GeoJSON for the image data from a ‘looker’ and ‘at’ coord
182182
183183
184184
185-
* **at** (*dict*) – The dict of coordinates of the position of the looking at
186-
coordinates. Format:
187-
188-
```
189-
>>> {
190-
>>> 'lng': 'longitude',
191-
>>> 'lat': 'latitude'
192-
>>> }
193-
```
194-
185+
* **filters.zoom** (*int*) – The zoom level of the tiles to obtain, defaults to 14
195186
196187
197188
* **filters.min_captured_at** (*str*) – The minimum date to filter till
@@ -328,6 +319,57 @@ Reference,
328319
* [https://www.mapillary.com/developer/api-documentation/#coverage-tiles](https://www.mapillary.com/developer/api-documentation/#coverage-tiles)
329320
330321
322+
### mapillary.controller.image.is_image_being_looked_at_controller(at: Union[dict, Coordinates, list], filters: dict)
323+
Checks if the image with coordinates ‘at’ is looked with the given filters.
324+
325+
326+
* **Parameters**
327+
328+
329+
* **at** (*Union**[**dict**, **mapillary.models.geojson.Coordinates**, **list**]*) – The dict of coordinates of the position of the looking at coordinates. Format:
330+
331+
```
332+
>>> at_dict = {
333+
... 'lng': 'longitude',
334+
... 'lat': 'latitude'
335+
... }
336+
>>> at_list = [12.954940544167, 48.0537894275]
337+
>>> from mapillary.models.geojson import Coordinates
338+
>>> at_coord: Coordinates = Coordinates(lng=12.954940544167, lat=48.0537894275)
339+
```
340+
341+
342+
* **filters.zoom** – The zoom level of the tiles to obtain, defaults to 14
343+
344+
345+
* **filters.min_captured_at** (*str*) – The minimum date to filter till
346+
347+
348+
* **filters.max_captured_at** (*str*) – The maximum date to filter upto
349+
350+
351+
* **filters.radius** (*float*) – The radius that the geometry points will lie in
352+
353+
354+
* **filters.image_type** (*str*) – Either ‘pano’, ‘flat’ or ‘all’
355+
356+
357+
* **filters.organization_id** (*str*) – The organization to retrieve the data for
358+
359+
360+
361+
* **Returns**
362+
363+
True if the image is looked at by the given looker and at coordinates, False otherwise
364+
365+
366+
367+
* **Return type**
368+
369+
bool
370+
371+
372+
331373
### mapillary.controller.image.shape_features_controller(shape, is_image: bool = True, filters: Optional[dict] = None)
332374
For extracting images that lie within a shape, merging the results of the found features
333375
into a single object - by merging all the features into one list in a feature collection.

docs/docs/mapillary.models.api/mapillary.models.api.entities.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Usage:
4343
```
4444

4545

46-
#### fetch_detections(identity: int, id_type: bool = True, fields: Optional[list] = None)
46+
#### fetch_detections(identity: int, id_type: bool = True, fields: list = [])
4747
Fetches detections depending on the id, detections for either map_features or
4848
images and the fields provided
4949

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
---
2+
sidebar position: 3
3+
---
4+
5+
6+
### mapillary.models.api.entities
7+
8+
This module contains the Adapter design for the Entities API of Mapillary API v4.
9+
10+
For more information, please check out [https://www.mapillary.com/developer/api-documentation/](https://www.mapillary.com/developer/api-documentation/).
11+
12+
13+
* Copyright: (c) 2021 Facebook
14+
15+
16+
* License: MIT LICENSE
17+
18+
19+
### class mapillary.models.api.general.GeneralAdapter(\*args: object)
20+
Bases: `object`
21+
22+
General adaptor for using the API calls defined for the general module
23+
(mapillary.config.api.general)
24+
25+
The GeneralAdaptor provides functions for getting preprocessed data from the API, through the
26+
API calls mentioned in the previously mentioned config.
27+
28+
It performs parsing, property handling, easier logic for extracing information, focusing on
29+
adding a layer of abstraction by removing details of using mercantile, ast, et al, to
30+
focus on the inputs and outputs of functions
31+
32+
Usage:
33+
34+
```
35+
>>> import mapillary
36+
```
37+
38+
39+
#### fetch_computed_image_tiles(zoom: int, longitude: float, latitude: float, layer: Literal['overview', 'sequence', 'image', 'map_feature', 'traffic_sign'] = 'image')
40+
Get the image type for a given image.
41+
42+
43+
* **Parameters**
44+
45+
46+
* **zoom** (*int*) – The zoom to get the image type for.
47+
48+
49+
* **longitude** (*float*) – The longitude of the image.
50+
51+
52+
* **latitude** (*float*) – The latitude of the image.
53+
54+
55+
56+
* **Returns**
57+
58+
A dictionary containing the image type for the image.
59+
60+
61+
62+
* **Return type**
63+
64+
dict
65+
66+
67+
68+
#### fetch_image_tiles(zoom: int, longitude: float, latitude: float, layer: Literal['overview', 'sequence', 'image', 'map_feature', 'traffic_sign'] = 'image')
69+
Get the tiles for a given image.
70+
71+
72+
* **Parameters**
73+
74+
75+
* **zoom** (*int*) – Zoom level of the image.
76+
77+
78+
* **longitude** (*float*) – Longitude of the image
79+
80+
81+
* **latitude** (*float*) – Latitude of the image
82+
83+
84+
85+
* **Returns**
86+
87+
A dictionary containing the tiles for the image.
88+
89+
90+
91+
* **Return type**
92+
93+
dict
94+
95+
96+
97+
#### fetch_map_features_tiles(zoom: int, longitude: float, latitude: float, layer: Literal['overview', 'sequence', 'image', 'map_feature', 'traffic_sign'] = 'image')
98+
Get the map features for a given coordinate set
99+
100+
101+
* **Parameters**
102+
103+
104+
* **zoom** (*int*) – The zoom value to get the map features for
105+
106+
107+
* **longitude** (*float*) – The longitude of the image
108+
109+
110+
* **latitude** (*float*) – The latitude of the image
111+
112+
113+
114+
* **Returns**
115+
116+
A dictionary containing the map features for the image.
117+
118+
119+
120+
* **Return type**
121+
122+
dict
123+
124+
125+
126+
#### fetch_map_features_traffic_tiles(zoom: int, longitude: float, latitude: float, layer: str)
127+
Get the map feature traffic for a given coordinate set
128+
129+
130+
* **Parameters**
131+
132+
133+
* **zoom** (*int*) – The zoom value to get the map features for
134+
135+
136+
* **longitude** (*float*) – The longitude of the image
137+
138+
139+
* **latitude** (*float*) – The latitude of the image
140+
141+
142+
143+
* **Returns**
144+
145+
A dictionary containing the map features for the image.
146+
147+
148+
149+
* **Return type**
150+
151+
dict
152+

0 commit comments

Comments
 (0)