Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [postgis]

PostGIS is an extension for the PostgreSQL object-relational database that adds support for geographic objects.

2
votes
1answer
36 views

shp2pgsql uses deprecated addGeometryColumn function

It is very likely that I am misunderstanding the documentation as I'm new to PostGIS, but it says here regarding the "addGeometryColumn" function that since version 2.0.0 of PostGIS: This function ...
0
votes
2answers
148 views

ERROR: parse error - invalid geometry (Postgis)

Initially I was storing my column as path and then following this question I changed it to text. I'm trying to convert my column from text to geometry type by running this command: ALTER TABLE ...
2
votes
2answers
123 views

Azimuth calculation from One to Many Points in PostGIS

I have vector data of 3D City Model in PostgreSQL database. So from my data geometry column, which is a surface geometry. (These are geometries of all the surfaces of buildings). I had extracted the ...
1
vote
1answer
43 views

PostGIS view on multiple geometry columns

I have two PostGIS tables, ‘filelinks’ and ‘maricopa_plss_qtrqtrs’. The filelinks table has a geometry type column named ‘geom_p’ and the maricopa_plss_qtrqtrs has a geometry type column named ‘geom’. ...
0
votes
0answers
51 views

Using the geometry calculator to create lines between points in QGIS 3.4?

I have a postgreSQL database layer (with a postgis extension) that updates every 5 minutes and is creating points of the current location of ships. I can't seem to figure out how to connect the points ...
1
vote
0answers
33 views

Importing Raster to PostGIS?

I am new to PostGIS - on windows 10. I have managed to install it and have a database with vector data working in QGIS. I am now trying load raster data. I have edited the PATH to point to Postgres ...
3
votes
0answers
102 views

Using related layers/tables in background?

I have postgresql/postgis database setup with one to many relationship. I can successfully set it up in QGIS but i would like to keep related tables hidden from Layers Panel to keep the project "clean"...
3
votes
1answer
78 views

Use ST_ApproximateMedialAxis with 3D geometries

It is written in docs that ST_ApproximateMedialAxis doesn't drop z-index or third coordinate, but in practice it does drop z-index and returns 2D geometry. I pass 3D geometry into ...
1
vote
1answer
49 views

Multiple shortest paths with pgRouting using a list as a secondary table

I have been using a postgis database with pgRouting to solve shortest path problems. I have been using a query like: select seq, e.geom, pd.cost, pd.id1 as node from pgr_dijkstra( 'select gid as id, ...
3
votes
0answers
51 views

ST_IsPlanar returns true even for invalid 3D polygons

We are trying to find a way to validate 3D polygons with arbitrary rotation. It seems like you should be able to do this with the function ST_IsPlanar, because it claims to "not drop the z index", but ...
2
votes
0answers
59 views

Implicitly convert Geometry to WKT string in PostGIS

Suppose I have a table defined as follows: CREATE TABLE gtest (name varchar, geom geometry); To insert, I am able to simply do this: INSERT INTO gtest VALUES ( 'Polygon', 'SRID=4326;POLYGON(...
1
vote
1answer
53 views

Getting pyqgis geometry() into PostGIS database via psycopg2 - Python 3.7 QGIS 3

Using pyqgis in a QGIS 3 Plugin, I can get features from a layer and geometry from features. Is there a way to pass the geometry into psycopg2 so that it will work in PostGIS? I did find the PPyGIS ...
0
votes
1answer
18 views

How to get the rectangular coordinates from list of line string

I have a linestring geometry in my PostgreSQL database. I want to get the corner coordinates of the rectangular bounding box. Example "...
1
vote
0answers
28 views

Can AutoCAD connect to PostGIS (specifically for Ordnance Survey Mastermap)?

As per title. Can up to date (2019) AutoCAD versions be practically/safely connected to a PostGIS database. And more specifically does this work well/practically/safely for accessing Ordnance Survey ...
0
votes
1answer
57 views

Generating 3D surface between 2 linestrings using PostGIS?

I'm trying to create a surface with a slope between 2 circles, i.e. one large external circle with a Z equal to 300 (m) and another one inside, smaller and with a Z equal to 200 (m). I should obtain ...
1
vote
1answer
42 views

QGIS 2.18: Import Result Table of a query into QGIS as pointlayer

I have a query which outputs a table with an unique nodeID and x-,y-coordinates. How can I import this query result table into qgis as an point-layer? I have tried it with the DB-Manager (see below)...
1
vote
1answer
35 views

Filter PostGIS DWithin center point SQL

Is there a way I can remove the center point from my results in a query like the following? (select * from cities where l = true and ST_DWithin(geography(cities.geog), (SELECT geog FROM cities WHERE ...
0
votes
1answer
33 views

How to get something like psql within QGIS?

Does QGIS have something where I can type a PostGIS query, hit execute and it adds the results as a Layer in QGIS? I realise I can create a view or table then open it in QGIS, but that becomes ...
0
votes
0answers
34 views

No geometry when importing 3D building model GML into PostGIS

I'm attempting to import a GML file containing 3D building models into PostGIS using ogr2ogr. ogr2ogr -f PostgreSQL PG:"host=${hostname} port=${port} dbname=${db} \ user=${user} password=${...
1
vote
1answer
24 views

WFS filter on entire row?

With PostgreSQL I can query an entire row for a string: SELECT * FROM table_name WHERE table_name::text LIKE '%string%'; Is there an equivalent (CQL?) for a Geoserver WFS serving PostGIS data? I've ...
2
votes
1answer
96 views

Importing GeoJSON into PostGIS with Python

I am trying to import GeoJSON file with Python to my PostgreSQL db. Here is full code: with open('C:/xampp/htdocs/app/data/'+a) as file: gj=geojson.load(file) for feature in gj['features']: geom=...
0
votes
1answer
57 views

Getting Latitude and Longitude from a Linestring

I have a linestring geometry in my Postgres database. I wanted to extract the latitude-longitude coordinates of each point inside the linestring. Example "...
2
votes
1answer
79 views

Cannot see PostgreSQL-tables in QGIS as a 'non' super user

I have established a connection between QGIS and PostgreSQL. As long as the active user has the 'Super User'check-box enabled, all works well. From the moment I disable it only the Schema's remain ...
3
votes
1answer
64 views

Use NTv2 grid files in PostGIS ST_Transform

This question is related to How to use gridfiles (*.gsb) in QGIS Situation is the following: The nationwide standardized gridfile for the transformation of geotopography data BeTA2007 is long since ...
0
votes
2answers
56 views

ST_GeomFromText fails on syntax error inside tuple of coordinates?

I am receiving the following error when trying to execute ST_GeomFromText(wkt) psycopg2.ProgrammingError: syntax error at or near "1187780.76" LINE 1: ...0822.05,(ST_GeomFromTEXT(POLYGON ((...
2
votes
1answer
38 views

UI in QGIS for a UML class with multiple cardinality attribute

For example: a "way" class with a name[1:n] attribute. Mapping the UML class to SQL you can get something like: create table way ( id serial not null primary key, geom geometry, ...
1
vote
0answers
21 views

TableToTable_conversion using PostgreSQL and ArcPy

Currently, I am trying to convert a geodb to a table in my PostgreSQL db with arcpy as such. I've tried both with the parcels table being created and the parcels table not being created arcpy....
2
votes
2answers
120 views

Creating point at defined distance along line in PostGIS?

How do I create a point at a defined distance along a line? I know we have ST_Segmentize, but it creates more than 1 points - I only need 1. What I want is: For each line: Create ONLY 1 point at ...
0
votes
0answers
48 views

Mark Dangle Error for linestring

I will create buffer for 5 meter in start point of line string, If any other line string is within the buffer but not snapped then to mark as the startpoint as dangle error.I have attached the sample ...
0
votes
0answers
34 views

PostGIS, Generating a city “code” for every city on earth

I'd like to be able to query a PostGIS table with a lnglat and have it return a four letter. The point [180, 90] should return AAAA, and the point [-180, -90] should return ZZZZ. Kind of like this: ...
1
vote
1answer
76 views

Line String Self-Intersection points in PostGIS

I'm trying to get all the points from a Self-Intersection Line String but not find out the self intersection point in the below attached image. The intersection point touches on the same feature how ...
0
votes
0answers
77 views

QGIS displaying polygon that is crossing the 180 meridian

I have the following table create table schema.table ( id bigint, geography geography ); with the following geography INSERT INTO schema.table (id, geography) VALUES (1, '...
1
vote
0answers
73 views

SP-GiST for geography type in PostGIS

This CREATE INDEX geography_gdx ON schema.table USING GIST (geog); works, but CREATE INDEX geography_gdx ON schema.table USING SPGIST (geog); gives me [42704] ERROR: data type geography has no ...
0
votes
0answers
51 views

Spatial query using PostGIS

I'm doing a spatial query in PostGIS wanting to get all objects within a given polygon or with some feature inside that polygon. PostGIS only returns objects that are inside the polygon. Those objects ...
0
votes
0answers
28 views

How to handle Update error: Transaction does not have authorization for mytable3:mytable3.5?

I am building collaborative mapping app using openlayers 5.3.0, geoserver 2.14.0 and postgresql 10.4. I want the user to be able to update features using wfs-t but before updating, the user needs to ...
0
votes
1answer
33 views

How can I check that a PostGIS database (schema) is correctly backed up? [closed]

I'm something of a novice user of PostGIS. I have some valuable data in a single schema on a PostGIS database. I believe that I've saved a backup of the data etc to a local file using pgAdmin - but ...
0
votes
0answers
100 views

How to convert geometry in the GeoJSON from PHP and insert polygon in PostGIS

I'm a beginner in PostGIS and GeoJSON. I need to extract every geometry from GeoJSON and store them in the PostGIS database as polygons. For each entry in GeoJSON I would like to be able to store ...
1
vote
0answers
12 views

Need to convert coord_dimension from 4 to 2. File contains 2D polygons

I am working with PostGIS Bundle 2.5 in PostgreSQL 11. I loaded a MultiPolygon file from a geodatbase and I need to append the geometry table to an existing geometry table. However, the coordinate ...
0
votes
0answers
28 views

Cartodbfying and using ghost tables in CartoDB Enterprise?

I'm using Carto Enterprise, and I need help on making custom DB tables show up in Carto builder page when you log in. So far I've turned ON the ghost_tables feature like this. /opt/carto/builder-...
1
vote
1answer
60 views

Does the PostGIS ST_AsMVTGeom function perform geometry simplification on the fly?

PostGIS now comes with a set of functions that allow to generate Mapbox Vector Tiles. Among them, the ST_AsMVTGeom allows to transform a geometry into the coordinate space of a tile (typically ...
0
votes
0answers
28 views

Django raster, not add raster to BD Postgis

I am new in this world, and I am trying to make Django Raster work, I have already followed all the instructions of: https://django-raster.readthedocs.io/en/stable/installation.html But at the moment ...
0
votes
0answers
21 views

List of outdated tiles without using psql/osm2psql

I have a .mbtile file containing tile data from OSM. I'd like to keep the .mbtile file up to date with the latest changes from OSM. I don't have a postgres running locally that I could update using ...
0
votes
0answers
26 views

How to retrieve GIS data in Multiple Orthophoto at point level

I have been using a python script that can read Data from Orthophoto(*.tiff) of size 300Mb-2Gb. But this is taking 32s per request of lat-long, which is not ok. I have different Orthophotos with ...
3
votes
1answer
104 views

Get exterior ring of a multipolygon using GEOSGeometry or PostGIS

I am trying to get the exterior ring of the multipolygon in the image below using GEOSGeometry (through GeoDjango) or Postgis, but I have not found an easy solution. This is an example of a ...
0
votes
0answers
48 views

Matching streets in two line datasets with PostGIS or QGIS?

Explanation: I have 2 tables on PostgreSQL, one table named 'city' that have linestrings wich represents streets from a city (using QGIS I downloaded OpenStreetMaps data and imported to PostgreSQL ...
1
vote
0answers
62 views

What is geometry(4326), and can you do Cartesian calculations with unprojected ellipsoidal coordinates?

I know Geography(4326) is an unbounded, and unprojected, and covers the entire world with ellipsoidal coordinates. I get that the math on this system is done on a spheroid. I also get that with a ...
1
vote
0answers
43 views

Performing PostGIS spatial joins with remote host?

I have approximately 600,000 points that must be joined to ~12 million polygons. This process happens weekly, with the potential to happen daily. The polygon data never changes, and is stored in a ...
-1
votes
1answer
101 views

How best to divide line features into equal parts and create continuous buffer zones for them using Postgres/PostGIS and QGIS [closed]

Having familiarized with an similar question specified on the link Dividing a buffer into segments based on path and distance, the author asked an analogous question whether it is possible to solve ...
0
votes
0answers
26 views

full python 3 script to load shp file inpo Postgis file

I am using Python 3 libraries to programmatically push a shapefile into a remote POSTGIS data base. I retrived the code googling aroung and slighty modifing it. Here the script: import pandas as pd ...
0
votes
0answers
38 views

PostGIS - Nearest Neighbour Join to sum values

I have a table of polygons T1 and a second table of points P1 Each point has a value I want to sum the values of P1 for each T1, with P1 being the closest set of points to T1 At the moment the only ...