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

learn more… | top users | synonyms

1
vote
0answers
34 views

How to get all pixel values of raster within a GeoJSON FeatureCollection in PostGIS

I need to extract all pixel values in a raster within a GeoJSON mask, using ST_Intersects. Attempt (throws invalid GeoJson representation): select row_to_json(t) from (select * from table_name where ...
3
votes
1answer
55 views

GIST slows down query?

I have an odd case where creating a GIST index slows down my query instead of speeding it up. The setup consists of two tables, one with multi-polygons, another with points. I want to calculate which ...
0
votes
0answers
27 views

Problem with projection in pgRouting layer in GeoServer

I followed this tutorial for creating a pgRouting layer in GeoServer. When I try to publish this layer Native Bounding Box and Lat/Lon Bounding Box are not getting generated correctly. For my road ...
1
vote
0answers
22 views

Modifying PostGIS database using geoserver

I want to build a mobile app using GeoServer and PostGIS database and I am little confused about how user will interact with database. I want end users to be able to upload new geospatial data to the ...
0
votes
1answer
22 views

ST_Length(ST_ShortestLine()) equals 0, but ST_Disjoint = True

Recently, I encountered a very strange phenomenon. I have to split a multilinestring on the point of touching another line, sounds complicated but it is just preprocessing to build a graph. Now the ...
1
vote
0answers
36 views

Generate more nodes for routing

The following picture shows my routing database all set for querying loaded to QGIS. Red line is the road I want to select route from, yellow points are the vertices generated after running ...
1
vote
0answers
28 views

QGIS - Split a line having attributes with UNIQUE constraint

I am using QGIS with a PostgreSQL/PostGIS database, where the lines table (named 'segments'), besides the integer serial primary key, has a UUID column having a UNIQUE constraint. Trying to split a ...
0
votes
2answers
308 views

PostGIS broken after Ubuntu 16.04 upgrade

I upgraded Ubuntu from 15.01 to 16.04 and PostGIS is broken. Below are the errors: psql (9.5.2) Type "help" for help. osm=# select version(); version ------...
2
votes
0answers
17 views

ST_ColorMap wrongly loses 0.0 value when INTERPOLATE

I want apply a colormap to a monoband grey scale tiff from postgis calling ST_ColorMap. My query is something like "SELECT oid, lowrite(lo_open(oid, 131072), tiff) As num_bytes " + "FROM ( ...
1
vote
1answer
55 views

How to convert a PostGIS geometry stored as text back into a geometry?

I have a geometry column stored as text e.g.: '010100002091080000000000804D624041000000C066735741' in PostgreSQL db with PostGIS. This for a point geometry with the EPSG:2193. How do I convert ...
1
vote
1answer
49 views

How can rewrite this query for using with commonly used lat-long values

I have this query to get the nearest road vertices from a bus stop point. Ho can a re-write this query to pass commonly used lat-long values like in google maps instead of 715127 957625 SELECT * ...
3
votes
1answer
97 views

PostGIS - Linestring doesn't contain a Point - Problem

I have a problem to check if a Linestring contains a Point. I consider the straight line y = 0.1 x , and take by it a segment l='Linestring( 0 0 , 4 0.4 )' and a Point p on segment l, p = 'Point(1.5 ...
1
vote
1answer
41 views

Get points from polygons with extreme angles

I intend to remove points from a polygons with extreme angles like the image link Get the points Remove from linestring I make my buffer like this... SELECT (ST_Dump(ST_Union(ST_BUFFER(the_geom,...
0
votes
1answer
25 views

I have two points in my geodjango models when serializing them using drf gis one of them gets renamed and the renamed one doesn't show in haystack?

class Space(TimeStampedModel): origin = models.PointField() destination = models.PointField() origin_address = models.CharField(max_length=255) destination_adress = models.CharField(...
4
votes
1answer
81 views

Why QGIS WFS doesn't update PostGIS line and polygon layers?

I installed PostgreSQL and PostGIS and created PostGIS layers in GeoServer. But when i want to change geometry in QGIS via WFS it drops an error: ": Error performing insert: java.lang.String cannot ...
0
votes
0answers
47 views

Generating a route from an array of lat-long values in OpenLayers 3

I have developed a web application for bus tracking using GPS devices fitted on them. I am using MySQL to store and retrieve the lat-long values coming from the device. Also I have the route names and ...
1
vote
0answers
30 views

How to pass time dimension to postgis DB layer WHERE clause in Geoserver?

I have successfully configured a layer with time dimension that is backed by an SQL query to a PostGIS DB. I can query it through WMS, but I just can't find a way to pass the start and end time to the ...
2
votes
0answers
21 views

Issue loading PostGIS out-db rasters (either in QGIS or MapServer)

I'm playing with a few different options of storing raster data via PostGIS to visualize (eventually in a web app). The out-db or out-of-database storage seems the best option, but I can't seem to ...
1
vote
1answer
63 views

PostGIS ST_Difference function returns wrong geometry in result

I have a strange st_difference behaviour. I’ve got two overlapping lines (each one has two points), but st_difference result is complete geometry of the first line. The code to reproduce is here: ...
17
votes
2answers
213 views

Best-practices for databases and APIs with geographic data spanning the antimeridian

What is the best-practice for storing geographic features (lines, polygons and their multipart equivalents) when these features span the antimeridian (±180° longitude), and need to be sent to and ...
2
votes
1answer
48 views

PostGIS query to get a list of points

I have a PostGIS road network layer (all features are linestrings) which I am accessing in Python and would like to get the geometry for each feature as a list of points. Something like [(lat1,lon1),(...
2
votes
1answer
118 views

Styling a heat map based on point attribute, not density

I have a point dataset generated from getting the centroid points from a fishnet/polygon grid. I combined these points using a spatial join to give them an attribute of 'pressure' which is an integer ...
2
votes
0answers
24 views

Using PostgreSQL stored procedure with GeoServer?

I was wondering if it is possible to call PostgreSQL stored functions from GeoServer? I tried to use GeoServer's WPS to do map algebra, but found that the operations it offered was somewhat limited ...
0
votes
0answers
43 views

SRID and lat long values

I am using the following query to generate the lat long values SELECT NAME, ST_X(ST_Centroid(ST_Transform(geom, 4326))) as longitude, ST_Y(ST_Centroid(ST_Transform(geom, 4326)))as latitude from ...
1
vote
1answer
72 views

Postgis spatial join performance (point on area)

I need to update a single attribute of a large table of point data with a result of a spatial join (point on area operation) on a polygon table. I'm using the below query but wondering if this is the ...
0
votes
1answer
105 views

Seeking C++ api to read/write PostGIS?

I need read/write geometry object from PostGIS. Is there C++ library to do this?
1
vote
1answer
55 views

Complex QGIS Relations

I need QGIS to display combo boxes when editing for certain fields in a table, very similar to the functionality provided by the Relations properties in the project settings. It seems this is ...
1
vote
2answers
42 views

Saving array of objects in PostGIS field?

It is possible in PostGIS to save an array of objects in a field, and GeoServer able to read it? (timestamps) For example, a spatial table with the fields: "name", "timestamps" and "the_geom" would ...
2
votes
0answers
43 views

QGIS, connect to postgresql using windows login credentials

How to connect QGIS to PostgreSQL/PostGIS using the Windows user login credentials (Windows / Active Directory / LDAP). Is it possible? Can anyone tell me how?
0
votes
0answers
45 views

Converting polylines coordinates stored in PostGIS in column type text, in another column type geometry(MultiLineString,2154)?

I want to draw a polyline on a leaflet map and then send it to PostGis with php. I’m drawing my polylines using the Leaflet draw plugin and send the coordinates in a column “coords” in PostGIS with ...
1
vote
1answer
27 views

Getting data from postgis with hibernate is returning an hash instead of the rows

Is the first time that i use spring and hibernate starting from the basics, i need to get geometries from a postgis table populated with Qgis. I generate a persistence mapping of the table with ...
2
votes
1answer
59 views

Can I set up a PostGIS store/connection in GeoServer without user password for database?

When creating a PostGIS store in GeoServer, the guidelines I saw ask us to fill in database connection parameters including: host, port, database, schema, username, and password. This is a bit ...
1
vote
0answers
22 views

How to batch create GeoServer stores for each user?

I have unix system with a number of regular users, each with his/her own database in PostGIS. I need to create a PostGIS store for each user. I know how to do this in the web interface. Is it ...
1
vote
0answers
28 views

Request long/lat precision and request too slow [closed]

I've a PostGIS DB of 18Gb. The tab node (id, tags, geom) is very huge and I need to request long/lat on this table but it's very long when I'm using this sql request : SELECT * FROM nodes WHERE geom ...
3
votes
0answers
28 views

PostGIS - ST_SetValues is slow

I have large data in my C++ program (up to 3000x3000). I have connection to PSQL with PostGIS. Now I need to store my raster data (greyscale images) in DB raster. I am using ST_SetValues for this and ...
1
vote
1answer
65 views

Optimizing PostGIS k-nearest neighbour function for large amount of polygons?

I created a function for identifying the K nearest neighbours for every municipality, which works fine, but when I use this function for a large amount of municipalities (over 2900) it takes over 2 ...
3
votes
3answers
44 views

What is the easiest way to avoid shapefile columns being imported as PostGIS `numeric(p,s)` data type?

Considering the number of shapefiles I've imported to PostGIS (using shp2pgsql or ogr2ogr), I'm a little surprised I haven't come across this before. But I have a shapefile that has numeric columns ...
1
vote
2answers
43 views

Updating table setting a CASE with ST_Intersection

I add a new geometry column to the "mad" table so I could update it with the polygons from an Intersection with the polygons of the table "clip". Since my database is huge an it was taking a lot of ...
2
votes
0answers
33 views

WMS Layers from Azure Geoserver not loading with multiple users

I am loading multiple WMS layers into a leaflet web application from an Azure virtual machine Geoserver that pulls data from a PostGIS database on the same machine. The layers load through quickly ...
1
vote
1answer
42 views

Why can't PHP insert new geometry on PostGIS?

(Copied this question from stackoverflow, since it may have more answers here.) I'm using ogr2ogr to upload a GPX file to PostGIS. When I do it on command line (Ubuntu 14.04), it works fine. ...
1
vote
0answers
55 views

Is it necessary to use hibernate-spatial for postgis?

I'm beginner in GIS. I have a database in PostgreSQL that contains a table location, that table contains a column with type point. I have to get points and display it on google map. Once I did the ...
1
vote
1answer
28 views

Storing GML Polygon in PostGIS 2, ERROR: unknown spatial reference system

I am receiving GML as part of a larger XML message. When I receive the XML it is unmarshalled to Java objects. I have no rights to alter the schemas or the generated Java code. Therefore, I later have ...
1
vote
2answers
63 views

Calculate area parts of polygon intersections

I have a problem of calculating area sizes of intersected polygons in postgis. I would represent the problem in an example (please see the picture). I have a gridsquare table with some attributes like ...
1
vote
1answer
69 views

Finding locations within a radius of a given path [duplicate]

I am trying to figure out in Postgis the right sql statement for the following: I have in my database a table of merchants with latitudes and longitudes; I have a route from google that lists a lot ...
4
votes
4answers
374 views

Transform GeoJSON geometry to WKB

I need transform geometry from JSON like: {"type":"MultiPolygon","coordinates":[[[[-125045.48351212002,4577567.588141698],[-124816.19981552364,4577552.93014355],[-124765.99472517562,4577419.175847012]...
8
votes
3answers
209 views

Increase Tiles Caching Speed (TileStache)

I am serving vector tiles using TileStache, I have everything set up like I want. My data is stored in Postgres and I am using the VecTiles provider to serve GeoJSON tiles. I want to cache all my ...
3
votes
1answer
36 views

How to use ORDER BY GROUP BY & LIMIT

How do I use ORDER BY, GROUP BY & LIMIT in the following query through column name KPH? SELECT * FROM data WHERE ST_Within( ST_Transform(geom, 2163), ST_Buffer( ST_Transform( ...
1
vote
1answer
43 views

Area of influence with CartoDB

I am working on a city transport map, and for fun (and practice) I try to make an area of influence of transport station. But, whatever I try, something gets wrong. So two questions. 1 - How can I ...
3
votes
1answer
41 views

How to update OSM data using osm2pgsql?

I have already loaded osm data into postgresql earlier. Now I want to update the database. I have downloaded the pbf file from geofabrik. How I can update the database without deleting the existing ...
1
vote
1answer
53 views

St_ClosestPoint within St_MakeLine Query problem

I am currently trying to create the closest point (closest_ports_point_test) on the grid (lng_grid_test) from the original points (ports_point), and to create the line connecting the original and the ...