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).

PostGIS is an open source extension for PostgreSQL that adds support for geographic objects. In effect, PostGIS "spatially enables" the PostgreSQL server, allowing it to be used for geographic information systems (GIS), much like ESRI's SDE or Oracle's Spatial extension. PostGIS follows the OpenGIS "Simple Features Specification for SQL" and has been certified as compliant with the "Types and Functions" profile.

PostGIS questions also on-topic for the Geographic Information Systems Stack Exchange site.

PostGIS has been developed by Refractions Research as a project in open source spatial database technology and is released under the GNU General Public License.

Features

  • Geometry types for points, linestrings, polygons, multipoints, multilinestrings, multipolygons and geometrycollections.
  • Spatial predicates for determining the interactions of geometries using the 3x3 Egenhofer matrix (provided by the GEOS software library).
  • Spatial operators for determining geospatial measurements like area, distance, length and perimeter.
  • Spatial operators for determining geospatial set operations, like union, difference, symmetric difference and buffers (provided by GEOS).
  • R-tree-over-GiST (Generalised Search Tree) spatial indexes for high speed spatial querying.
  • Index selectivity support, to provide high performance query plans for mixed spatial/non-spatial queries.

Tutorials:

4548 questions
1
vote
0 answers

Determine count of locations within certain distance of each other

Good Morning/Afternoon, Fairly new at SQL in general, but I've been able to put together a few queries that give me the output I need for a certain business case, but I have a new requirement that I am struggling with. In a nutshell, I am extracting…
Patrick
  • 47
  • 4
1
vote
1 answer

Use PostGIS geometry types in SQLModel

Is it possible to use PostGIS geometry types in models created in SQLModel? If yes, how can it be done?
Charalamm
  • 1,547
  • 1
  • 11
  • 27
1
vote
1 answer

Is it possible to accelerate this postgress / postgis statement?

I have a Postgres database with a postgis extention installed and filles with open street map data. With the following SQL statement : SELECT l.osm_id, sum( …
Andreas
  • 397
  • 4
  • 18
  • 37
1
vote
0 answers

MaxDistance function for Postgis?

Does Postgis have a Max Distance function for two geographies? It has ST_MaxDistance defined on two geometries: ST_MaxDistance — Returns the 2D largest distance between two geometries in projected units. But I'm not able to find a similar function…
David542
  • 104,438
  • 178
  • 489
  • 842
1
vote
0 answers

Multi_line_string stay nil after update

I added a multi_line_string field in my database : t.geometry "zmpath", limit: {:srid=>4326, :type=>"multi_line_string", :has_z=>true, :has_m=>true} If I update my table by pgAdmin, the result is persisted but the field stay empty on my update…
Ben
  • 660
  • 5
  • 25
1
vote
0 answers

Spring Boot & PostgreSQL PostGis invalid stream header: 30313031

I want to use PostGis for fetch locations on my project but the application throws this exception. 2022-12-27 13:12:32.532 ERROR 23709 --- [nio-8081-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet]…
emre
  • 41
  • 6
1
vote
1 answer

PostGIS if statement inside trigger function not recognising equality of variables

I have an INSTEAD OF INSERT function on a view that is intended to insert data into different tables, based on the SRID of a geometry data column. Inside the function, I'm unable to successfully execute an IF statement which then executes the INSERT…
1
vote
1 answer

Combine JSONB array of values by consecutive pairs

In postgresql, I have a simple one JSONB column data store: data ---------------------------- {"foo": [1,2,3,4]} {"foo": [10,20,30,40,50,60]} ... I need to convert consequent pairs of values into data points, essentially calling the array variant…
Yuri Astrakhan
  • 8,808
  • 6
  • 63
  • 97
1
vote
0 answers

Slow insert on a specific table

I have a PostgreSQL (v10.10) / PostGIS (v2.5) table of the following structure Column | Type | Collation | Nullable | Default | Storage | Stats target |…
waquner
  • 137
  • 1
  • 2
  • 6
1
vote
0 answers

Why does the query work in pgadmin and cli but not in node?

SELECT ST_Distance(USER_POLY, NEW_LOC) as dist FROM ( SELECT (select ST_transform(ST_SetSRID(ST_MakePoint( 11.61594943945313, 48.12707189053979),4326),3857)) AS RES_LOC, (SELECT ST_Transform((select u.poly …
user42141
  • 33
  • 4
1
vote
1 answer

How to merge multipolygon into one smoothly

I have multipolygon consisting two polygons. How can I merge them with a simple script so they would make polygon instead of multipolygon? I need to connect them even if it would cover the unneeded area. Also need this to work with n polygons in…
martmalo
  • 13
  • 1
  • 4
1
vote
0 answers

Upgrade PostGIS when not used as extension

I am trying to update a server containing CKAN software from Ubuntu 18 to Ubuntu 20. Due to this upgrade, Postgres is updated from version 10 with PostGIS 2.4 to version 12 with PostGIS 3. I read online many guides that suggest to use…
J.B.
  • 195
  • 3
  • 11
1
vote
1 answer

ST_DWithin function gives the same value, while trying to join two tables

I'm trying to join two tables based on their geometries, and getting the same values for columns: select poly.block_code, ST_X(points.geom), ST_X(points.geom) from public.us_blocks10_coordinates poly join public.usgs_2 points on…
1
vote
1 answer

In PostGIS ST_MinimumBoundingRadius what unit of measure is the radius of the returned number?

I have a function that I wrote in PLPGSQL to get the Minimum Bounding Radius added below (it uses the ST_MinimumBoundingRadius() function. It seems to be working because I get a number returned. However; I am not sure what that number represents. Is…
TasMot
  • 21
  • 2
1
vote
1 answer

why is geohash different from postgis?

I'm a bit confused with Geohash Geoflutterfire vs Geohash postgis, and I would like to have some explanations, please. I have a Flutter Dart application that relies on Firebase. I am using the GeoFlutterFire plugin that Geohashes the addresses for…
xuairros
  • 53
  • 5
1 2 3
99
100