{"id":14037076,"url":"https://github.com/kambrium/staticmapservice","last_synced_at":"2025-04-24T01:00:27.549Z","repository":{"id":163197812,"uuid":"154009537","full_name":"kambrium/staticmapservice","owner":"kambrium","description":"A web service that generates static maps","archived":false,"fork":false,"pushed_at":"2025-02-28T20:39:20.000Z","size":63,"stargazers_count":18,"open_issues_count":1,"forks_count":9,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-18T08:40:10.093Z","etag":null,"topics":["api","generator","map","python","service","static"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kambrium.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,"zenodo":null}},"created_at":"2018-10-21T13:09:41.000Z","updated_at":"2025-02-28T20:39:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"a68fcfdb-b37d-4ce2-9ef4-3543ea9475ec","html_url":"https://github.com/kambrium/staticmapservice","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kambrium%2Fstaticmapservice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kambrium%2Fstaticmapservice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kambrium%2Fstaticmapservice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kambrium%2Fstaticmapservice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kambrium","download_url":"https://codeload.github.com/kambrium/staticmapservice/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250540950,"owners_count":21447427,"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":["api","generator","map","python","service","static"],"created_at":"2024-08-12T03:02:27.831Z","updated_at":"2025-04-24T01:00:27.524Z","avatar_url":"https://github.com/kambrium.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"staticmapservice - A web service that generates static maps\n===========================================================\n\n![staticmapservice logo](logo.png)\n\nAbout\n-----\nstaticmapservice is a configurable web service written in Python that generates static maps similar to the Maps Static API by Google. Essentially this software is a [Flask](http://flask.pocoo.org/) wrapper around the Python library [staticmap](https://github.com/komoot/staticmap). At the moment, this software can generate static maps based on XYZ tiles (e.g. [OpenStreetMap based data](https://wiki.openstreetmap.org/wiki/Tile_servers)) and TMS tiles with circle markers, polylines, polygons and icons.\n\nQuick start\n-----------\n1. Create a venv and activate it.\n    ```\n    python3 -m venv /path/to/venv/of/staticmapservice\n    source /path/to/venv/of/staticmapservice/bin/activate\n    ```\n2. Upgrade pip. This is necessary because one of the dependencies of staticmapservice, the library [staticmap](https://github.com/komoot/staticmap), can't be installed with older versions of pip.\n    ```\n    pip install --upgrade pip\n    ```\n3. Clone staticmapservice and change to the application directory.\n    ```\n    git clone https://github.com/kambrium/staticmapservice\n    cd staticmapservice\n    ```\n4. Install requirements.\n    ```\n    pip install -r requirements.txt\n    ```\n5. Export the FLASK_APP variable and run the software.\n    ```\n    export FLASK_APP=staticmapservice.py\n    flask run\n    ```\n6. In your browser, send a request with some query parameters to the API. Here's an example that should work:\n    ```\n    http://127.0.0.1:5000/?w=400\u0026h=300\u0026z=9\u0026marker=coords:48.25,11.22|diam:10|color:%233F33FF\n    ```\n    As a response you should get a static map of southern Bavaria with a blue marker next to the city of Munich. See below for a detailed list of currently supported query parameters.\n\nQuery parameters\n----------------\nThis is a list of currently supported query parameters. Please see below for working example requests.\n\n| Parameter | Meaning |\n| --- | --- |\n| w | Width of the map (in pixels) |\n| h | Height of the map (in pixels) |\n| z | Zoom level |\n| center | Coordinate of the center of the map (one lat/lon pair) |\n| marker | Properties of a circle marker separated by `\\|`: coordinates (`coords`, one lat/lon pair), diameter (`diam`, in pixels) and color (`color`, hexadecimal code, # encoded as %23) |\n| line | Properties of a polyline separated by `\\|`: coordinates (`coords`, multiple lat/lon pairs), width (`width`, in pixels) and color (`color`, hexadecimal code, # encoded as %23) |\n| polygon | Properties of a polygon separated by `\\|`: coordinates (`coords`, multiple lat/lon pairs), fill and outline color (`fcolor`, `ocolor`, hexadecimal codes, # encoded as %23) |\n| icon | Properties of an icon marker separated by `\\|`: coordinates (`coords`, one lat/lon pair), name of the icon (`name`, must be identical with the name of the icon file to be displayed, icons must be stored in the folder ./icons) and offset (`offx`, `offy`, in pixels) |\n\nExamples\n--------\nHere are some examples how to use staticmapservice.\n\n### Map with marker\nThe following request creates a 400 pixels wide and 300 pixels high map. The zoom level is 9. A marker is set at 48.25 (latitude) and 11.22 (longitude). The marker has a diameter of 10 pixels and the color #3F33FF (blue).\n```\nhttp://127.0.0.1:5000/?w=400\u0026h=300\u0026z=9\u0026marker=coords:48.25,11.22|diam:10|color:%233F33FF\n```\n\n### Map with line\nThe following request creates a 500 pixels wide and 500 pixels high map. The zoom level is 8. A line will be drawn between a point at 48.2 (latitude), 11.2 (longitude) and another point at 47.5, 11. The line has a width of 4 pixels and the color #CD0000 (red).\n```\nhttp://127.0.0.1:5000/?w=500\u0026h=500\u0026z=8\u0026line=coords:48.2,11.2;47.5,11|width:4|color:%23CD0000\n```\n\n### Map with polygon\nThe following request creates a 400 pixels wide and 600 pixels high map. The zoom level is 5. A polygon will be drawn between the three points 48.2 (latitude), 11.2 (longitude), 47.5, 11 and 47.9, 12. The polygon is filled with the color #CD0000 (red) and its outline is #000000 (black).\n```\nhttp://127.0.0.1:5000/?w=400\u0026h=600\u0026z=5\u0026polygon=coords:48.2,11.2;47.5,11;47.9,12;48.2,11.2|fcolor:%23CD0000|ocolor:%23000000\n```\n\n### Map with icon\nThe following request creates a 400 pixels wide and 300 pixels high map. The zoom level is 9. A flag icon is set at 48.25 (latitude) and 11.22 (longitude). The offset of the icon is 15 pixels to the right and 10 pixels upwards.\n```\nhttp://127.0.0.1:5000/?w=400\u0026h=300\u0026z=9\u0026icon=coords:48.25,11.22|offx:15|offy:10|name:flag\n```\n\n### Using defaults\nSome parameters get default values from the configuration file (see below). That's why this is a valid request:\n```\nhttp://127.0.0.1:5000/?marker=coords:48.25,11.22|diam:10|color:%233F33FF\n```\n\n### Multiple markers, lines, polygons and/or icons\nThe application can handle multiple markers, lines, polygons and/or icons per map. The following request creates a map with a marker and a line.\n```\nhttp://127.0.0.1:5000/?marker=coords:48.25,11.22|diam:10|color:%233F33FF\u0026line=coords:48.2,11.2;47.5,11|width:4|color:%23CD0000\n```\n\n### Map with custom center\nThe center of a map can be altered by adding a custom center coordinate to the request.\n```\nhttp://127.0.0.1:5000/?w=400\u0026h=300\u0026z=9\u0026marker=coords:48.25,11.22|diam:10|color:%233F33FF\u0026center=48,11.7\n```\n\nConfiguration\n-------------\nThis application can be configured with the `config.py` file. Examples for configurable parameters are the maximum size of a map, the URL of the tile server or the maximum amount of points, nodes and vertices per request. See the file `config.py` for a complete list of all configurable parameters.\n\nLicense\n-------\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkambrium%2Fstaticmapservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkambrium%2Fstaticmapservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkambrium%2Fstaticmapservice/lists"}