{"id":17972359,"url":"https://github.com/opengeo-tech/geopicker","last_synced_at":"2025-03-25T12:32:59.622Z","repository":{"id":19060324,"uuid":"22286849","full_name":"opengeo-tech/GeoPicker","owner":"opengeo-tech","description":"Geospatial data picker via fast Api Rest interface, not only another simple elevation service.","archived":false,"fork":false,"pushed_at":"2023-10-15T18:12:34.000Z","size":14484,"stargazers_count":42,"open_issues_count":16,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-20T07:13:29.515Z","etag":null,"topics":["altitude-api","altitude-measurements","api","digital-terrain-model","elevation","elevation-api","elevation-profile","fastify","gdal","gdal-node","geojson","geopicker","geospatial","gis","javascript","nodejs","rest-api","slope-calculation"],"latest_commit_sha":null,"homepage":"https://opengeo.tech/geopicker","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opengeo-tech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2014-07-26T13:12:31.000Z","updated_at":"2025-02-26T04:54:37.000Z","dependencies_parsed_at":"2023-12-21T05:36:02.161Z","dependency_job_id":"c3451a89-8772-444e-ad7e-90af1d9e486b","html_url":"https://github.com/opengeo-tech/GeoPicker","commit_stats":{"total_commits":516,"total_committers":4,"mean_commits":129.0,"dds":"0.025193798449612448","last_synced_commit":"3d3d3a965949f007f70114e1af72107ac38726a7"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opengeo-tech%2FGeoPicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opengeo-tech%2FGeoPicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opengeo-tech%2FGeoPicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opengeo-tech%2FGeoPicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opengeo-tech","download_url":"https://codeload.github.com/opengeo-tech/GeoPicker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245462945,"owners_count":20619583,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["altitude-api","altitude-measurements","api","digital-terrain-model","elevation","elevation-api","elevation-profile","fastify","gdal","gdal-node","geojson","geopicker","geospatial","gis","javascript","nodejs","rest-api","slope-calculation"],"created_at":"2024-10-29T16:13:14.259Z","updated_at":"2025-03-25T12:32:57.324Z","avatar_url":"https://github.com/opengeo-tech.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"GeoPicker\n==========\n\n![geopicker](docs/cover_600.png)\n\nGeospatial dataset picker via fast Api Rest interface written in [NodeJs for GDAL](https://github.com/mmomtchev/node-gdal-async) bindings and [Fastify](https://www.fastify.io/)\n\n- [Online Demo Map](https://opengeo.tech/geopicker)\n\n- [Swagger API](https://opengeo.tech/geopicker/docs)\n\n- [Article about this project](https://stefcud.medium.com/geopicker-bf4c4321c9ec)\n\n## Scope\n\nIt is basically an advanced **elevation service** and Geopicker has been specially designed to offer the widest range of formats and methods of data requests that is possible, to adapt to any context of use by the client.\nEach endpoint and the parameters it accepts have been designed on the basis of the functioning of already existing services, gathering a complete and coherent collection of APIs.\nAt present the index.html page contains a large implementation of browser side requests using LeafletJs as basemap and jQuery.\n\n## Features\n- **Large API Rest**: ergonomic endpoints suitable for any type of use case\n- **Validation**: full validation of endpoint and parameters via **JSON-Schema** which allows output optimization\n- **Configuration**: friendly configs and to help devs in many deployment contexts\n- **Formats**: support for different geospatial input and output formats\n- **Compression**: configurable output compression if client accept encoding: deflate,gzip\n\nand includes some other additional functions:\n\n- **Densify**: add more interpolated points in input coordinates, this improves the display on an elevation graph, adding intermediate positions at a minimum fixed distance.\n- **Simplify**: unlike densify it removes points that are too close together from coordinates.\n- **Precision**: alter the coordinates precision digits to lossily reduce the size of a geometry.\n- **Height**: add the vertical distance from the ground, if input has elevation add a fourth coordinate with this value.\n- **Metadata**: get on the fly metadata informations for a geometry (ex. length, direction, bbox, centroid, middlepoint)\n\n## API Rest endpoints\n\nThe [API](https://opengeo.tech/geopicker/docs) is work in progress.\nThis basic structure can be extended starting from the environment variable `PREFIX` which by default `/`\n\n(✔️ Work ❌ TODO 🚧 Work in Progress)\n\n|Status|Method| Path                 | Return | Description |\n|------|------|----------------------|--------|-------------|\n|  ✔️  | GET  | /                    | html   | default demo map page if enabled by env var `DEMO_PAGE=true` |\n|  ✔️  | GET  | /status              | object | service status, versions, datasets |\n|  ✔️  | GET  | /datasets            | array  | list available datasets and their attributes |\n|  ✔️  | GET  | /datasets/:datasetId | object | search dataset by id |\n|  ✔️  | GET  | /datasets/:lon/:lat  | array  | search dataset contains `lon`,`lat` |\n|  ✔️  | GET  | /:datasetId          | object | show attributes of a certain dataset by id |\n|     |      |                      |        |             |\n|  ✔️  | GET  | /:datasetId/:lon/:lat  | array  | get single location value of dataset, densify not supported|\n|  ✔️  | GET  | /:datasetId/:locations | array  | locations is a string (format: `lon,lat|lon,lat|lon,lat`), densify not supported |\n|     |      |                      |        |             |\n|  ✔️  | POST | /:datasetId/lonlat   | arrays | accept array or object in body |\n|  ✔️  | POST | /:datasetId/locations| arrays | accept array or object of locations in body (format is `[[lon,lat],[lon,lat],[lon,lat]]`) |\n|  ✔️  | POST | /:datasetId/geometry | object | geojson Point or LineString in body (support feature/geometry/f.collection)|\n|     |      |                      |        |             |\n|  ✔️  | GET  | /metadata/:locations | object | return info about direction, length, centroid, middlepoint of locations |\n|  ✔️  | POST | /metadata/geometry   | object | return info about direction, length, centroid, middlepoint of geometry |\n\n### Global Parameters\n\n|Status|Parameter | Default  | Description |\n|------|----------|----------|-------------|\n|  ✔️   | precision| `input`  | rounded to digits decimal precision |\n|  ✔️   | format   | `input`  | output format conversion |\n|  ✔️   | densify  | `input`  | enable densification of points in the result |\n|  ✔️   | simplify | `input`  | enable simplication geometry of the result |\n|  ❌  | height   | false    | add vertical distance from the ground(only input has elevation) |\n\nSome behaviors to know about parameters are that:\n\n- `precision` and `densify` parameters is only supported by endpoints and formats that return coordinates\n- `datasetId` can have the value `default` to referring the main dataset defined in config\n- from version v1.6.1 `/\u003cdatasetId\u003e/...` is the same of `/datasets/\u003cdatasetId\u003e/...` `/datasets/` is implicit.\n\n### Formats\n\nIf the `format` parameter is not specified the default behavior is to output the same format as the input\n\n- **input** format can be specified by `Content-type:` header in request\n- **output** format can be specified by `format` parameter\n\nthe support for various input and output formats is summarized in the table\n\n| Value     | In |Out | Description |\n|-----------|----|----|-------------|\n| `input`   | ✔️ | ✔️ | means the same format as the input data |\n| `array`   | ✔️ | 🚧 | each location is `Array` and a Z dimension as value `[lon,lat,val]` |\n| `json`    | ✔️ | 🚧 | each location is `Object` having `lon`,`lat` and `val` attributes   |\n| `geojson` | ✔️ | 🚧 | standard GeoJSON objects `Feature`, `Geometry` with a Z dimension in `coordinates` as value |\n| `polyline`| 🚧 | ✔️ | [Encoded Polyline Algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm) |\n| `gpx`     | 🚧 | ✔️ | GPS eXchange Format is an XML textual format |\n| `csv`     | ❌ | ❌ | Comma-separated values is an textual format  |\n| `kml`     | ❌ | ❌ | Keyhole Markup Language is an XML format for Google Earth|\n\neach endpoint has its own default format, for example endpoint `/dataset/lon/lat` return a simple array of one value.\n\n\n# Usage\n\nRunning by official [Docker image](https://hub.docker.com/r/stefcud/geopicker):\n\n```bash\ndocker run -v \"/$(pwd)/tests/data:/data\" -e DEMO_PAGE=true -p 9090:9090 stefcud/geopicker\n```\n\nRunning from source code in development mode, requirements: _nodejs 16.x_ \u003e and _glibc 2.28_ (_Ubuntu 20.x_ \u003e ):\n\n```bash\nnpm install\ncd server \u0026\u0026 npm install \u0026\u0026 cd -\nnpm run dev\n```\nBrowse the demo page: http://localhost:9090/\n\n## Configuration\n\nFull configuration options can be found in [docs config](./docs/config.md)\n\n## Development\n\nsome useful tools for contributors `npm run \u003cscriptname\u003e`\n\n- `start` run in production mode\n- `dev` run in development mode\n- `docker-up` run in local docker-compose container\n- `bench` run benchmarks\n- `npm publish .` build and publish new docker image\n\n\n# Requests Example\n\nGet single location exchanging a few bytes:\n```bash\n $ curl \"http://localhost:9090/default/11.123/46.123\"\n\n[195]\n```\n\n```bash\n$ curl \"http://localhost:9090/default/11.123/46.123?format=gpx\"\n```\noutput is a waypoint in GPX format:\n\n```xml\n\u003cgpx version=\"1.1\" creator=\"Geopicker\"\u003e\n\u003cmetadata/\u003e\n\u003cwpt lat=\"46.123\" lon=\"11.123\"\u003e\n\u003cname/\u003e\n\u003cdesc/\u003e\n\u003cele\u003e400\u003c/ele\u003e\n\u003c/wpt\u003e\n\u003c/gpx\u003e\n```\n\nPost a json object and receive the same decorated with the result(still works with `longitude`,`latitude`):\n```bash\n$ curl -X POST -d '{\"lon\": 11.123, \"lat\": 46.123\"}' \\\n  -H 'Content-Type: application/json' \\\n  \"http://localhost:9090/elevation/lonlat\"\n\n{\"lon\": 11.123,\"lat\": 46.123,\"val\":195}\n```\n\nGet many stringified locations in one time(designed for not too long LineString):\n```bash\ncurl \"http://localhost:9090/elevation/11.1,46.1|11.2,46.2|11.3,46.3\"\n\n[195,1149,1051]\n```\n\nPost a very long LineString saving bytes:\n```bash\n$ curl -X POST -d '[[10.9998,46.0064],[10.9998,46.0065],[10.9999,46.0066],[11.0000,46.0067]]' \\\n  -H 'Content-Type: application/json' \\\n  \"http://localhost:9090/elevation/locations\"\n\n[[10.9998,46.0064,900],[10.9998,46.0065,898],[10.9999,46.0066,898],[11.0000,46.0067,900]]\n```\n\nPost anyone GeoJSON geometry, the same input geometry is always returned which has a third dimension:\n```bash\n$ curl -X POST -d '{\"type\":\"LineString\",\"coordinates\":[[11.1,46.1],[11.2,46.2],[11.3,46.3]]}' \\\n  -H 'Content-Type: application/json' \\\n  \"http://localhost:9090/elevation/geometry\"\n\n{\"type\":\"LineString\",\"coordinates\":[[11.1,46.1,195],[11.2,46.2,1149],[11.3,46.3,1051]]}\n```\n\nPost a GeoJSON geometry of 2 points and Densify the linestring adding point each 400 meters,\nthis will help you build a less angular elevation graph:\n\n```bash\n$ curl -X POST -d '{\"type\":\"LineString\",\"coordinates\":[[11,46],[11.01,46.01]]}' \\\n  -H 'Content-Type: application/json' \\\n  \"http://localhost:9090/elevation/geometry?densify=400\u0026precision=5\"\n```\n\noutput contains 3 additional interpolated locations with reduced precision digits:\n\n```json\n{\n    \"type\": \"Feature\",\n    \"geometry\": {\n        \"type\": \"LineString\",\n        \"coordinates\": [\n          [11, 46, 897],\n          [11.003, 46.003, 968],\n          [11.006, 46.006, 1029],\n          [11.009, 46.009, 1122],\n          [11.01, 46.01, 1187]\n        ]\n    }\n}\n```\n\nGet the elevation value between two locations every 100 meters\n\n```bash\ncurl \"http://localhost:9090/elevation/11,46|11.01,46.01?densify=100\"\n\n[925,858,909,963,968,1001,1018,997,1025,1062,1064,1102,1115,1163,1187]\n```\n\n## Benchmarks\n\nbenchmarks scripts: `tests/benchmarks.js` using [AutoCannon](https://github.com/mcollina/autocannon)\n\n```bash\ncd tests \u0026\u0026 npm install \u0026\u0026 cd -\nnpm run bench\n```\n\nThe results testing a dataset of 2x2km [geotiff](https://github.com/opengeo-tech/geopicker/blob/master/tests/data/test_4611_dem.tif)\n```\n┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬──────┐\n│ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev   │ Max  │\n├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼──────┤\n│ Latency │ 0 ms │ 0 ms │ 0 ms  │ 1 ms │ 0.02 ms │ 0.16 ms │ 6 ms │\n└─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴──────┘\n┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬─────────┬─────────┐\n│ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev   │ Min     │\n├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤\n│ Req/Sec   │ 18111   │ 18111   │ 22783   │ 23471   │ 22175.28 │ 1473.21 │ 18099   │\n├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤\n│ Bytes/Sec │ 4.02 MB │ 4.02 MB │ 5.05 MB │ 5.21 MB │ 4.92 MB  │ 327 kB  │ 4.01 MB │\n└───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴─────────┴─────────┘\n\nReq/Bytes counts sampled once per second.\n# of samples: 11\n\n244k requests in 11.01s, 54.1 MB read\n```\n\n# Roadmap\n\nfor details see the descriptions in the [Roadmap issues](https://github.com/opengeo-tech/geopicker/labels/Roadmap)\n\n|Status| Goal        |\n|------|-------------|\n|  ✔️  | Swagger Documentation Interface |\n|  🚧  | manage multiple datasets |\n|  🚧  | ES6 modules |\n|  🚧  | extend benchmarks for any endpoints |\n|  ✔️  | enable densify function |\n|  🚧  | enable simply function |\n|  ❌  | unit testing |\n|  ❌  | support vector format in datasets, such as shapefile |\n|  ❌  | limit access by api key |\n|  ❌  | caching responses |\n|  ❌  | interfaces: websocket, jsonrpc |\n|  ❌  | command line interface |\n\n## Copyright\n\nCreated by [Stefano Cudini](https://github.com/stefanocudini) [@zakis](https://twitter.com/zakis)\nDistributed under the [BSD 2-Clause](https://opensource.org/licenses/BSD-2-Clause) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopengeo-tech%2Fgeopicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopengeo-tech%2Fgeopicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopengeo-tech%2Fgeopicker/lists"}