{"id":18871360,"url":"https://github.com/sfomuseum/go-sfomuseum-mapshaper","last_synced_at":"2026-01-28T08:03:54.880Z","repository":{"id":57597101,"uuid":"333245165","full_name":"sfomuseum/go-sfomuseum-mapshaper","owner":"sfomuseum","description":"Go package to provide an HTTP endpoint to expose the mapserver-cli tool.","archived":false,"fork":false,"pushed_at":"2024-06-14T23:00:56.000Z","size":383,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T22:44:54.542Z","etag":null,"topics":["golang","mapshaper"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sfomuseum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-26T23:26:16.000Z","updated_at":"2024-06-14T23:01:00.000Z","dependencies_parsed_at":"2024-05-16T18:47:58.531Z","dependency_job_id":"44975b68-c67b-4f1c-9e80-3bc5a1f4508a","html_url":"https://github.com/sfomuseum/go-sfomuseum-mapshaper","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sfomuseum%2Fgo-sfomuseum-mapshaper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sfomuseum%2Fgo-sfomuseum-mapshaper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sfomuseum%2Fgo-sfomuseum-mapshaper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sfomuseum%2Fgo-sfomuseum-mapshaper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sfomuseum","download_url":"https://codeload.github.com/sfomuseum/go-sfomuseum-mapshaper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248643047,"owners_count":21138353,"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":["golang","mapshaper"],"created_at":"2024-11-08T05:25:35.965Z","updated_at":"2026-01-28T08:03:49.823Z","avatar_url":"https://github.com/sfomuseum.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-sfomuseum-mapshaper\n\nGo package for interacting with the mapserver-cli tool.\n\n## Documentation\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/sfomuseum/go-sfomuseum-mapshaper.svg)](https://pkg.go.dev/github.com/sfomuseum/go-sfomuseum-mapshaper)\n\nDocumentation is incomplete.\n\n## Tools\n\n### server\n\nA simple HTTP server to expose the mapserver-cli tool. Currently, only the '-points inner' functionality is exposed.\n\n```\n$\u003e ./bin/server -h\nA simple HTTP server to expose the mapserver-cli tool. Currently, only the '-points inner' functionality is exposed.\nUsage:\n\t ./bin/server [options]\n\nValid options are:\n  -allowed-origins string\n    \tA comma-separated list of hosts to allow CORS requests from.\n  -enable-cors\n    \tEnable support for CORS headers\n  -mapshaper-path string\n    \tThe path to your mapshaper binary. (default \"/usr/local/bin/mapshaper\")\n  -server-uri string\n    \tA valid aaronland/go-http-server URI. (default \"http://localhost:8080\")\n  -uploads-max-bytes int\n    \tThe maximum allowed size (in bytes) for uploads. (default 1048576)\n```\n\n## Docker\n\n```\n$\u003e docker build -t mapshaper-server .\n\n$\u003e docker run -it -p 8080:8080 -e MAPSHAPER_SERVER_URI=http://0.0.0.0:8080 mapshaper-server /usr/local/bin/mapshaper-server\n\n$\u003e curl -s http://localhost:8080/api/innerpoint \\\n\t-d @fixtures/1745882083.geojson \\\n\n| jq '.features[].geometry'\n\n{\n  \"type\": \"Point\",\n  \"coordinates\": [\n    -122.38875600604932,\n    37.61459515528007\n  ]\n}\n```\n\n## AWS\n\n### Lambda\n\nIt is possible to run the `mapshaper-server` tool as an AWS Lambda Function URL.\n\n1. Start by create a container image by running the `docker build -t mapshaper-server .` command.\n2. Upload the container to an AWS ECS repository.\n3. Create a new Lambda function and configure to use the container image you've just uploaded to ECS.\n4. Update the \"Image Configuration\" of your Lambda function and assign the following container override: `/usr/local/bin/mapshaper-server, -server-uri, functionurl://`\n5. Configure your function to a \"Function URL\". The details of whether your function URL requires authentication or not are left to you to decide.\n\nThat's it. You can test your function URL like this (where `{FUNCTION_URL_ID}` and `{AWS_REGION}` should be replace with the relevant values in your specific function URL):\n\n```\n$\u003e curl -s https://{FUNCTION_URL_ID}.lambda-url.{AWS_REGION}.on.aws/api/innerpoint \\\n\t-d @fixtures/1745882083.geojson \\\n\t\n| jq '.features[].geometry'\n\t\n{\n  \"type\": \"Point\",\n  \"coordinates\": [\n    -122.38875600604932,\n    37.61459515528007\n  ]\n}\n```\n\n## See also\n\n* https://github.com/mbloch/mapshaper","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsfomuseum%2Fgo-sfomuseum-mapshaper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsfomuseum%2Fgo-sfomuseum-mapshaper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsfomuseum%2Fgo-sfomuseum-mapshaper/lists"}