Skip to content

Commit

Permalink
fix: Fixed error when using search function (Not Found error)
Browse files Browse the repository at this point in the history
  • Loading branch information
JCruiz15 committed Oct 30, 2024
1 parent b2430b5 commit e037243
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sigpac_tools/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ def search(data: dict) -> dict:
if parc:
logger.info("Searching for the parcel specified")
response = requests.get(
f"{BASE_URL}/fega/ServiciosVisorSigpac/query/recintos/{prov}/{muni}/0/0/{polg}/{parc}.geojson"
f"{BASE_URL}/fega/ServiciosVisorSigpac/query/recintos/{prov}/{muni}/0/0/{polg}/{parc}"
)
geojson = response.json()
return geojson
else:
logger.info(f"Searching for the parcels of the polygon {polg}")
response = requests.get(
f"{BASE_URL}/fega/ServiciosVisorSigpac/query/parcelas/{prov}/{muni}/0/0/{polg}.geojson"
f"{BASE_URL}/fega/ServiciosVisorSigpac/query/parcelas/{prov}/{muni}/0/0/{polg}"
)
geojson = response.json()
return geojson
Expand All @@ -64,21 +64,21 @@ def search(data: dict) -> dict:
f"Searching for the polygons of the municipality {muni}"
)
response = requests.get(
f"{BASE_URL}/fega/ServiciosVisorSigpac/query/poligonos/{prov}/{muni}/0/0.geojson"
f"{BASE_URL}/fega/ServiciosVisorSigpac/query/poligonos/{prov}/{muni}/0/0"
)
geojson = response.json()
return geojson
else:
logger.info(f"Searching for the municipalities of the province {prov}")
response = requests.get(
f"{BASE_URL}/fega/ServiciosVisorSigpac/query/municipios/{prov}.geojson"
f"{BASE_URL}/fega/ServiciosVisorSigpac/query/municipios/{prov}"
)
geojson = response.json()
return geojson
else:
logger.info(f"Searching for the provinces of the community {comm}")
response = requests.get(
f"{BASE_URL}/fega/ServiciosVisorSigpac/query/provincias/{comm}.geojson"
f"{BASE_URL}/fega/ServiciosVisorSigpac/query/provincias/{comm}"
)
geojson = response.json()
return geojson
Expand Down

0 comments on commit e037243

Please sign in to comment.