{"id":17269495,"url":"https://github.com/systemed/mapcss_ruby","last_synced_at":"2025-02-24T23:31:45.126Z","repository":{"id":145599808,"uuid":"2151761","full_name":"systemed/mapcss_ruby","owner":"systemed","description":"MapCSS parser for Ruby","archived":true,"fork":false,"pushed_at":"2011-10-13T22:38:52.000Z","size":248,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-31T12:49:44.402Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/systemed.png","metadata":{"files":{"readme":"README.txt","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-08-03T23:48:47.000Z","updated_at":"2023-08-27T12:46:11.000Z","dependencies_parsed_at":"2023-03-23T00:02:35.657Z","dependency_job_id":null,"html_url":"https://github.com/systemed/mapcss_ruby","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/systemed%2Fmapcss_ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemed%2Fmapcss_ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemed%2Fmapcss_ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemed%2Fmapcss_ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/systemed","download_url":"https://codeload.github.com/systemed/mapcss_ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240576031,"owners_count":19823280,"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":[],"created_at":"2024-10-15T08:16:26.722Z","updated_at":"2025-02-24T23:31:44.664Z","avatar_url":"https://github.com/systemed.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Ruby MapCSS parser\n==================\n\nThis is an experimental Ruby parser for MapCSS 0.2, based on the Halcyon parser.\n\n== Dependencies ==\n\nYou'll require Jochen Topf's OSMlib library. We use the Node, Way and Relation objects from this. Unlike Halcyon, OSMlib doesn't keep track of 'parent' objects, so we have a singleton Dictionary class to store this mapping.\n\n== How to use ==\n\nInstall style_parser and style_parser.rb into a lib/ directory. Require style_parser as usual.\n\nRead a MapCSS file like this:\n\n\truleset=StyleParser::RuleSet.new(12,20)\t\t\t\t\t# 12 and 20 are min/max zoom levels\n\truleset.parse_from_file('opencyclemap.css')\n\t\nCreate the parent object mappings from an OSMlib database:\n\n\tdictionary = StyleParser::Dictionary.instance\n\tdictionary.populate(db)\n\nThen get the style for any OSM object like this:\n\n\tentity=db.get_way(3044458)\n\tstylelist=ruleset.get_styles(entity,entity.tags,14)\t\t# 14 is the target zoom level\n\tputs stylelist\n\nYou can see an example of this in osm_test.rb.\n\n== Limitations ==\n\n- It hasn't really been tested at all.\n- The test stylesheet is MapCSS 0.1. That's not too helpful. ;)\n- Setting tags from the stylesheet doesn't yet work.\n- Any limitations of Halcyon's parser are also present here.\n\n== Licence and author ==\n\nWTFPL. You can do whatever the fuck you want with this code. Code by Richard Fairhurst, summer 2011.\n\nExample files: OpenCycleMap Potlatch 2 style by Andy Allan, Charlbury OpenStreetMap data by OpenStreetMap contributors (CC-BY-SA).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemed%2Fmapcss_ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsystemed%2Fmapcss_ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemed%2Fmapcss_ruby/lists"}