{"id":17178930,"url":"https://github.com/ppkrauss/sfc4q","last_synced_at":"2026-01-29T05:47:28.030Z","repository":{"id":72871761,"uuid":"212991020","full_name":"ppKrauss/Sfc4q","owner":"ppKrauss","description":"Space-filling curve valid to index hierarchical grid of aperture-4 quadrilateral cells","archived":false,"fork":false,"pushed_at":"2022-09-26T00:02:16.000Z","size":644,"stargazers_count":0,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-12T11:14:05.439Z","etag":null,"topics":["geocode","hierarchical-grids","quadrilateral-cells","space-filling-curves"],"latest_commit_sha":null,"homepage":"https://ppkrauss.github.io/Sfc4q/","language":"JavaScript","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/ppKrauss.png","metadata":{"files":{"readme":"README.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-05T11:54:15.000Z","updated_at":"2022-01-09T15:46:31.000Z","dependencies_parsed_at":"2023-04-28T20:32:42.980Z","dependency_job_id":null,"html_url":"https://github.com/ppKrauss/Sfc4q","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppKrauss%2FSfc4q","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppKrauss%2FSfc4q/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppKrauss%2FSfc4q/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppKrauss%2FSfc4q/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ppKrauss","download_url":"https://codeload.github.com/ppKrauss/Sfc4q/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247439326,"owners_count":20939061,"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":["geocode","hierarchical-grids","quadrilateral-cells","space-filling-curves"],"created_at":"2024-10-15T00:09:51.990Z","updated_at":"2026-01-29T05:47:27.987Z","avatar_url":"https://github.com/ppKrauss.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![DOI](https://zenodo.org/badge/212991020.svg)](https://zenodo.org/badge/latestdoi/212991020)\n\n\n\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; ([click here to online demonstration](https://ppkrauss.github.io/Sfc4q/) for Desktop Firefox or Chrome)\n\n# Sfc4q classes\n\n*Space-filling curves*  (SFCs) can be used to index discrete grids, including the [Geospatial ones](http://docs.opengeospatial.org/as/15-104r5/15-104r5.html). Each cell in the grid is associated with an index, which can be produced by an SFC.  In this project, we are particularly interested in hierarchical grids with a recurring ​partition of quadrilateral cells in 4 regions​:\n\n\u003cimg align=\"right\" src=\"docs/assets/quadrilateral-refinementRatio4.png\"\u003e\n\nTherefore, we are interested in any SFC that is valid for indexing hierarchical grid of refinement-ratio-4 quadrilateral cells, abbreviated **SFC-4q**, or *Sfc4q* as adopted in the project's name and classes names.\n\nIn this project we are also interested in [geocodes](https://en.wikipedia.org/wiki/Geocode) obtained by labeling the SFC indexes,  expressing it in human-readable **hierarchical codes**. The hierarchy of the code is illustrated above as the commom prefix (e.g. `2` in `20` and `23`) that emerges in with the base4 representation.\n\n## Framework organization\n\nThe framework can be used as simple standard interface for a set of SFC algorithms, like Hilbert, Morton or other.\n\n\u003cimg align=\"right\" src=\"docs/assets/umlClass01-intro.png\"\u003e\n\nThe algorithms themselves are \"concrete classes\". But the standardization of basic methods, such as *endode()* and *decode()*, is not the issue, there are a lot of generic and reusable methods, so the best way is to extend a generic class with these reusable methods, and implement the concrete algorithm  as specialization. This project is a set of abstract and concrete classes.\n\nOther important issue for SFC-4q is the generalization for \"half levels\" described in [this PDF article](https://zenodo.org/record/2536584). It is also independent of the concrete algorithms. The illustration bellou is hou these classes uas implemented:\n\n![](docs/assets/umlClass02-Sfc4q.png)\n\n* [**GSfc4q**](https://ppkrauss.github.io/Sfc4q/docs/jsDocs/GSfc4q.html): the \"Generalized Sfc4q\" class.\n\n* [**GSfc4qLbl**](https://ppkrauss.github.io/Sfc4q/docs/jsDocs/GSfc4qLbl.html): a generaliation of GSfc4q,  to translate *key*, *bkey* and cell identifiers (cell IDs) into human-readable labels (lbl). To preserve hierarchy, this translation uses the concept of [Natural Codes](http://osm.codes/_foundations/art1.pdf), implemented in Javascript by the class SizedBigInt.\n\n* **GSfc4qLbl_Hilbert**: the \"concrete class\" that implements the [Hilbert curve](https://en.wikipedia.org/wiki/Hilbert_curve).\n\n* **GSfc4qLbl_Morton**:the \"concrete class\" that implements the [Morton curve](https://en.wikipedia.org/wiki/Z-order_curve) (also  Z-order curve).\n\n* [**SizedBigInt**](https://ppkrauss.github.io/Sfc4q/docs/jsDocs/SizedBigInt.html): it is a complementar tool for use BigInt (mainly 64 bits unsigned integers) as hierarchical indexes and obtain its string representations, and an implementation of the Natural Codes.\n\nSee [classes documentation](https://ppkrauss.github.io/Sfc4q/docs/jsDocs).\n\n## The grid and D3 peparation classes\n\n* [**GridOfCurve**](https://ppkrauss.github.io/Sfc4q/docs/jsDocs/GridOfCurve.html)\n\n* [**GridOfCurve_D3**](https://ppkrauss.github.io/Sfc4q/docs/jsDocs/GridOfCurve_D3.html)\n\n## LICENSE\n\nContent, data and algorithms: **CC0 1.0**,  Public Domain Dedication.\n\n[![License: CC0](https://upload.wikimedia.org/wikipedia/commons/thumb/6/69/CC0_button.svg/88px-CC0_button.svg.png)](http://creativecommons.org/publicdomain/zero/1.0)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppkrauss%2Fsfc4q","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fppkrauss%2Fsfc4q","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppkrauss%2Fsfc4q/lists"}