{"id":19632535,"url":"https://github.com/metwork-framework/mapserverapi","last_synced_at":"2025-06-15T11:07:50.468Z","repository":{"id":55417677,"uuid":"155201177","full_name":"metwork-framework/mapserverapi","owner":"metwork-framework","description":"tiny C library to invoke mapserver engine as a library","archived":false,"fork":false,"pushed_at":"2025-05-15T06:27:16.000Z","size":240,"stargazers_count":2,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-15T07:28:51.909Z","etag":null,"topics":["autoreadme","c","github-actions","integration-level-3","library","mapserver"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/metwork-framework.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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-29T11:34:08.000Z","updated_at":"2025-05-15T06:27:20.000Z","dependencies_parsed_at":"2025-04-28T06:33:52.934Z","dependency_job_id":"4354e946-49a7-422f-8d5c-d95cc050037c","html_url":"https://github.com/metwork-framework/mapserverapi","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/metwork-framework/mapserverapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metwork-framework%2Fmapserverapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metwork-framework%2Fmapserverapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metwork-framework%2Fmapserverapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metwork-framework%2Fmapserverapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metwork-framework","download_url":"https://codeload.github.com/metwork-framework/mapserverapi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metwork-framework%2Fmapserverapi/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259964330,"owners_count":22938724,"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":["autoreadme","c","github-actions","integration-level-3","library","mapserver"],"created_at":"2024-11-11T12:14:23.249Z","updated_at":"2025-06-15T11:07:50.452Z","avatar_url":"https://github.com/metwork-framework.png","language":"C","readme":"# mapserverapi\n\n[//]: # (automatically generated from https://github.com/metwork-framework/github_organization_management/blob/master/common_files/README.md)\n\n**Status (master branch)**\n\n[![GitHub CI](https://github.com/metwork-framework/mapserverapi/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/metwork-framework/mapserverapi/actions?query=workflow%3ACI+branch%3Amaster)\n[![Maintenance](https://raw.githubusercontent.com/metwork-framework/resources/master/badges/maintained.svg)](https://github.com/metwork-framework/resources/blob/master/badges/maintained.svg)\n\n\n\n\n## What is it ?\n\nThis is a tiny C library to invoke [mapserver](http://mapserver.org) engine\nas a library (with no daemon or CGI).\n\n## Build\n\n### Prerequisites\n\n- mapserver installed\n- standard compilation tools (gcc, make...)\n- glib2 library and corresponding headers\n\n### Building\n\nTo build the library you must specify:\n\n- `MAPSERVER_LIB_DIR`: the full path of the directory containing `libmapserver.so`\n- `PREFIX`: the full path of the directory where you want to install the library\n\nFor example:\n\n```\nmake MAPSERVER_LIB_DIR=/opt/mapserver/lib PREFIX=/usr/local clean all install\n```\n\n### Testing\n\nYou must have `valgrind` tool installed.\n\n```\nmake MAPSERVER_LIB_DIR=/opt/mapserver/lib PREFIX=/usr/local test\n```\n\n## Usage\n\n### Compilation flags\n\nThe library use `pkg-config` tool. So you can use the following command to\nget the compilation flags:\n\n```\npkg-config --cflags --libs mapserverapi\n```\n\nIf not found, you may have to add `PREFIX` at the end of `${PKG_CONFIG_PATH}`\nenvironnement variable.\n\n### In your code\n\n```C\n#include \u003cmapserverapi.h\u003e\n\n// [...]\n\n# Init the library (mandatory)\nmapserverapi_init();\n\ngchar *mapfile_content;\n# [...]\n# Put a mapfile content into mapfile_content string\n\n# Set a WMS query_string (for this example)\ngchar *query_string = \"LAYERS=ocean\u0026TRANSPARENT=true\u0026FORMAT=image%2Fpng\u0026SERVICE=WMS\u0026VERSION=1.1.1\u0026REQUEST=GetMap\u0026STYLES=\u0026EXCEPTIONS=application%2Fvnd.ogc.se_xml\u0026SRS=EPSG%3A4326\u0026BBOX=-180.0,-90.0,180.0,90.0\u0026WIDTH=500\u0026HEIGHT=250\"\n\n# Invoke mapserver\nvoid *body;\ngchar *content_type = NULL;\ngsize body_length;\ngboolean b = mapserverapi_invoke(mapfile_content, query_string, \u0026body, \u0026content_type, \u0026body_length);\nif (b == TRUE) {\n    # you have the full body (PNG image in this example) in body variable (this buffer is managed by the library, don't free it by yourself !)\n    # you have the body length in body_length variable.\n    # you have the content_type of the body in content_type variable (you have to free it after use).\n\n    # [...]\n\n    # free content_type when you have finished with them\n    # (but don't free body variable)\n    g_free(content_type);\n}\n\n# Destroy the library\nmapserverapi_destroy();\n```\n\n\n### Uninstalling\n\n```\nmake MAPSERVER_LIB_DIR=/opt/mapserver/lib PREFIX=/usr/local uninstall\n```\n\n\n\n\n\n\n## Contributing guide\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) file.\n\n\n\n## Code of Conduct\n\nSee [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) file.\n\n\n\n## Sponsors\n\n*(If you are officially paid to work on MetWork Framework, please contact us to add your company logo here!)*\n\n[![logo](https://raw.githubusercontent.com/metwork-framework/resources/master/sponsors/meteofrance-small.jpeg)](http://www.meteofrance.com)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetwork-framework%2Fmapserverapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetwork-framework%2Fmapserverapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetwork-framework%2Fmapserverapi/lists"}