Skip to content

Commit

Permalink
remove option where unused, tidy up a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
felix-schott committed Nov 6, 2023
1 parent f3c7174 commit fd87791
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
8 changes: 1 addition & 7 deletions open_buildings/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def get_buildings(geojson_input, dst, location, source, country_iso, silent, ove
else:
geojson_data = json.load(click.get_text_stream('stdin'))

download_buildings(geojson_data, generate_sql=False, dst=dst, silent=silent, overwrite=overwrite, verbose=verbose, country_iso=country_iso)
download_buildings(geojson_data, source=source, generate_sql=False, dst=dst, silent=silent, overwrite=overwrite, verbose=verbose, country_iso=country_iso)

@google.command('benchmark')
@click.argument('input_path', type=click.Path(exists=True))
Expand Down Expand Up @@ -173,12 +173,6 @@ def benchmark(
@click.option(
'--overwrite', is_flag=True, help="Whether to overwrite any existing output files."
)
@click.option(
'--geocode',
type=str,
is_flag=True,
help="Use city or region name instead of geojson"
)
@click.option(
'--process',
type=click.Choice(['duckdb', 'pandas', 'ogr']),
Expand Down
13 changes: 4 additions & 9 deletions open_buildings/download_buildings.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ def geojson_to_wkt(data: dict) -> str:
geometry = shape(data['geometry'])
return geometry.wkt

def geocode(data: str):
location = osmnx.geocode_to_gdf(data)
wkt = box(*location.total_bounds)
g2 = geojson.Feature(geometry=wkt)
return (g2)

def quadkey_to_geojson(quadkey: str) -> dict:
# Convert the quadkey to tile coordinates
tile = mercantile.quadkey_to_tile(quadkey)
Expand Down Expand Up @@ -94,10 +88,11 @@ def quadkey(geojson_input):
def WKT(geojson_input):
"""Convert GeoJSON to Well Known Text."""
if geojson_input:
result = json.load(geojson_input)
geojson_data = json.load(geojson_input)
else:
geojson_data = json.load(click.get_text_stream('stdin'))
result = geojson_to_wkt(geojson_data)
geojson_data = json.load(click.get_text_stream('stdin'))

result = geojson_to_wkt(geojson_data)
click.echo(result)


Expand Down

0 comments on commit fd87791

Please sign in to comment.