{"id":15187258,"url":"https://github.com/saulortega/pgeo","last_synced_at":"2026-03-03T19:02:51.363Z","repository":{"id":57557929,"uuid":"126063971","full_name":"saulortega/pgeo","owner":"saulortega","description":"Geometric Types for Postgres","archived":false,"fork":false,"pushed_at":"2022-10-18T02:28:08.000Z","size":26,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-26T08:24:38.480Z","etag":null,"topics":["geometric","geometric-types","geometry","go","golang","postgres","postgresql","psql","types"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saulortega.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":"2018-03-20T18:24:10.000Z","updated_at":"2022-12-19T15:58:55.000Z","dependencies_parsed_at":"2022-08-28T11:41:43.041Z","dependency_job_id":null,"html_url":"https://github.com/saulortega/pgeo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/saulortega/pgeo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saulortega%2Fpgeo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saulortega%2Fpgeo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saulortega%2Fpgeo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saulortega%2Fpgeo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saulortega","download_url":"https://codeload.github.com/saulortega/pgeo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saulortega%2Fpgeo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30056056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T18:21:05.932Z","status":"ssl_error","status_checked_at":"2026-03-03T18:20:59.341Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["geometric","geometric-types","geometry","go","golang","postgres","postgresql","psql","types"],"created_at":"2024-09-27T18:06:38.740Z","updated_at":"2026-03-03T19:02:51.346Z","avatar_url":"https://github.com/saulortega.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pgeo\nPackage pgeo implements [geometric types for Postgres](https://www.postgresql.org/docs/current/static/datatype-geometric.html)\n\nIt uses Scanner and Valuer interfaces from `database/sql`\n\n\n# Types\n```go\n//Points are the fundamental two-dimensional building block for geometric types.\n//X and Y are the respective coordinates, as floating-point numbers\ntype Point struct {\n\tX float64 `json:\"x\"`\n\tY float64 `json:\"y\"`\n}\n\n//Circles are represented by a center point and radius.\ntype Circle struct {\n\tPoint\n\tRadius float64 `json:\"radius\"`\n}\n\n//Line represents a infinite line with the linear equation Ax + By + C = 0, where A and B are not both zero.\ntype Line struct {\n\tA float64 `json:\"a\"`\n\tB float64 `json:\"b\"`\n\tC float64 `json:\"c\"`\n}\n\n//Paths are represented by lists of connected points.\n//Paths can be open, where the first and last points in the list are considered not connected,\n//or closed, where the first and last points are considered connected.\ntype Path struct {\n\tPoints []Point\n\tClosed bool `json:\"closed\"`\n}\n\n//Boxes are represented by pairs of points that are opposite corners of the box.\ntype Box [2]Point\n\n//Line segments are represented by pairs of points that are the endpoints of the segment.\ntype Lseg [2]Point\n\n//Polygons are represented by lists of points (the vertexes of the polygon).\ntype Polygon []Point\n```\n\n### Null Types\n```go\ntype NullPoint struct {\n\tPoint\n\tValid bool `json:\"valid\"`\n}\n\n//Same for others...\n```\n\n\n# Functions\n\n### Create Types\n```go\nNewPoint(X, Y float64) Point\n\nNewLine(A, B, C float64) Line\n\nNewLseg(A, B Point) Lseg\n\nNewBox(A, B Point) Box\n\nNewPath(P []Point, Closed bool) Path\n\nNewPolygon(P []Point) Polygon\n\nNewCircle(P Point, Radius float64) Circle\n```\n\n### Null Types\n```go\nNewNullPoint(P Point, valid bool) NullPoint\n\nNewNullLine(L Line, valid bool) NullLine\n\nNewNullLseg(L Lseg, valid bool) NullLseg\n\nNewNullBox(B Box, valid bool) NullBox\n\nNewNullPath(P Path, valid bool) NullPath\n\nNewNullPolygon(P Polygon, valid bool) NullPolygon\n\nNewNullCircle(C Circle, valid bool) NullCircle\n```\n\n### Rand Types\n```go\nNewRandPoint() Point\n\nNewRandLine() Line\n\nNewRandLseg() Lseg\n\nNewRandBox() Box\n\nNewRandPath() Path\n\nNewRandPolygon() Polygon\n\nNewRandCircle() Circle\n```\n\n### Zero Point\n```go\n//Returns a Point X=0, Y=0\nNewZeroPoint() Point\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaulortega%2Fpgeo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaulortega%2Fpgeo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaulortega%2Fpgeo/lists"}