You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Función Consulta_RCCOOR independiente que corrige el error
# corregido del código fuente original
import requests
import xmltodict
def Consulta_RCCOORv2(srs, x, y):
"""A partir de unas coordenadas se obtiene la referencia catastral.
A partir de unas coordenadas (X e Y) y su sistema de referencia se
obtiene la referencia catastral de la parcela localizada en ese punto
así como el domicilio (municipio, calle y número o polígono, parcela y
municipio).
:param str,int: Sistema de coordenadas. "EPSG:25830" = proyectado ETRS89 UTM30N, "EPSG:4326" = Geográfico WGS84
:param str,int,float: Coordenada X
:param str,int,float: Coordenada Y
:return: Retorna un diccionario con los datos de la consulta
:rtype: dict
"""
params = {
"Coordenada_X": x, # cambios realizados
"Coordenada_Y": y}
if type(srs) == str:
params["SRS"] = srs
else:
params["SRS"] = "EPSG:"+str(srs)
#url = base_url + "/OVCCoordenadas.asmx?op=Consulta_RCCOOR" # el error está aquí
base_url = "http://ovc.catastro.meh.es/ovcservweb/OVCSWLocalizacionRC"
url = base_url + "/OVCCoordenadas.asmx/Consulta_RCCOOR" # y se corrige aquí
response = requests.get(url, params=params)
return xmltodict.parse(response.content, process_namespaces=False, xml_attribs=False)
pycatstro v.0.1.3, Python 3.4:
output:
The text was updated successfully, but these errors were encountered: