{"__v":1,"_id":"5617c4a6f8c9632100ac74f5","category":{"__v":7,"_id":"54fdad6e660db63700c23b82","pages":["55fbef82af72eb0d0007df93","55fbf623e013770d008fcba8","5617bd3a26e3db230054fba4","5617c4a6f8c9632100ac74f5","561ed6fd0a04340d00d8a0b0","562156adf4e0352100cbf268","562a5c846049f20d0032520b"],"project":"54d0fd1d095c470d00d1646d","version":"54d0fd1e095c470d00d16470","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-03-09T14:25:50.133Z","from_sync":false,"order":2,"slug":"api-reference","title":"API Reference"},"editedParams":true,"editedParams2":true,"project":"54d0fd1d095c470d00d1646d","user":"54db5301eb78f13900cf108b","version":{"__v":20,"_id":"54d0fd1e095c470d00d16470","project":"54d0fd1d095c470d00d1646d","createdAt":"2015-02-03T16:53:50.090Z","releaseDate":"2015-02-03T16:53:50.090Z","categories":["54d0fd1e095c470d00d16471","54d8b5e68934140d00496544","54db6361c6a4d40d0034b8f7","54db638208ea010d00ab1fdd","54db639008ea010d00ab1fde","54db6547c6a4d40d0034b8fd","54db83482092743700ea6ee1","54db84afc6a4d40d0034b93c","54db8805c6a4d40d0034b93f","54db8de9c6a4d40d0034b961","54db931ac6a4d40d0034b96d","54e49219e4365521006fd9ee","54e74fcc652d7c1900cbe737","54e74ffd3c1e111700d05762","54e77e0a523b1b2f00e6f313","54e784affdabe62500fcddcf","54e784fa523b1b2f00e6f319","54e785de8ae8911900cd42c5","54fdad6e660db63700c23b82","54fdff31f7b1202100a25e06"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-10-09T13:44:06.376Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"code":"","language":"text"}]},"results":{"codes":[{"name":"","code":"{\n  \"result\":{\n    \"geometry\":{\n      \"type\":\"Multipolygon\",\n      \"coordinates\":[\n        [\n          [[...],[...], …, [...]]\n        ]\n    \t]\n    }\n    \"attributes\":[\n      {\"cod\": 1, \"desc\": \"emp01\"},\n      {\"cod\": 2, \"desc\": \"emp02\"},\n       …,\n      {\"cod\": n, \"desc\": \"empn\"},\n    ]\n  }\n}","language":"json","status":200}]},"settings":"","auth":"required","params":[{"_id":"562a627b8437010d00c43ca7","ref":"","in":"path","required":true,"desc":"Database name","default":"","type":"string","name":"database_name"},{"_id":"5617c4a6f8c9632100ac74fd","ref":"","in":"path","required":true,"desc":"Collection name.","default":"","type":"string","name":"collection_name"},{"_id":"5617c4a6f8c9632100ac74fc","ref":"","in":"body","required":true,"desc":"Your map key.","default":"","type":"string","name":"map_key"},{"_id":"5617c4a6f8c9632100ac74fb","ref":"","in":"body","required":false,"desc":"Spatial restriction on GeoJSON format. If informed do not inform column and column_values.","default":"","type":"object","name":"geom"},{"_id":"5617c4a6f8c9632100ac74fa","ref":"","in":"body","required":false,"desc":"Column to filter tuples by column_values list as on a IN relational restriction. If informed do not inform a geom.","default":"","type":"string","name":"column"},{"_id":"5617c4a6f8c9632100ac74f9","ref":"","in":"body","required":false,"desc":"List of values for informed column, to filter tuples.","default":"","type":"string","name":"column_values"},{"_id":"5617c4a6f8c9632100ac74f8","ref":"","in":"body","required":false,"desc":"Attributes that will be returned as a list of values for each attributes related to every tuple used on the union. If it is not informed, any attribute will be returned.","default":"","type":"string","name":"attributes"},{"_id":"5617c4a6f8c9632100ac74f7","ref":"","in":"body","required":false,"desc":"Relational filter from ElasticSearch.","default":"","type":"string","name":"q"},{"_id":"5617c4a6f8c9632100ac74f6","ref":"","in":"body","required":false,"desc":"The tolerance distance to apply geometry simplification.","default":"","type":"double","name":"tolerance"}],"url":"/union/:database_name/:collection_name"},"isReference":false,"order":51,"body":"Sample of resquest whith spatial restriction and attribute list.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -k -H \\\"Content-Type: application/json\\\" -XPOST \\\\\\n\\\"https://api.gogeo.io/1.0/union/MY_DATABASE/MY_COLLECTION\\\" -d '\\n{\\n  \\\"mapkey\\\": \\\"MAP-KEY\\\",\\n  \\\"attributes\\\": [\\\"nm_nng\\\",\\\"md_ar_poli\\\",\\\"cd_adminis\\\"],\\n  \\\"q\\\": {\\\"query\\\": {\\\"term\\\": {\\\"nm_nng\\\": \\\"Some interesting thing!\\\"}}}\\n  \\\"geom\\\": {\\n    \\\"type\\\": \\\"Polygon\\\",\\n    \\\"coordinates\\\": [\\n      [\\n        [\\n          -120.9375,\\n          30.600093873550072\\n        ],\\n        [\\n          -120.9375,\\n          47.754097979680026\\n        ],\\n        [\\n          -75.9375,\\n          47.754097979680026\\n        ],\\n        [\\n          -75.9375,\\n          30.600093873550072\\n        ],\\n        [\\n          -120.9375,\\n          30.600093873550072\\n        ]\\n      ]\\n    ]\\n  }\\n}'\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nSample request whit column and column_values filtering and attribute list to return.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -k -H \\\"Content-Type: application/json\\\" -XPOST \\\\\\n\\\"https://api.gogeo.io/1.0/union/MY_DATABASE/MY_COLLECTION\\\" -d '\\n{\\n  \\\"mapkey\\\": \\\"MAP-KEY\\\",\\n  \\\"column\\\": \\\"gid\\\",\\n  \\\"column_values\\\": [9,10],\\n  \\\"attributes\\\": [\\\"nm_nng\\\",\\\"md_ar_poli\\\",\\\"cd_adminis\\\"]\\n}'\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nThe return of union operation should compulsorily contain a geometry (multi-polygon) resulting from the union operation on the geometries of the documents involved in processing, and optionally subject to information of the attributes to be returned, the attribute values required in the request (for the documents involved in the union processing).","excerpt":"","slug":"geometry-union-request","type":"post","title":"Geometry union request"}

postGeometry union request


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

database_name:
required
string
Database name
collection_name:
required
string
Collection name.

Body Params

map_key:
required
string
Your map key.
geom:
object
Spatial restriction on GeoJSON format. If informed do not inform column and column_values.
column:
string
Column to filter tuples by column_values list as on a IN relational restriction. If informed do not inform a geom.
column_values:
string
List of values for informed column, to filter tuples.
attributes:
string
Attributes that will be returned as a list of values for each attributes related to every tuple used on the union. If it is not informed, any attribute will be returned.
q:
string
Relational filter from ElasticSearch.
tolerance:
double
The tolerance distance to apply geometry simplification.

Result Format


Documentation

Sample of resquest whith spatial restriction and attribute list. [block:code] { "codes": [ { "code": "curl -k -H \"Content-Type: application/json\" -XPOST \\\n\"https://api.gogeo.io/1.0/union/MY_DATABASE/MY_COLLECTION\" -d '\n{\n \"mapkey\": \"MAP-KEY\",\n \"attributes\": [\"nm_nng\",\"md_ar_poli\",\"cd_adminis\"],\n \"q\": {\"query\": {\"term\": {\"nm_nng\": \"Some interesting thing!\"}}}\n \"geom\": {\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n -120.9375,\n 30.600093873550072\n ],\n [\n -120.9375,\n 47.754097979680026\n ],\n [\n -75.9375,\n 47.754097979680026\n ],\n [\n -75.9375,\n 30.600093873550072\n ],\n [\n -120.9375,\n 30.600093873550072\n ]\n ]\n ]\n }\n}'", "language": "json" } ] } [/block] Sample request whit column and column_values filtering and attribute list to return. [block:code] { "codes": [ { "code": "curl -k -H \"Content-Type: application/json\" -XPOST \\\n\"https://api.gogeo.io/1.0/union/MY_DATABASE/MY_COLLECTION\" -d '\n{\n \"mapkey\": \"MAP-KEY\",\n \"column\": \"gid\",\n \"column_values\": [9,10],\n \"attributes\": [\"nm_nng\",\"md_ar_poli\",\"cd_adminis\"]\n}'", "language": "json" } ] } [/block] The return of union operation should compulsorily contain a geometry (multi-polygon) resulting from the union operation on the geometries of the documents involved in processing, and optionally subject to information of the attributes to be returned, the attribute values required in the request (for the documents involved in the union processing).

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}