File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -509,11 +509,15 @@ def validate_source(features):
509509
510510 click .echo ("✔ valid" )
511511
512+
512513def validate_source_id (ctx , param , value ):
513- if re .match (' ^[a-zA-Z0-9-_]{1,32}$' , value ):
514+ if re .match (" ^[a-zA-Z0-9-_]{1,32}$" , value ):
514515 return value
515516 else :
516- raise click .BadParameter ('Tileset Source ID is invalid. Must be no more than 32 characters and only include "-", "_", and alphanumeric characters.' )
517+ raise click .BadParameter (
518+ 'Tileset Source ID is invalid. Must be no more than 32 characters and only include "-", "_", and alphanumeric characters.'
519+ )
520+
517521
518522@cli .command ("upload-source" )
519523@click .argument ("username" , required = True , type = str )
Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ def _tile2lng(tile_x, zoom):
157157 -------
158158 longitude
159159 """
160- return ((tile_x / 2 ** zoom ) * 360.0 ) - 180.0
160+ return ((tile_x / 2 ** zoom ) * 360.0 ) - 180.0
161161
162162
163163def _tile2lat (tile_y , zoom ):
@@ -174,7 +174,7 @@ def _tile2lat(tile_y, zoom):
174174 -------
175175 latitude
176176 """
177- n = np .pi - 2 * np .pi * tile_y / 2 ** zoom
177+ n = np .pi - 2 * np .pi * tile_y / 2 ** zoom
178178 return (180.0 / np .pi ) * np .arctan (0.5 * (np .exp (n ) - np .exp (- n )))
179179
180180
@@ -198,7 +198,7 @@ def _calculate_tile_area(tile):
198198 bottom = np .deg2rad (_tile2lat (tile [:, 1 ] + 1 , tile [:, 2 ]))
199199 return (
200200 (np .pi / np .deg2rad (180 ))
201- * EARTH_RADIUS ** 2
201+ * EARTH_RADIUS ** 2
202202 * np .abs (np .sin (top ) - np .sin (bottom ))
203203 * np .abs (left - right )
204204 )
You can’t perform that action at this time.
0 commit comments