Stack Exchange Network

Stack Exchange network consists of 174 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
81 views

Not able to install postgresql-10-postgis-2.4 in Ubuntu 18.04

I am not able to install postgis. $ sudo apt-get install postgresql-10-postgis-2.4 libgdal20 libhdf5-100 libnetcdf13 libgfortran4 Reading package lists... Done Building dependency tree ...
2
votes
1answer
37 views

LineLocate a sequence of points, preserving order

I have a linestring, which represents a bus route, and a sequence of points in order, representing the coordinates of each stop of that route. It kinda looks like this (pardon my poor drawing skills): ...
1
vote
1answer
28 views

ST_Intersects one polygon with layer - always returns 0 results

I'm trying to write a query to find if any features in a layer intersect with a certain polygon, but it is always returning 0 rows. I've tried messing with SRIDs, different geom types, sizes, shapes, ...
1
vote
0answers
18 views

parse_address Error when using Street2 splitter '@'

I'm trying to use parse_address to parse client data and am finding that the split code "@" to tell it where to split address 1 and 2 gives erroneous results when used. If used, the street number is ...
1
vote
0answers
40 views

PostGIS and connection to QGIS issue?

I have a problem with PostGIS and a connection to QGIS. I successfully connected to a database on a server but when I try to add a PostGIS Table, I am getting warning symbols next to all my tables. I ...
2
votes
0answers
38 views

How can I use the SFCGAL version of ST_Union?

I'm trying to combine a bunch of geometry boundaries to get the linework of their borders, but I'm getting an error with the default, GEOS-based ST_Union: SELECT ST_Union(ST_Boundary(geom)) FROM ...
8
votes
1answer
344 views

How can I optimize a Point in Polygon query for millions of points when most of the points lie within the polygon?

I have 150 million points in a point table and would like to find the few points lying outside a given polygon geometry. I know that 99.9% of the points are within the polygon geometry. I am ...
0
votes
1answer
23 views

Intersect lines and polygons [closed]

I am tring to intersect lines with a polygon grid, but i got an error when i run this: create table "st11_01_vd" as SELECT ( "grid_1km.gid", "st11_012017_ln.linetime", ST_INTERSECTION("...
0
votes
0answers
36 views

GeoPandas ParseException: Invalid HEX char error

I am trying to read a geospatial table from a PostGIS database on PostgreSQL. Using the funcion sql = '''SELECT ST_AsText(geom) AS geom FROM my_table;''' df = gpd.GeoDataFrame.from_postgis(sql, ...
4
votes
2answers
42 views

OSM Line 'way' from PostgreSQL (PostGIS) to Java Linestring (from JTS library)

I would like to read the data from PostGIS OSM database to Java object. I have 'planet_osm_line' table. I'd like to get 'osm_id' and 'way' column read by ResultSet, as here: stmt = con....
3
votes
1answer
145 views

PostGIS ST_Intersects is slow and doesn't seem to use spatial index

There are several threads about ST_Intersects being slow (like this one). Main advise is to use spatial index. Well I know that and created spatial index beforehand, but the query is slow nevertheless ...
2
votes
0answers
28 views

Trigger - Calculate area of a layer inside feature by changing the inner layer

Working with PostGIS database and QGIS, I have two polygons layers, an external with land lots (lotes) and an internal with building area (areaconstruida). In the "lotes" layer, I need a field in ...
1
vote
0answers
56 views

Query for finding intersection points between adjacent features within a buffer tolerance - PostGIS

I've developed the queries to find out intersection points (within 0.2 buffer) between line and polygon and also within adjacent polygons by using PostgreSQL 10 and PostGIS 2.4 database. Line data is ...
0
votes
1answer
75 views

Finding self-intersection in PostGIS

I've developed an query to find self-intersection points by using PostgreSQL 10 and PostGIS 2.4 database. The query took long time (aprx 90mins) to produce the result from 3,122 polygons. The query is:...
1
vote
1answer
35 views

Trigger - Calculate area of a layer inside feature

I'm trying to create a trigger to auto-fill a field of a table in postGIS based on two polygon layers geometry. I'm using QGIS for geometry updates. The first layer (lotes) has bigger polygons and ...
0
votes
2answers
61 views

Multipoint to point tool in Qgis

I have a multipoint adress layer creating problems with set-returning function cannot be used. I tried : Converting multipoint layer to point using PostGIS? Multipoint vs point PostGIS I tried ...
0
votes
2answers
23 views

PostGIS Tiger Geocoder Not returning, stno, street, styp for geocoding

I recently loaded TIGER 2018 data for California. After fixing all the errors I have loaded all the data into the database. I checked each of the tables and all of them contain data. From this ...
2
votes
0answers
66 views

PostGIS ST_LineMerge: why do 3 lines not merge, but any 2 do?

In PostGIS, ST_LineMerge is used to "stitch" several lines into a single linestring. If it cannot, it returns the original multilinestring. I have a scenario where I have three lines in a set. They ...
1
vote
1answer
36 views

PostGIS ST_Intersects result is ignored by where condition

I have a simple query filtering by st_intersects function finding all lines intersecting with a polygon. select *, st_intersect(graph_line, st_geomfromtext('POLYGON((261 156,148 452,333 507,566 199,...
-1
votes
0answers
17 views

Problem by Enter Credentials when adding postgis to qgis

Yesterday, I downloaded Postgresql, I followed the instructions of some tutorial, set username, password etc... I would to connect qgis to postgis, from layer menu, add postgis layer, new connection, ...
0
votes
0answers
43 views

PostGIS DISTINCT ON clause

I have two tables essa -- thousands of polygons narrowed -- few hundred parcels My goal is to find the closest parcels to each essa polygon. it happens to be many of the parcels are the closest ...
1
vote
0answers
60 views

How to build a route that traverses every edge at least once and begins and ends at the same location?

I have a collection of lines in PostgreSQL w/PostGIS/pgRouting and have built topology. I need to produce a route that starts and ends at the same location, but traverses all of the edges. Can ...
1
vote
1answer
45 views

Is PostGIS ST_Distance equivalent to QGIS distance to hub?

I'd like to make the equivalent function of QGIS's distance to hub algorithms. Is ST_Distance the right approach to start with? Or is that algorithm transposable into something I can let Postgres ...
3
votes
1answer
66 views

Extending a segment in QGIS to check intersection with a polygon

I am trying to find the adress points (red dots) located in front of an obstacle (red polygon). The street is green and the pink line represents the street face (Si). This is what I have so far, but ...
0
votes
0answers
38 views

Allow access to PostgreSQL database only through QGIS plugin

I created a Python plugin in QGIS that manage the connection to my PostgreSQL database and loading layers in a specific structure, I've created also some personalized widgets to edit attribute tables ...
0
votes
1answer
43 views

Can I copy a PostgreSQL/PostGIS database to a file? [closed]

I want to have a full copy of a PostgreSQL/PostGIS database from a server to my portable usb/hard disk and then transfer it into a new server that I will create. Is this possible?
0
votes
0answers
65 views

ArcGIS vs QGIS vs PostGIS projection issue

Windows 10, ArcGIS Pro, QGIS 2.18, pgAdmin 4-postgreSQL I have two (sample area) PostGIS tables in a PostgreSQL database: building_polys (SRID: 27700) -OS MastermapTopo address_points (SRID: 4258) -...
1
vote
0answers
76 views

Export standalone qgis model

I'm totally new to the field of GIS. I want to create some GIS-models and publish them on my website. Therefore the models should be connected to my database to constantly have the most recent data. ...
2
votes
0answers
110 views

PostGIS queries result in “Symbol not found: __ZN5boost6system15system_categoryEv”

I seem to have lost the ability to use basic postgis queries. Normal postgres queries are unaffected. Using Mac (High Sierra), using postgres 10.5 / postgis 2.4 (probably) The same error happens ...
0
votes
1answer
44 views

Inserting Point into PostGIS geometry column from golang?

I have this go code to insert data in to postgresql: sqlStatement := ` INSERT INTO my_table ( column_name, geog) VALUES ($1, ST_GeomFromText('Point($2 $3)')) ` and then _, err = db....
1
vote
1answer
34 views

Get Bounding Box of Each Polygon (Each Rows in a table) using PostGIS

I have zoom level 4 polygons of the world (in EPSG 3857) and I am trying to get the bounding box of each tiles. this is the query that I used but this is not working. select title, id, st_extent(...
-1
votes
0answers
14 views

Offline Sync in QGIS to POSTGIS DB - Sync Failing - Reverting changes

Plug In: offline sync Program: QGIS 2.18.26 connected to POSTGIS database System: MAC OS High Sierra 10.13.6. When I am trying to sync the offline project back to POSTGIS with the offline sync plug-...
3
votes
0answers
43 views

Dealing with bridges over roads in PostGIS topology?

first time posting please ask for more details if not enough provided. I am using OSM road data and have created postgres topology for them. I am now cleaning up the data before exporting it for ...
0
votes
1answer
14 views

NodeJS Geometry string from GPS coordinates before sending to DB?

I'm building an application that saves geographical data to the postgresql db with postgis extension. The data I'm saving is in EPSG 4326 WGS84 format, so I'm sending lat/lng coordinates to the ...
2
votes
1answer
53 views

Select layer by location in PostgreSQL

I have a footprint of some buildings (see the picture). The selected buildings have an area below 30 sqm. As you can in the picture see some buildings share almost borders with a building bigger ...
1
vote
1answer
50 views

Find polygon boundary dynamically based on a point (lat/long) having type farmland using OSM

There are many ways to retrieve the polygon information when you know that the information is already present somewhere (data locally or in database containing extracted info about polygon). But this ...
2
votes
1answer
45 views

List table names within PostGIS bounding box

So I have a bounding box drawn by the user on Leaflet from which i can get features of specific table as follows SELECT * FROM $table WHERE $table.geom && ST_MakeEnvelope($test, 4326) where $...
2
votes
1answer
170 views

How to solve “libintl-9.dll is missing” when trying to run PostGIS 2.0 Shapefile and DBF Loader Exporter

When I try to run PostGIS 2.0 Shapefile and DBF Loader Exporter I get the following error: The program can't start because libintl-9.dll is missing from your computer. Try reinstalling the ...
0
votes
1answer
31 views

PostGIS - Snapping a point to a line doesn't work

I'm trying to snap one polygon to another, and I found that not all points are being snapped as expected. I tried to simplify the issue to make it all clear, and created this dummy example: SELECT ...
2
votes
1answer
59 views

Trigger PostGIS QGIS

I have 2 layers on PostGIS: a point layer named 'tdia' and a polygon layer named 'com': -the com layer contains the city name. (Polygon) -the tdia layer contains bus stops. (point) I want to create a ...
1
vote
1answer
430 views

QGIS 3 - Online POSTGRESQL database error “undefined symbol: GEOSFrechetDistanceDensify”

Using QGIS 3 on mac book air and set up a POSTGRESQL database with Acugis 6 days ago. Everything's been working fine and no issues. The yesterday everything went off and was unable to see the layers ...
5
votes
0answers
33 views

Shp2pgsql encoding issue / error. Special latin /utf characters (áéíóú) are wrong

I am not able to load accented vowels coming from a Shapefile, to a PostGis geodatabase. This is my information: Operative System: Windows 10. PostgreSql Database: postgresql-10.5-2-windows-x64.exe. ...
1
vote
2answers
46 views

Ring geometries in pgRouting OSM DUMP

After performing pgRouting's "pgr_analyzeGraph" algorithm, over an Open Street Map dump uploaded to my PostGIS DB, I get this output, by I can't figure out what "ring geometries" are. Does somebod ...
2
votes
0answers
42 views

Why use GeoServer or Tegola to generate vector tiles from PostGIS rather than ST_AsMVT? [duplicate]

I don't have much experience generating vector tiles dynamically. Instead I use Tippecanoe. I'm looking at generating tiles from PostGIS and see at least three options: PostGIS + Geoserver (with ...
1
vote
0answers
82 views

Is PostGIS faster than Shapely [closed]

I've recently tried using Shapely to dissolve and intersect large sets of 100'000+ geometries, some of them quite complex. This would take me at least one hour, at which point I would usually shut the ...
1
vote
1answer
40 views

PostGIS: Problem with SRID conversion

I am new in PostGIS and I am trying to convert a geometry field to GeoJSON Lat/Lng for visualization in a map as a layer. I had a .HSP file that I exported to PostGIS with OpenJump program. The .prj ...
0
votes
1answer
56 views

Is there a way to create pixel centroids inside polygons with PostGIS ?

I am trying to find a solution to do the function of the QGIS-tool 'Generate points(pixel centroids) inside polygons' in PostGIS. In the picture below you can see the output. Is there a way to do it ...
2
votes
0answers
54 views

Topology Network in PostGIS database

I'm returning to the same question all over again. I'm dealing with electrical network and I'd like to build topology for all network lines in database so I can construct nodes and edges dynamicly for ...
0
votes
0answers
26 views

osm2pgsql stops after importing several extracts

I want to import several city extracts from the bbike website into my postgis database. I use windows on a desktop pc with 16GB RAM and a quadcore processor. The first couple of extracts imported ...
0
votes
1answer
48 views

ST_ClusterDBSCAN in PostGIS gives me 0 for the cluster ID

I am trying to cluster latitudes and longitudes from a dataset containing locations in Germany (n=52612, about 9000 without duplicates). I am running the DBSCAN algorithm, but for none of the ...