{"id":19618584,"url":"https://github.com/cleder/parsewkt","last_synced_at":"2025-04-28T02:32:12.227Z","repository":{"id":11369399,"uuid":"13805735","full_name":"cleder/parsewkt","owner":"cleder","description":"A WKT Parser generated with grako","archived":false,"fork":false,"pushed_at":"2022-10-27T08:06:34.000Z","size":1079,"stargazers_count":17,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-20T23:47:28.465Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/cleder.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-23T14:55:21.000Z","updated_at":"2025-01-25T17:39:20.000Z","dependencies_parsed_at":"2022-08-27T23:53:23.182Z","dependency_job_id":null,"html_url":"https://github.com/cleder/parsewkt","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/cleder%2Fparsewkt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleder%2Fparsewkt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleder%2Fparsewkt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleder%2Fparsewkt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cleder","download_url":"https://codeload.github.com/cleder/parsewkt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251238226,"owners_count":21557422,"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-11-11T11:09:57.197Z","updated_at":"2025-04-28T02:32:11.598Z","avatar_url":"https://github.com/cleder.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"The WKT Parser was gernerated using grako https://pypi.python.org/pypi/grako\n\nThe ebnf file is the translation of http://svn.osgeo.org/postgis/trunk/doc/bnf-wkt.txt\n\nThe bnf to ebnf conversion was guided by http://stackoverflow.com/questions/14922242/how-to-convert-bnf-to-ebnf\n\nThe generation of parse.py is as easy as: /path/to/grako Wkt.ebnf -o parse.py\n\nparsewkt is continually tested with *Travis CI*\n\n.. image:: https://api.travis-ci.org/cleder/parsewkt.png\n    :target: https://travis-ci.org/cleder/parsewkt\n\n.. image:: https://coveralls.io/repos/cleder/parsewkt/badge.png?branch=master\n    :target: https://coveralls.io/r/cleder/parsewkt?branch=master\n\nImplementation Status\n=====================\n\nCurrently implemented is parsing from WKT to a __geo_interface__ compliant\ndictionary for the following types:\n\n- POINT\n- LINESTRING\n- POLYGON\n- MULTIPOINT\n- MULTILINESTRING\n- MULTIPOLYGON\n- GEOMETRYCOLLECTION\n\nThe parser can parse the following types but they are currently not\ntranslated into python objects:\n\n- COMPOUNDCURVE\n- CIRCULARSTRING\n- CURVEPOLYGON\n- MULTICURVE\n- POLYHEDRALSURFACE\n- TIN\n- TRIANGLE\n\nRationale\n=========\n\nThe parser was written to have a clean and complete parser for WKT.\nOther WKT to python parsers use regular expression to do the same and are\nmore or less complete.\nI wanted to have a reference implementation that could handle any kind\nof valid WKT that you throw at it. You can also use it as a reference\nif you want to write your own parser with grako.\n\nUsage\n======\n\n    \u003e\u003e\u003e from parsewkt import from_wkt\n    \u003e\u003e\u003e gc = \"\"\"GEOMETRYCOLLECTION(\n    ...           POINT(99 98),\n    ...           LINESTRING(1 1, 3 3),\n    ...           POLYGON((0 0, 0 1, 1 1, 0 0)),\n    ...           POLYGON((0 0, 0 9, 9 9, 9 0, 0 0), (5 5, 5 6, 6 6, 5 5)),\n    ...           MULTIPOLYGON(((0 0, 0 9, 9 9, 9 0, 0 0), (5 5, 5 6, 6 6, 5 5)))\n    ...         )\"\"\"\n    \u003e\u003e\u003e from_wkt(gc)\n    {'type': 'GeometryCollection', 'geometries': (\n        {'type': 'Point', 'coordinates': (99.0, 98.0)},\n        {'type': 'LineString', 'coordinates': ((1.0, 1.0), (3.0, 3.0))},\n        {'type': 'Polygon', 'coordinates': (((0.0, 0.0), (0.0, 1.0), (1.0, 1.0), (0.0, 0.0)),)},\n        {'type': 'Polygon', 'coordinates': (((0.0, 0.0), (0.0, 9.0), (9.0, 9.0), (9.0, 0.0), (0.0, 0.0)), ((5.0, 5.0), (5.0, 6.0), (6.0, 6.0), (5.0, 5.0)))},\n        {'type': 'MultiPolygon', 'coordinates': ((((0.0, 0.0), (0.0, 9.0), (9.0, 9.0), (9.0, 0.0), (0.0, 0.0)), ((5.0, 5.0), (5.0, 6.0), (6.0, 6.0), (5.0, 5.0))),)})}\n\n    \u003e\u003e\u003e tri = \"\"\"TRIANGLE((0 0 0,0 1 0,1 1 0,0 0 0))\"\"\"\n    \u003e\u003e\u003e from_wkt(tri)\n    Traceback (most recent call last):\n      File \"\u003cconsole\u003e\", line 1, in \u003cmodule\u003e\n      File \"/home/.../parsewkt/parsewkt/wkt.py\", line 307, in from_wkt\n        raise NotImplementedError\n    NotImplementedError\n\nLicense\n=======\n\n**parsewkt** is Copyright (C) 2013 by Christian Ledermann\n\nYou may use the tool under the terms of the BSD_-style license described in the enclosed **LICENSE.txt** file.\n\n.. _BSD: http://en.wikipedia.org/wiki/BSD_licenses#2-clause_license_.28.22Simplified_BSD_License.22_or_.22FreeBSD_License.22.29\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleder%2Fparsewkt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcleder%2Fparsewkt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleder%2Fparsewkt/lists"}