As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [postgis]

Use this tag for PostGIS, which is a spatial database extension for PostgreSQL. Before using this tag, please consider whether your question might be a better fit for the Geographic Information Systems Stack Exchange site (e.g. if it's more about configuration or geodetic principles than about actual programming).

Filter by
Sorted by
Tagged with
1 vote
1 answer
27 views

How to save WKT to postgres column with geometry data type using typeorm?

I have a table with a geom column which has the datatype of geometry. I need to save data into this table and the request being sent has the type wkt for this column. Currently there are some existing ...
Kaisin Li's user avatar
  • 470
0 votes
1 answer
34 views

Optimizing joins in a postgres/postgis query

I'm trying to optimize my Postgres query. I'm running into problems with some of the joins here. My main issue is around the filter h.type='inNetwork' and my geometry search ST_Intersects(ST_MakeValid(...
Alex DeCamillo's user avatar
1 vote
2 answers
31 views

Is there ST_Intersects alternative that allows two(or more) polygons to share sides

I am using ST_Intersects to check if two polygons intersect. Relevant part of my query is: SELECT entity_number FROM coordinates WHERE ST_INTERSECTS($1, location) It works well to determine if one ...
ABDULLOKH MUKHAMMADJONOV's user avatar
0 votes
1 answer
33 views

How to query Postgis database to pull all user coordinates from one table, within a polygon from another

I have a Postgis database with polygons in a geom::geometry column. I have table with a 'point' type column of coordinates. I want to pull all of the user_coordinates rows where their coordinate is ...
Ian's user avatar
  • 1
0 votes
0 answers
18 views

geopandas.GeoPandasDataFrame.from_postgis() raises "Unknown WKB type 41"

I am struggeling with the following issue: While running my Python3.8.10 interpreter with Jupyter Notebook (setting A), I can successfully connect to my Postgis database and query the data while ...
Kabrüggen's user avatar
0 votes
0 answers
9 views

How to import data of missing addresses into OSM local TileServer?

How to import data of missing addresses into OSM local TileServer? I am having local TileServer GL/OpenMapTiles on Ubuntu 20.04. Installed by this guidline: https://www.linuxbabe.com/ubuntu/basemap-...
Rodion Nurmukhametov's user avatar
0 votes
1 answer
20 views

Extending Postgresql extension Postgis with a C extension in Windows

I have some C code that is used on a Ubuntu server to create some extension to PostGIS. Now I want to install those functions on my Windows server (Where I now want to run my PostgreSQL server from). ...
axel_ande's user avatar
  • 339
1 vote
2 answers
37 views

Do Geometry/Geography points imply a direction?

Is the line LINESTRING(1 1, 2 2) the same as LINESTRING(2 2, 1 1) ? I would think the answer is not, if there is some directionality implied -- for example, a flight-route from Los Angeles to New York ...
David542's user avatar
  • 107k
0 votes
0 answers
14 views

Unable to find PostGIS layer using PyQGIS in a standalone script

I am working with a QGIS project (.qgs file) that references layers from a PostGIS database. I am trying to write a standalone Python script using PyQGIS that opens the project, finds a specific layer ...
Quickredfox's user avatar
  • 1,409
0 votes
2 answers
39 views

How do you connect to specific schema in Postgres? (Python, Sqlalchemy)

How do you connect to specific Postgres schema using Sqlalchemy? So I've created a new schema called "rezerwacja_domkow". I can see it in Pgadmin4. But the whole schema system confuses me (...
pj43's user avatar
  • 13
0 votes
1 answer
23 views

Postgres: how to use query in ST_TRANSLATE

I want to give the ST_TRANSLATE function a geometry composed by select st_astext(geom) from pieces where name='Large1' This is apparently not possible though, but I do not understand why since the ...
A..'s user avatar
  • 3
1 vote
1 answer
33 views

How can i write a postgres function that loops over array of arrays and concatenates all values into a string

I am trying to write a postgres function that takes an array of arrays (e.g. [[65.8434183140001,38.905535066],[65.8433595220001,38.905479615],[65.843286031,38.9054103],[65.843108611,38.9055251450001],[...
ABDULLOKH MUKHAMMADJONOV's user avatar
1 vote
2 answers
46 views

save geometry type data with timestamp in postgresql

I want to save LineString like the below in Postgresql {"type": "FeatureCollection", "features": [{"type": "Feature", "properties": {"...
MSepehr's user avatar
  • 890
0 votes
0 answers
19 views

postgis package in "apt install postgis postgresql-14-postgis-3 postgresql-14-postgis-3-scripts" makes the database change version from 14 to 15

If I attempt to install this, I receive my wished postgresql 14.8 version: sudo apt install gnupg2 wget ca-certificates sudo apt-get update sudo apt-get install vim echo "deb http://apt....
Marc Le Bihan's user avatar
0 votes
1 answer
41 views

Using a docker container within an Azure pipeline, the "geometry" type doesn't seem to be installed correctly

I cannot run the following script without receiving "42704: type "postgis.geometry" does not exist" specifically when it tries to create the location table: create schema if not ...
user15716642's user avatar
0 votes
2 answers
48 views

Why does PostgreSQL not use the index in this scenario?

I have a couple of tables in PostgreSQL 14.6, with indexes as stated here: # \d uprn Table "public.uprn" Column | Type | Collation | Nullable | ...
M Somerville's user avatar
  • 4,479
2 votes
1 answer
21 views

Can at least some parts of pgRouting run in parallel with parallel query?

Objectives I would like to run pgr_dijkstra for each pair of vertices in a routable graph. I have a simple script that takes each pair of vertices and launches a pgr_dijkstra against the database. It ...
theTruthIsOutThere's user avatar
0 votes
0 answers
22 views

Restore ABS Mesh Blocks data into postgres

I've downloaded the ABS Mesh Blocks data set. and i want to restore it into postgres db using ogr2ogr. inside the downloaded folder i've below files MB_2021_AUST_GDA2020.dbf MB_2021_AUST_GDA2020.shx ...
Inshaf's user avatar
  • 31
1 vote
1 answer
11 views

STUnion an entire column in jOOQ

I'd like to apply the PostGIS ST_Union operation on all Geometries in a column. The equivalent SQL would look something like this: select ST_Union(region) from region_geometries where ST_Contains(...
PunDefeated's user avatar
0 votes
0 answers
32 views

How can I resample polygons in postgis to a lower resolution?

I have a table in Postgres (with Postgis) that looks like this: geom val POLYGON(...coordinates) 80 POLYGON(...coordinates) 72 Each one of these polygons represents a 30m diamond square on the map....
metal bar's user avatar
  • 492
1 vote
3 answers
39 views

POSTGIS Optimize query

I have a table with a column "multip" type GEOMETRY which contains a multipolygon. Each multipolygon contains several polygons. My table is very large (12 millions records). I need a fast ...
SG92's user avatar
  • 21
0 votes
0 answers
61 views

Not an int attribute - is it a bug?

My Postgres (having PostGIS extension) crashed during this execution: SELECT MIN(LENGTH(ST_ASTEXT(way))) FROM planet_osm_polygon; The logging say: error: Not an int attribute (Producer: 'LLVM15.0.6' ...
Grim's user avatar
  • 2,752
1 vote
1 answer
214 views

SpringBoot 3, hibernate-spatial 6, PostGIS:: java.lang.ClassNotFoundException: org.hibernate.dialect.PgJdbcHelper

I am trying to migrate my current spring boot 2 application to 3. I am using PostGIS (I have not set explicit dialect so it uses org.hibernate.dialect.PostgreSQLDialect) to use the geometry column ...
Urman Ratneshwar's user avatar
0 votes
1 answer
194 views

SpringBoot 3, PostGIS:: com.vladmihalcea.hibernate.type.basic.NullableCharacterType does not define or inherit

I am trying to migrate my current spring boot 2 application to 3. I am using PostGIS (I have not set explicit dialect so it uses org.hibernate.dialect.PostgreSQLDialect), along with a few jsonb ...
Urman Ratneshwar's user avatar
0 votes
0 answers
22 views

Export geojson from QGIS in SQL

I've a geojson (postgres/postgis) file from QGIS.I want to import in my dabatase (used by Django). Is it possible to generate a SQL command ? like a dump to import later ? I've try ogr2ogr but there's ...
fabrice's user avatar
  • 1,399
0 votes
0 answers
33 views

How to zoom in extent with Postgis X/Y in openlayers v7

I have a problem to zoom the nearest possible from extent on a map with Postgis data. I have try to zoom from geometry but always land in an other location. In first place I call Postgis with this ...
florian paumier's user avatar
0 votes
0 answers
23 views

Dot net core: Persist GeoJson into Postgis get invalid GeoJson representation error

I am reading this GeoJsonFile and I convert it to geoJson string: // parse the GeoJSON string into a FeatureCollection object var featureCollection = geoJsonReader.Read<FeatureCollection>(...
Cyrus the Great's user avatar
4 votes
4 answers
215 views

Query to find account-sharing violations (superman radar)

I'm trying to implement a tracking system for a commercial product, to help with detecting account-sharing violations. To that end, the system has the following tracking table: created - date/time ...
vitaly-t's user avatar
  • 23.9k
1 vote
0 answers
31 views

django-tenants postgis with multischema

How can i install postgis extension for 2 shema? shema_1 and shema_2, my commands: CREATE SCHEMA IF NOT EXISTS shema_1 AUTHORIZATION admin; CREATE SCHEMA IF NOT EXISTS shema_2 AUTHORIZATION admin; SET ...
Kirill's user avatar
  • 43
0 votes
1 answer
65 views

Geospatial rolling average from geohashes on BigQuery

Geohashes form a grid, much like a matrix. If I have a table with a geohash7 and a value, how could I calculate say the average of all the adjacentcells on BigQuery? Sample source table geohash7 ...
TrewTzu's user avatar
  • 1,110
2 votes
1 answer
21 views

DB-SCAN giving different results in different databases

So my dataset is the same, but databases are separate. Is it expected that DB-SCAN will produce different results for both databases?
analyst92's user avatar
  • 215
0 votes
0 answers
20 views

PostGIS update field in polygon attribute table based on state it intersects with

I know I could do this quickly in Qgis, but I'm trying to learn post and SQL. I have a table containing numerous polygons across the United States with an empty field I created called "state"...
Stephen's user avatar
  • 101
0 votes
0 answers
34 views

Use pyqgis to read postgis database, return layer is always invalid

I use pyqgis to read the postgis database, and the returned layer is always invalid. I checked that the structure of the database and the connection string are correct, and I can access it correctly, ...
merin's user avatar
  • 3
0 votes
0 answers
48 views

.NET Core: convert geometry into GeoJson in API

I have a geometry type in postGis like this: In .NET Core, I have these services: builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); builder.Services.AddControllers()....
Cyrus the Great's user avatar
1 vote
1 answer
43 views

Using dijkstra in Postgres with a table containing source and target node IDs

I'm very new to this - trying to use dijkstra to find distances and routes between a list of around 10,000 people's addresses and their chosen facility. I have a small subquery (below) deriving the ...
Phil Murphy's user avatar
0 votes
0 answers
27 views

How to find distance between 2 GEOGRAPAHICAL point in PostgreSQL, PostGIS using Sequelize

I am using Sequelize for PostgreSQL / PostGIS. I have a table, station in PostgreSQL. It has a column location_point of type GEOGRAPHY. I have a user location, too. Now I want to find all the stations ...
Muhammad Mansha's user avatar
0 votes
1 answer
68 views

could not access file "$libdir/postgis-2.2": No such file or directory

I want to enable postgis in my empty database psql --version # psql (PostgreSQL) 13.3 (Ubuntu 13.3-1.pgdg16.04+1) sudo -u postgres psql \c lom lom=# CREATE EXTENSION postgis; ERROR: could not access ...
mascai's user avatar
  • 1,167
0 votes
0 answers
27 views

Sqoop export geometry column : ERROR orm.ClassWriter: No Java type for SQL type 1111 (postgresql geometry point 3945)

Using Sqoop export on CDP cluster (hdfs), I'm trying to export data geometry to Postgresql table but I'm facing a Sqoop ERROR orm.ClassWriter: No Java type for SQL type 1111 for column 'geom'. The '...
Darko37's user avatar
  • 25
0 votes
0 answers
19 views

How make a simple node API to serve GeoJSON from PostGIS?

I'm trying to write a node API that will serve straight-up GeoJSON, directly usable by apps such as Leaflet. My SQL command is this: SELECT json_build_object('type', 'FeatureCollection', 'features', ...
MidPiedmont's user avatar
2 votes
1 answer
59 views

ST_Intersects is too slow

I have table CREATE TABLE BulkContainers ( objectId int PRIMARY KEY NOT NULL, geometryType VARCHAR(10) NOT NULL, geodata geometry NOT NULL, timeFrom time, timeTo time, cityDistrict ...
Peter Chovanec's user avatar
0 votes
0 answers
22 views

Data is not visualizing in the GeoServer

I wanted to visualize my shp file in the GeoServer. But it gives this error. Could you please tell me how i can solve this issue?
Samith's user avatar
  • 11
0 votes
2 answers
39 views

How group ST_LengthSpheroid result by date?

I have a table with GPS coordinates and the time they were received. I need to get the path length by day. What is the correct way to do this in a PostGis database? But when I try to make a request ...
Руслан Омалаев's user avatar
0 votes
0 answers
54 views

how to install postgis on postgres15 on an amazon linux 2

I have Postgres-15 installed with geos-3.9.1 and postgis-3.2.1 on my Amazon Linux 2 machine. I have a problem with the installing postgis. I've built and installed everything from source. The error I'...
Abidi Ramzi's user avatar
0 votes
0 answers
22 views

Issues grouping by same values in array column

This is a little more complex than the basics so I need some help. I have a cte that returns nodes from a spatial database based on being within a certain distance. The nodes are all related as nodes ...
evan's user avatar
  • 159
0 votes
0 answers
24 views

PostGIS ST_DWithin not working as expected

I have added a column location_point in Station model. location_point: { type: Sequelize.GEOMETRY('POINT'), }, When a new record is inserted into Station, I am converting longitude and latitude ...
Muhammad Mansha's user avatar
1 vote
0 answers
25 views

Cannot run the correct version of docker postgis container

I am trying to use a postgis plugin that will only run on postgis version 3.1/3.2. After trying to deprecate the version on my local computer (and failing), I am now trying to run postgis 3.1 on a ...
EllieBevs's user avatar
1 vote
1 answer
62 views

Postgis ST_Split to split linestring into multiple smaller linestrings based on node locations

I have 2 tables, one with linestrings and an array of id values, and the other points with the before listed id values. I want to perform a slice at the node locations associated with the linestrings ...
evan's user avatar
  • 159
0 votes
1 answer
50 views

How to connect postgresql PostGIS from remote client?

I am trying to connect my PostGIS database from a remote client but receive the error: connection to server at "192.168.X.X" port 5432 failed: Connection timed out (0x0000274C/10060) Is the ...
Dan's user avatar
  • 21
0 votes
1 answer
67 views

Connection of database in QGIS with the SSH tunnel port like doing in postgreSQL maestro

How to connect the PostgreSQL database in QGIS with the SSH tunnel port like doing in PostgreSQL maestro? SSH tunnel has different ports and host the database has different ports and host Also, Both ...
Hasan's user avatar
  • 1
0 votes
1 answer
64 views

Postgis table design for creating and editing in QGIS

I am testing a postgis table (and schema) design to capture wind farm project information, so GIS (and non-GIS) data can be created/updated in QGIS. In the current table design I have a nullable POINT ...
akarich73's user avatar

1
2 3 4 5
91