New answers tagged postgresql
3
votes
Accepted
Get geohash neighbors with PostGIS
I had have to do this a while ago, but I had to recreate from the top of my head here; this should be correct for all but the top-level 1-digit hashes¹:
WITH
geo AS (
SELECT
'dqcjqc' ...
6
votes
Accepted
How to make column in view to have correct srid of origin table
You need to properly cast the column type to include the respective type modifiers like so:
CREATE OR REPLACE VIEW myview AS
SELECT
a.id,
ST_SetSRID(dmp.geom, 25832)::GEOMETRY(POLYGON, 25832)...
4
votes
Accepted
Adding a polygon to a multipolygon column
I strongly recommend using a trigger to work this out - apart from some other things they have less confusing side effects, and can be extended much easier:
CREATE FUNCTION ...
0
votes
Adding a polygon to a multipolygon column
Something using st_multi should do it:
UPDATE mytable set geom = st_multi(polygon);
should do it for you.
1
vote
Use PostGIS to find all the most outer points
Thanks for some good comments I made it work using.
SELECT ST_ASGEOJSON((ST_DumpPoints(ST_ConvexHull(st_collect(geog::geometry)))).geom) FROM sources;
0
votes
Geometry Viewer in pgAdmin 4 displays a straight line instead of polygons of European union countries
You probably need to change -- by using ST_Transform() -- the coordinate reference system (CRS) of your geometries, e.g. by using such query instead of a standard SELECT:
SELECT
ST_Transform(geom, ...
0
votes
Calculating the distance For each Row with respect to a Common Point
It looks like 'port.longitude' and 'fac.latitude' are correctly replaced in your f-string, but 'Warehouse.longitude' and 'Warehouse.latitude' are not and are left as string. The reason is you try to ...
1
vote
Accepted
PostGIS function that updates WKT geometries to geometry type with st_geomfromtext
Before the update:
Run
SELECT
pa.attrelid::REGCLASS, pa.attname
FROM
pg_attribute AS pa
WHERE
pa.attrelid = '<schema>.<table>'::REGCLASS
AND
pa.attnum > 0
AND
pa.attname ...
0
votes
QGIS asks for PostgreSQL credentials multiple times
In my case, removing the "sslmode=disable" text from each y the .qgs file solved the issue.
Looks like new layers added in my project do not add the sslmode param and old ones (maybe added ...
2
votes
PostGIS performance using ST_Subdivide
Hello @marieneighe If I were in your shoes, my question is only;
To Subdivide or Not To Subdivide
As a matter of routine I refer to the below when a new dataset comes in
Do a test on the size of the ...
1
vote
Accepted
How to add KML file to PostgreSQL as polygon in nodejs
You are looking for ST_PolygonFromText. You need to modify your coordinates string beforehand. If you have z values you need to keep the third value (always 0 in your case), if not you need to pop ...
Top 50 recent answers are included
Related Tags
postgresql × 3907postgis × 2753
qgis × 569
sql × 305
pgrouting × 243
openstreetmap × 191
geoserver × 163
postgis-2.0 × 156
python × 123
raster × 114
shapefile × 106
geometry × 105
arcgis-desktop × 93
ogr2ogr × 90
enterprise-geodatabase × 85
osm2pgsql × 85
polygon × 84
query × 74
carto × 73
gdal × 72
database × 71
coordinate-system × 69
geojson × 66
spatial-database × 57
pyqgis × 53