New answers tagged

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' ...
user avatar
  • 23.2k
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)...
user avatar
  • 23.2k
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 ...
user avatar
  • 23.2k
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.
user avatar
  • 74.6k
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;
user avatar
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, ...
user avatar
  • 6,698
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 ...
user avatar
  • 1,722
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 ...
user avatar
  • 23.2k
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 ...
user avatar
  • 3,480
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 ...
user avatar
  • 427
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 ...
user avatar
  • 673

Top 50 recent answers are included