{"id":21732161,"url":"https://github.com/jbelien/mapfile-php-library","last_synced_at":"2025-06-17T11:07:59.569Z","repository":{"id":53461865,"uuid":"41858244","full_name":"jbelien/MapFile-PHP-Library","owner":"jbelien","description":"PHP Library to read/write MapServer mapfiles","archived":false,"fork":false,"pushed_at":"2024-01-01T13:45:06.000Z","size":1134,"stargazers_count":8,"open_issues_count":6,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-31T17:32:42.827Z","etag":null,"topics":["library","mapfile","mapscript","mapserver","php","php-library"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jbelien.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"jbelien"}},"created_at":"2015-09-03T12:22:05.000Z","updated_at":"2024-03-21T09:03:12.000Z","dependencies_parsed_at":"2023-02-17T07:31:27.011Z","dependency_job_id":"923093d3-4fad-446e-b813-7ee16cd30055","html_url":"https://github.com/jbelien/MapFile-PHP-Library","commit_stats":{"total_commits":131,"total_committers":9,"mean_commits":"14.555555555555555","dds":0.549618320610687,"last_synced_commit":"e99d6c308a6868c2c7521a11c2cb29606412a0da"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/jbelien/MapFile-PHP-Library","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbelien%2FMapFile-PHP-Library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbelien%2FMapFile-PHP-Library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbelien%2FMapFile-PHP-Library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbelien%2FMapFile-PHP-Library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jbelien","download_url":"https://codeload.github.com/jbelien/MapFile-PHP-Library/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbelien%2FMapFile-PHP-Library/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260346865,"owners_count":22995150,"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":["library","mapfile","mapscript","mapserver","php","php-library"],"created_at":"2024-11-26T04:29:05.171Z","updated_at":"2025-06-17T11:07:54.550Z","avatar_url":"https://github.com/jbelien.png","language":"PHP","readme":"# MapFile-PHP-Library\n\n[![Latest Stable Version](https://poser.pugx.org/jbelien/mapfile-php-library/v/stable)](https://packagist.org/packages/jbelien/mapfile-php-library)\n[![Total Downloads](https://poser.pugx.org/jbelien/mapfile-php-library/downloads)](https://packagist.org/packages/jbelien/mapfile-php-library)\n[![Monthly Downloads](https://poser.pugx.org/jbelien/mapfile-php-library/d/monthly.png)](https://packagist.org/packages/jbelien/mapfile-php-library)\n[![Software License](https://img.shields.io/badge/license-GPL--2.0-brightgreen.svg)](LICENSE)\n\nPHP Library to read/write MapServer mapfiles.\n\nThis library is based on [MapServer 7.2.0 documentation](https://mapserver.org/mapfile/) (last updated on 16 June 2017).\n\n## Installation\n\n```cmd\ncomposer require jbelien/mapfile-php-library\n```\n\n## Usage\n\n### Write MapFile (example)\n\n```php\n$map = new \\MapFile\\Model\\Map();\n\n$map-\u003ename = 'my-mapfile';\n$map-\u003eprojection = 'EPSG:4326';\n\n$map-\u003escalebar = new \\MapFile\\Model\\Scalebar();\n$map-\u003escalebar-\u003eunits = 'kilometers';\n\n$layer = new \\MapFile\\Model\\Layer();\n$layer-\u003ename = 'my-layer';\n$layer-\u003etype = 'POLYGON';\n$layer-\u003estatus = 'ON';\n$layer-\u003edata = 'my-shapefile';\n$layer-\u003eprojection = 'EPSG:4326';\n\n$class = new \\MapFile\\Model\\LayerClass();\n\n$style = new \\MapFile\\Model\\Style();\n$style-\u003ecolor = [0, 0, 0];\n$class-\u003estyle-\u003eadd($style);\n\n$label = new \\MapFile\\Model\\Label();\n$label-\u003etext = '[label]';\n$label-\u003ecolor = [0, 0, 0];\n$label-\u003esize = 12;\n$class-\u003elabel-\u003eadd($label);\n\n$layer-\u003eclass-\u003eadd($class);\n\n$map-\u003elayer-\u003eadd($layer);\n\n(new \\MapFile\\Writer\\Map($map))-\u003esave('my-mapfile.map');\n```\n\nHave a look at the [source code](https://github.com/jbelien/MapFile-PHP-Library/tree/master/src/Model) to see all the available options.\n\n### Parse MapFile (example)\n\n```php\n$map = (new \\MapFile\\Parser\\Map())-\u003eparse('my-mapfile.map');\n\nforeach ($map-\u003elayer as $layer) {\n    echo $layer-\u003ename;\n}\n```\n","funding_links":["https://github.com/sponsors/jbelien"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbelien%2Fmapfile-php-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbelien%2Fmapfile-php-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbelien%2Fmapfile-php-library/lists"}