{"id":48226785,"url":"https://github.com/am2222/strapi-plugin-postgis","last_synced_at":"2026-04-04T19:24:05.922Z","repository":{"id":41341883,"uuid":"499580029","full_name":"am2222/strapi-plugin-postgis","owner":"am2222","description":"Add native postgis support to strapi.","archived":false,"fork":false,"pushed_at":"2024-04-07T16:52:30.000Z","size":26043,"stargazers_count":42,"open_issues_count":12,"forks_count":15,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-10-22T05:52:52.000Z","etag":null,"topics":["gis","postgis","strapi-plugin","strapipluginweek"],"latest_commit_sha":null,"homepage":"https://am2222.github.io/strapi-plugin-postgis/","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/am2222.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}},"created_at":"2022-06-03T16:33:00.000Z","updated_at":"2025-05-12T01:38:12.000Z","dependencies_parsed_at":"2024-04-07T17:49:08.180Z","dependency_job_id":null,"html_url":"https://github.com/am2222/strapi-plugin-postgis","commit_stats":{"total_commits":13,"total_committers":2,"mean_commits":6.5,"dds":0.07692307692307687,"last_synced_commit":"97f011fc0f173aa774705e4572b9b42a2118caf9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/am2222/strapi-plugin-postgis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/am2222%2Fstrapi-plugin-postgis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/am2222%2Fstrapi-plugin-postgis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/am2222%2Fstrapi-plugin-postgis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/am2222%2Fstrapi-plugin-postgis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/am2222","download_url":"https://codeload.github.com/am2222/strapi-plugin-postgis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/am2222%2Fstrapi-plugin-postgis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31410392,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: 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":["gis","postgis","strapi-plugin","strapipluginweek"],"created_at":"2026-04-04T19:24:04.793Z","updated_at":"2026-04-04T19:24:05.901Z","avatar_url":"https://github.com/am2222.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cdiv align=\"center\"\u003e\n\n[![DocSearch](https://github.com/am2222/strapi-plugin-postgis/raw/main/images/github-logo.png?raw=true)](https://am2222.github.io/strapi-plugin-postgis/)\n\nAdd native postgis support to strapi.\n  \n  [![npm Package](https://github.com/am2222/strapi-plugin-postgis/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/am2222/strapi-plugin-postgis/actions/workflows/npm-publish.yml) [![Docs](https://github.com/am2222/strapi-plugin-postgis/actions/workflows/docs-publish-github.yml/badge.svg)](https://github.com/am2222/strapi-plugin-postgis/actions/workflows/docs-publish-github.yml)\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003e\n  \u003ca href=\"https://am2222.github.io/strapi-plugin-postgis/\"\u003eDocumentation\u003c/a\u003e\n   \n \u003ca href=\"https://youtu.be/THLGTUNbV1k\"\u003eVideo \u003c/a\u003e\n  \u003c/strong\u003e\n\u003c/p\u003e\n\u003c/div\u003e\n\n![Screenshot](https://github.com/am2222/strapi-plugin-postgis/raw/main/images/screenshot.png?raw=true)\n\n---\n\n\n\n## Under Development \n\n## How does it work?\nSince Strapi does not support native database formats I convert requests before they being sent to the querybuilder and convert all the geometry objects to the `geojson`. \n\n## Requirements\n\nStrapi Version 4.5.0 and up.\n\n## Installation\n\nSetup your strapi app as usual\n\n```javascript\nnpx create-strapi-app@latest my-project --quickstart\n```\n\nInstall `pg` and `strapi-plugin-postgis` \n\n```javascript\nnpm install pg --save\nnpm i strapi-plugin-postgis\n\n```\n\n**Make sure to config your strapi to use `postgrs` database as backend, Use this link in case you need any help with this step (https://strapi.io/blog/postgre-sql-and-strapi-setup)**\n\n**Make sure to install postgis on your database server.** \n* This plugin is only compatible with postgis versions 3.1 and 3.2*\n\nModify your middlewares as following to let strapi load `osm` tiles. Add `'*.tile.openstreetmap.org'` to the `img-src` as follows\n\n\n```javascript\n// ./config/middlewares.js\nmodule.exports = [\n  'strapi::errors',\n  {\n    name: 'strapi::security',\n    config: {\n      contentSecurityPolicy: {\n        useDefaults: true,\n        directives: {\n          'img-src': [\"'self'\", 'data:', 'blob:', '*.tile.openstreetmap.org'],\n          upgradeInsecureRequests: null,\n        },\n      },\n    },\n  },\n  'strapi::cors',\n  'strapi::poweredBy',\n  'strapi::logger',\n  'strapi::query',\n  'strapi::body',\n  'strapi::session',\n  'strapi::favicon',\n  'strapi::public',\n];\n\n\n```\n\nRun strapi and you should see the following line\n\n```\n\n[2022-06-03 10:47:25.194] info: Welcome to Strapi Postgis 🚀 + 🐘 + 🗺️ | 3.1 USE_GEOS=1 USE_PROJ=1 USE_STATS=1\n```\n\n\n\n\nNow in your content-types api folder modify `schema.json` and add a new column with the following format\n\n```javascript\n{\n  \"kind\": \"collectionType\",\n  .\n  .\n  .\n  \"attributes\": {\n  .\n  .\n  .\n    \"geom\": { //--\u003e your column name. you can change to anything\n      \"columnType\": {\n        \"type\": \"specificType\",\n        \"args\": [\n          \"geometry(POINT,4326)\" //-\u003e change this line according to the Supported Data Types section\n        ]\n      },\n      \"type\": \"customField\", //-\u003edon't change this\n      \"customField\": \"plugin::postgis.map\" //-\u003edon't change this\n    }\n  }\n}\n\n```\n\n\n\n\n## Supported Data Types\n\n### POINT\n\n![Screenshot](https://github.com/am2222/strapi-plugin-postgis/raw/main/images/points.png?raw=true)\n```json\n\"geom\": {\n      \"columnType\": {\n        \"type\": \"specificType\",\n        \"args\": [\n          \"geometry(POINT,4326)\"\n        ]\n      },\n      \"type\": \"customField\",\n      \"customField\": \"plugin::postgis.map\"\n    }\n\n```\n* POINT Z (0 0 0)\n\n* POINT ZM (0 0 0 0)\n\n* POINT EMPTY\n\n### LINESTRING\n![Screenshot](https://github.com/am2222/strapi-plugin-postgis/raw/main/images/linestring.png?raw=true)\n\n```json\n    \"g_line\": {\n      \"columnType\": {\n        \"type\": \"specificType\",\n        \"args\": [\n          \"geometry(LINESTRING,4326)\"\n        ]\n      },\n      \"type\": \"customField\",\n      \"customField\": \"plugin::postgis.map\"\n    }\n\n\n```\n\n* LINESTRING EMPTY\n\n### POLYGON\n\n![Screenshot](https://github.com/am2222/strapi-plugin-postgis/raw/main/images/polygon.png?raw=true)\n\n```json\n    \"g_polygon\": {\n      \"columnType\": {\n        \"type\": \"specificType\",\n        \"args\": [\n          \"geometry(POLYGON,4326)\"\n        ]\n      },\n      \"type\": \"customField\",\n      \"customField\": \"plugin::postgis.map\"\n    }\n\n```\n\n* MULTIPOINT((0 0),(1 2))\n\n* MULTIPOINT Z ((0 0 0),(1 2 3))\n\n* MULTIPOINT EMPTY\n\n* MULTILINESTRING((0 0,1 1,1 2),(2 3,3 2,5 4))\n\n* MULTIPOLYGON(((0 0,4 0,4 4,0 4,0 0),(1 1,2 1,2 2,1 2,1 1)), ((-1 -1,-1 -2,-2 -2,-2 -1,-1 -1)))\n\n* GEOMETRYCOLLECTION(POINT(2 3),LINESTRING(2 3,3 4))\n\n* GEOMETRYCOLLECTION EMPTY\n\n\n## TODO\n- Add tests\n- Support all the types\n- Add query options like sort by distance, overlap and etc.\n- Develop dashboard\n- Add cool pg queries and tilings ;)\n\n\n## Thanks to\n* strapi-plugin-point-list for the idea of how to add a custom components to the strapi content types\n* postgis knex plugin\n* leaflet editor plugin\n* strapi team\n* and so many other stuff \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fam2222%2Fstrapi-plugin-postgis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fam2222%2Fstrapi-plugin-postgis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fam2222%2Fstrapi-plugin-postgis/lists"}