{"id":2377,"date":"2023-12-22T21:09:41","date_gmt":"2023-12-22T21:09:41","guid":{"rendered":"https:\/\/developers.maplink.global\/consulta-de-la-zona-restringida\/"},"modified":"2024-02-23T19:14:19","modified_gmt":"2024-02-23T19:14:19","slug":"consulta-de-la-zona-restringida","status":"publish","type":"post","link":"https:\/\/developers.maplink.global\/es\/consulta-de-la-zona-restringida\/","title":{"rendered":"Consulta de la zona restringida"},"content":{"rendered":"\n<p>Para consultar un \u00e1rea de restricci\u00f3n debe realizar una solicitud <strong>GET<\/strong> al siguiente endpoint:<\/p>\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/api.maplink.global\/restriction\/v1\/restrictionZones\">https:\/\/api.maplink.global\/restriction\/v1\/restrictionZones<\/a> &#8211; <strong>\n  <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">GET<\/mark>\n  <br\/>\n<\/strong>Devolver\u00e1 todas las \u00e1reas de restricci\u00f3n creadas;<br\/><\/li>\n\n\n\n<li><a href=\"https:\/\/api.maplink.global\/restriction\/v1\/restrictionZones\/%7B%7BrestrictionZone%7D%7D\">https:\/\/api.maplink.global\/restriction\/v1\/restrictionZones\/{<strong>{restrictionZone}<\/strong><\/a> } &#8211; <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">GET<\/mark> <br\/><\/strong>Devolver\u00e1 s\u00f3lo el <strong>\u00e1rea de restricci\u00f3n especificada<\/strong>. El t\u00e9rmino<strong> <\/strong><code>{{restrictionZone}}<\/code>  debe sustituirse por el nombre del \u00e1rea de restricci\u00f3n deseada.<\/li>\n<\/ul>\n\n<p>Para consultar el \u00e1rea de restricci\u00f3n creada en el <a href=\"https:\/\/developers.maplink.global\/es\/insertar-una-nueva-area-de-restriccion\/\" data-type=\"post\" data-id=\"1324\">ejemplo<\/a> anterior, realizaremos una petici\u00f3n <strong>GET <\/strong>al endpoint: <a href=\"https:\/\/api.maplink.global\/restriction\/v1\/restrictionZones\/RestrictionZone1\">https:\/\/api.maplink.global\/restriction\/v1\/restrictionZones\/RestrictionZone1<\/a><\/p>\n\n<p>La respuesta devolver\u00e1 toda la informaci\u00f3n relativa al \u00e1rea de restricci\u00f3n deseada. El campo <code>status<\/code> indica si el \u00e1rea de restricci\u00f3n est\u00e1 lista para su uso o si se ha producido alg\u00fan error en su creaci\u00f3n, como un pol\u00edgono incompleto, por ejemplo.<\/p>\n\n<p>Los valores posibles pueden devolverse en <code>status<\/code>:<\/p>\n\n<ul class=\"wp-block-list\">\n<li><code>IN_CALCULATION(\"Calculating roads inside geometries\")<\/code>  &#8211; Esto significa que el \u00e1rea de restricci\u00f3n a\u00fan se est\u00e1 procesando y no est\u00e1 disponible para su uso.<\/li>\n\n\n\n<li><code>CALCULATED(\"Roads inside restriction zone calculated\")<\/code>  &#8211; El \u00e1rea de restricci\u00f3n se ha creado correctamente y ya est\u00e1 disponible para su uso.<\/li>\n\n\n\n<li><code>CALCULATED_WITHOUT_ROADS(\"No road found after calculation inside restriction zone\")<\/code>  &#8211; La zona de restricci\u00f3n se ha creado con \u00e9xito, pero no hay ninguna carretera que la atraviese.<\/li>\n\n\n\n<li><code>CALCULATION_ERROR(\"Error trying to calculate restriction zone: [%s]\")<\/code>  &#8211; Se ha producido un error en la creaci\u00f3n del \u00e1rea de restricci\u00f3n y no est\u00e1 disponible para su uso. El mensaje de error dar\u00e1 m\u00e1s detalles de lo que puede haber ocurrido.<\/li>\n<\/ul>\n\n<p>A continuaci\u00f3n encontrar\u00e1 la respuesta completa:<\/p>\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n    \"name\": \"RestrictionZone1\",\n    \"geometries\": [\n        {\n            \"name\": \"Polygon1\",\n            \"vertices\": [\n                {\n                    \"latitude\": -23.694834,\n                    \"longitude\": -46.777038\n                },\n                {\n                    \"latitude\": -23.694834,\n                    \"longitude\": -46.448822\n                },\n                {\n                    \"latitude\": -23.472064,\n                    \"longitude\": -46.448822\n                },\n                {\n                    \"latitude\": -23.472064,\n                    \"longitude\": -46.777038\n                }\n            ]\n        }\n    ],\n    \"status\": {\n        \"name\": \"CALCULATED\",\n        \"description\": \"Roads inside restriction zone calculated\"\n    }\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Para consultar un \u00e1rea de restricci\u00f3n debe realizar una solicitud GET al siguiente endpoint: Para consultar el \u00e1rea de restricci\u00f3n creada en el ejemplo anterior, realizaremos una petici\u00f3n GET al endpoint: https:\/\/api.maplink.global\/restriction\/v1\/restrictionZones\/RestrictionZone1 La respuesta devolver\u00e1 toda la informaci\u00f3n relativa al \u00e1rea de restricci\u00f3n deseada. El campo status indica si el \u00e1rea de restricci\u00f3n est\u00e1 lista [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[156],"tags":[],"class_list":["post-2377","post","type-post","status-publish","format-standard","hentry","category-restriction-zone-es"],"acf":[],"_links":{"self":[{"href":"https:\/\/developers.maplink.global\/es\/wp-json\/wp\/v2\/posts\/2377","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developers.maplink.global\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developers.maplink.global\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developers.maplink.global\/es\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/developers.maplink.global\/es\/wp-json\/wp\/v2\/comments?post=2377"}],"version-history":[{"count":1,"href":"https:\/\/developers.maplink.global\/es\/wp-json\/wp\/v2\/posts\/2377\/revisions"}],"predecessor-version":[{"id":2378,"href":"https:\/\/developers.maplink.global\/es\/wp-json\/wp\/v2\/posts\/2377\/revisions\/2378"}],"wp:attachment":[{"href":"https:\/\/developers.maplink.global\/es\/wp-json\/wp\/v2\/media?parent=2377"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developers.maplink.global\/es\/wp-json\/wp\/v2\/categories?post=2377"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developers.maplink.global\/es\/wp-json\/wp\/v2\/tags?post=2377"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}