{"id":32226493,"url":"https://github.com/arthur-e/wicket","last_synced_at":"2025-10-22T09:51:45.736Z","repository":{"id":47100564,"uuid":"3545112","full_name":"arthur-e/Wicket","owner":"arthur-e","description":"A modest library for moving between Well-Known Text (WKT) and various framework geometries","archived":false,"fork":false,"pushed_at":"2021-09-13T16:04:15.000Z","size":492,"stargazers_count":590,"open_issues_count":34,"forks_count":227,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-10-19T16:43:02.739Z","etag":null,"topics":["arcgis","geometry","geospatial","google-maps-api","leaflet","mapping","polygon","wkt","wkt-strings"],"latest_commit_sha":null,"homepage":"https://arthur-e.github.io/Wicket/","language":"JavaScript","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/arthur-e.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}},"created_at":"2012-02-25T14:59:02.000Z","updated_at":"2025-07-29T02:30:59.000Z","dependencies_parsed_at":"2022-08-31T03:01:50.021Z","dependency_job_id":null,"html_url":"https://github.com/arthur-e/Wicket","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/arthur-e/Wicket","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthur-e%2FWicket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthur-e%2FWicket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthur-e%2FWicket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthur-e%2FWicket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arthur-e","download_url":"https://codeload.github.com/arthur-e/Wicket/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthur-e%2FWicket/sbom","scorecard":{"id":209225,"data":{"date":"2025-08-11","repo":{"name":"github.com/arthur-e/Wicket","commit":"5f9162f8ad98cc044bd00a7d925caa84b72397f7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":5,"reason":"Found 10/20 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 20 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T00:25:53.901Z","repository_id":47100564,"created_at":"2025-08-17T00:25:53.901Z","updated_at":"2025-08-17T00:25:53.901Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280416593,"owners_count":26327043,"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","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["arcgis","geometry","geospatial","google-maps-api","leaflet","mapping","polygon","wkt","wkt-strings"],"created_at":"2025-10-22T09:51:41.317Z","updated_at":"2025-10-22T09:51:45.729Z","avatar_url":"https://github.com/arthur-e.png","language":"JavaScript","readme":"# Wicket #\n\n[![Travis CI](https://travis-ci.org/arthur-e/Wicket.svg?branch=master)](https://travis-ci.org/arthur-e/Wicket.svg?branch=master)\n[![CDNJS](https://img.shields.io/cdnjs/v/wicket.svg)](https://cdnjs.com/libraries/wicket)\n\nWicket is a lightweight library for translating between [Well-Known Text (WKT)](http://en.wikipedia.org/wiki/Well-known_text) and various client-side mapping frameworks:\n* Leaflet [(demo)](http://arthur-e.github.io/Wicket/)\n* Google Maps API [(demo)](http://arthur-e.github.io/Wicket/sandbox-gmaps3.html)\n* ESRI ArcGIS JavaScript API \n* Potentially any other web mapping framework through serialization and de-serialization of GeoJSON (with `JSON.parse`)\n\nThe core Wicket library and the Leaflet extension are both compatible with Node.js; the Google Maps and ArcGIS API extensions will not work in Node.js because they require a browser.\n\nIf you are looking for [Apache Wicket](http://wicket.apache.org/), the web-app development framework for Java, [you'll find it here](http://wicket.apache.org/).\n\n## License ##\n\nWicket is released under the [GNU General Public License version 3 (GPLv3)](http://www.gnu.org/licenses/gpl.html).\nAccordingly:\n\n\u003e This program is free software: you can redistribute it and/or modify\n\u003e it under the terms of the GNU General Public License as published by\n\u003e the Free Software Foundation, either version 3 of the License, or\n\u003e (at your option) any later version.\n\n## Installation ##\n\n    $ npm install wicket\n\n## Example ##\n\nThe following examples work in any of the mapping environments, as Wicket has a uniform API regardless of the client-side mapping library you're using.\n\n```javascript\n// Create a new Wicket instance\nvar wkt = new Wkt.Wkt();\n\n// Read in any kind of WKT string\nwkt.read(\"POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))\");\n\n// Or a GeoJSON string\nwkt.read('{\"coordinates\": [[[30, 10], [10, 20], [20, 40], [40, 40], [30, 10]]], \"type\": \"Polygon\"}');\n\n// Access and modify the underlying geometry\nconsole.log(wkt.components);\n// \"[ [ {x: 30, y: 10}, {x: 10, y: 30}, ...] ]\"\nwkt.components[0][1].x = 15;\n\nwkt.merge(new Wkt.Wkt('POLYGON((35 15,15 25,25 45,45 45,35 15))'));\nwkt.write();\n// MULTIPOLYGON(((30 10,10 20,20 40,40 40,30 10)),((35 15,15 25,25 45,45 45,35 15)))\n\n// Create a geometry object, ready to be mapped!\nwkt.toObject();\n\n// Convert to GeoJSON\nwkt.toJson(); // Outputs an object\nJSON.stringify(wkt.toJson()); // Outputs a string\n```\n\nWicket will read from the geometry objects of any mapping client it understands.\n**Note:** Don't use the `deconstruct()` method! This is used internally by `Wkt.Wkt()` instances.\nUse `fromObject()` instead, as in the following example.\n\n```javascript\nvar wkt = new Wkt.Wkt();\n\n// Deconstruct an existing point feature e.g. google.maps.Marker instance\nwkt.fromObject(somePointObject);\n\nconsole.log(wkt.components);\n// \"[ {x: 10, y: 30} ]\"\n\n// Serialize a WKT string from that geometry\nwkt.write();\n// \"POINT(10 30)\"\n```\n\n## See Also ##\n\n* [wellknown](https://github.com/mapbox/wellknown)\n* [OpenLayers WKT](https://github.com/openlayers/openlayers/blob/master/lib/OpenLayers/Format/WKT.js)\n* [wkt-parser](http://terraformer.io/wkt-parser/)\n\n## Dependencies and Build Information ##\n\n**Wicket has zero dependencies**, however, JSON parsing (from strings) is not provided.\nWicket looks for the function `JSON.parse`, which is provided in most modern browsers (get it with [this library](https://github.com/douglascrockford/JSON-js/blob/master/json2.js), if you need to support older browsers).\n\nMinified versions can be generated via:\n\n    npm run build\n\n### Testing ###\n\n    npm test\n\n## Documentation ##\n\nRead the documentation [here](http://arthur-e.github.io/Wicket/doc/out/). Documentation can be generated with [JSDoc 3](https://github.com/jsdoc3/jsdoc).\n\n    git clone git://github.com/jsdoc3/jsdoc.git\n    ./jsdoc /var/www/static/wicket/wicket.src.js\n\nOr, with Node installed:\n\n    sudo npm install -g git://github.com/jsdoc3/jsdoc.git\n    jsdoc /var/www/static/wicket/wicket.src.js\n\nEither way, make sure you invoke `jsdoc` from a directory in which you have write access; it will output documentation to your current working directory.\n\n## Colophon ##\n\n### Motivation ###\n\nWicket was created out of the need for a lightweight Javascript library that can translate Well-Known Text (WKT) strings into geographic features.\nThis problem arose in the context of [OpenClimateGIS](https://github.com/arthur-e/OpenClimateGIS), a web framework for accessing and subsetting online climate data.\n\nOpenClimateGIS emits WKT representations of user-defined geometry.\nThe API Explorer allowed users to define arbitrary areas-of-interest (AOIs) and view predefined AOIs on a Google Maps API instance.\nSo, initially, the problem was converting between WKT strings and Google Maps API features.\nWhile other mapping libraries, such as [OpenLayers](http://www.openlayers.org), have very nice WKT libraries built-in, the Google Maps API, as of this writing, does not.\nIn the (apparent) absence of a lightweight, easy-to-use WKT library in Javascript, I set out to create one.\n\nThat is what Wicket aspires to be: lightweight, framework-agnostic, and useful.\nI hope it achieves these goals.\nIf you find it isn't living up to that and you have ideas on how to improve it, please fork the code or [drop me a line](mailto:kaendsle@mtu.edu).\n\n### Acknowledgements ###\n\nWicket borrows heavily from the experiences of others who came before us:\n\n* The OpenLayers 2.7 WKT module (OpenLayers.Format.WKT)\n* Chris Pietshmann's [article on converting Bing Maps shapes (VEShape) to WKT](http://pietschsoft.com/post/2009/04/04/Virtual-Earth-Shapes-%28VEShape%29-to-WKT-%28Well-Known-Text%29-and-Back-using-JavaScript.aspx)\n* Charles R. Schmidt's and the Python Spatial Analysis Laboratory's (PySAL) WKT writer\n\n### Conventions ###\n\nThe base library, wicket.js, contains the Wkt.Wkt base object.\nThis object doesn't do anything on its own except read in WKT strings, allow the underlying geometry to be manipulated programmatically, and write WKT strings.\nBy loading additional libraries, such as wicket-gmap3.js, users can transform between between WKT and the features of a given framework (e.g. google.maps.Polygon instances).\nThe intent is to add support for new frameworks as additional Javascript files that alter the Wkt.Wkt prototype.\n\n**To extend Wicket**, nominally by writing bindings for a new mapping library, add a new file with a name like wicket-libname.src.js (and corresponding minified version wicket-libname.js) where \"libname\" is some reasonably short, well-known name for the mapping library.\n\n## Concepts ##\n\nWKT geometries are stored internally using the following convention. The atomic unit of geometry is the coordinate pair (e.g. latitude and longitude) which is represented by an Object with x and y properties. An Array with a single coordinate pair represents a a single point (i.e. POINT feature):\n\n```javascript\n[ {x: -83.123, y: 42.123} ]\n\n// POINT(-83.123 42.123)\n```\n\nAn Array of multiple points (an Array of Arrays) specifies a \"collection\" of points (i.e. a MULTIPOINT feature):\n\n```javascript\n[\n    [ {x: -83.123, y: 42.123} ],\n    [ {x: -83.234, y: 42.234} ]\n]\n// MULTIPOINT(-83.123 42.123,-83.234 42.234)\n```\n\nAn Array of multiple coordinates specifies a collection of connected points in an ordered sequence (i.e. LINESTRING feature):\n\n```javascript\n[\n    {x: -83.12, y: 42.12},\n    {x: -83.23, y: 42.23},\n    {x: -83.34, y: 42.34}\n]\n// LINESTRING(-83.12 42.12,-83.23 42.23,-83.34 42.34)\n```\n\nAn Array can also contain other Arrays. In these cases, the contained Array(s) can each represent one of two geometry types.\nThe contained Array might reprsent a single polygon (i.e. POLYGON feature):\n\n```javascript\n[\n    [\n        {x: -83, y: 42},\n        {x: -83, y: 43},\n        {x: -82, y: 43},\n        {x: -82, y: 42},\n        {x: -83, y: 42}\n    ]\n]\n// POLYGON(-83 42,-83 43,-82 43,-82 42,-83 42)\n```\n\nThe above example cannot represent a LINESTRING feature (one of the few type-based constraints on the internal representations), however it may represent a MULTILINESTRING feature. Both POLYGON and MULTILINESTRING features are internally represented the same way. The difference between the two is specified elsewhere (in the Wkt instance's type) and must be retained. In this particular example (above), we can see that the first coordinate in the Array is repeated at the end, meaning that the geometry is closed. We can therefore infer it represents a POLYGON and not a MULTILINESTRING even before we plot it. Wicket retains the *type* of the feature and will always remember which it is.\n\nSimilarly, multiple nested Arrays might reprsent a MULTIPOLYGON feature:\n\n```javascript\n[\n    [\n        [\n            {x: -83, y: 42},\n            {x: -83, y: 43},\n            {x: -82, y: 43},\n            {x: -82, y: 42},\n            {x: -83, y: 42}\n        ]\n    ],\n    [\n        [\n            {x: -70, y: 40},\n            {x: -70, y: 41},\n            {x: -69, y: 41},\n            {x: -69, y: 40},\n            {x: -70, y: 40}\n        ]\n    ]\n]\n// MULTIPOLYGON(((-83 42,-83 43,-82 43,-82 42,-83 42),(-70 40,-70 41,-69 41,-69 40,-70 40)))\n```\n\nOr a POLYGON with inner rings (holes) in it where the outer ring is the polygon envelope and comes first; subsequent Arrays are inner rings (holes):\n\n```javascript\n[\n    [\n        {x: 35, y: 10},\n        {x: 10, y: 20},\n        {x: 15, y: 40},\n        {x: 45, y: 45},\n        {x: 35, y: 10}\n    ],\n    [\n        {x: 20, y: 30},\n        {x: 35, y: 35},\n        {x: 30, y: 20},\n        {x: 20, y: 30}\n    ]\n]\n// POLYGON((35 10,10 20,15 40,45 45,35 10),(20 30,35 35,30 20,20 30))\n```\n\nOr they might represent a MULTILINESTRING where each nested Array is a different LINESTRING in the collection. Again, Wicket remembers the correct *type* of feature even though the internal representation is ambiguous.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthur-e%2Fwicket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farthur-e%2Fwicket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthur-e%2Fwicket/lists"}