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

learn more… | top users | synonyms

1
vote
0answers
68 views

Help serializing a postGIS query to geojson

I have a query which I would like to serialize to geoJSON: select article_title, pub_date, city, geom from article, location where article.id = location.id; I can serialize the geom field easily ...
0
votes
1answer
59 views

Check if point is inside unclosed linestring using POSTGIS ST Functions [closed]

I have a table with spatial data. This table contains a single record which is a unclosed linestring. I calculated the Centroid of this geometry using query SELECT ST_AsText(ST_Centroid("geom")) ...
0
votes
1answer
32 views

Converting spatial data to table of vertices using PostGIS?

I have a spatial data table in PostGIS 2.1 that looks like this: Geom | type | cost POLYGON(0 0,1 1,2 2)| A | 123 POLYGON(3 3,4 4,5 5)| b | 123 I am trying to create a ...
8
votes
1answer
159 views

How fast should I expect PostGIS to geocode well-formatted addresses?

How fast should I expect PostGIS to geocode well-formatted addresses? I've installed PostgreSQL 9.3.7 and PostGIS 2.1.7, loaded the nation data and all states data but have found geocoding to be much ...
0
votes
1answer
41 views

Utilizing OSM Data in a Postgres/PostGIS database in ArcMap

I've been trying for over a week now, and I'm not sure what i'm doing wrong and I haven't found the answer yet. I am trying to display and symbolize the OSM dataset over Jordan in ArcGIS for Desktop ...
3
votes
1answer
65 views

How to change the “application_name” of a PostGIS-connection in QGIS?

PostGIS offers a view called pg_stat_activity, where you can see all the active connections to the database. This view includes the interesting column application_name. When a connection comes from a ...
1
vote
1answer
46 views

How to create regular point grid inside a polygon in Postgis without knowing cell size but cell number?

I need to create a grid within a polygon like it is done in How to create regular point grid inside a polygon in Postgis? There a function is created to draw the grid points. But necessary to know ...
0
votes
1answer
40 views

QGIS DB Manager - load as new layer not loading

After successfully running an SQL query on two tables and some results in 3 columns, I would really like to be able to display it in the canvas. Apparently, that function is not doing anything, not ...
1
vote
1answer
43 views

PostGIS 3D bounding box query that envolves all 3 axes (xyz)

I have some experience with PostgreSQL, but not with PostGIS, and for the life of me I can't make my bounding box take the Z axis into account. I have a points table with XYZ columns. I add another ...
1
vote
1answer
75 views

Number of Neighbors Around a Point

I need to get a count of neighbors within 100m for each point in a set of 250 million points. The result would have the id of each point accompanied by the number of neighbors around them. Can this be ...
1
vote
1answer
29 views

Best way to filter points given a starting point and max travel time

I have a database of about 1M geolocated addresses and I'm looking for a way to sort/filter these records based on a starting point and max travel time. Ex: "find every baker shop within 30 min ...
0
votes
0answers
26 views

Merging DEM files using PostGIS

I have several DEM files and I want to merge them to create a mosaic. I found the St_Union(raster) or St_MemUnion(raster) functions but I don't know how to use them. Are there any other solutions?
0
votes
1answer
161 views

How do I explode a MultiLineString using ST_Dump() in PostGIS?

I want to do what this blog post does: explode a MultiLineString into individual LineStrings. I'm using CartoDB but don't get individual LineStrings as the result of my query. I still get a ...
1
vote
0answers
46 views

OSM Bright Cartography XML

So I've successfully setup a tile server as described here: https://switch2osm.org/serving-tiles/manually-building-a-tile-server-14-04/ What's troubling is the lack of clarify surrounding OSM Bright ...
0
votes
0answers
17 views

polygonize some raster pixels based on their value in PostGIS

I need to extract and polygonize only those pixels of a raster that have a value (e.g.) greather than 2000.0 The reason is that I wish to do an operation like the following one (which is done only on ...
0
votes
0answers
47 views

Use QGIS and Qt dialog forms

I have a QGIS project where there are plots with a attributes like name of the owner, address of the owner, cultivate, and so on. This plots are read from a PostGIS database. The future users of this ...
0
votes
1answer
29 views

Using virtual or temporary geometry with PostGIS and pgRouting

I am attempting to find the shortest/fastest routes from GPS point to GPS point as described in this post: Create closest point on multilinestring to use in shortest_path() I have seen many solutions ...
1
vote
0answers
29 views

Displaying multiple features from a geoserver layer with time and style in a KML

I have 4 datasets organized in a PostGIS database each of the same geometry and location except they are at different times. They each have a corresponding datetime field. I can load these into a ...
1
vote
0answers
21 views

Selecting all pixels above a given value in a raster in PostGIS

I have a raster with one band whose value represents the date of the occurrence (a sequential integer). This raster file gets updated regularly, and each time that happens, I need to run a process ...
1
vote
0answers
84 views

Rendering TopoJSON in Leaflet from GeoJSON PostGIS output?

I'm using the query found here SQL query to have a complete geojson feature from PostGIS to get a geojson that I can display on a leaflet map. However, the amount of data is kinda big and the ...
0
votes
0answers
66 views

OL3 doesn't display the wms Layer

This is pretty much related to the question asked in the following link How to add Mapserver WMS to Openlayers 3 I followed the example in ...
1
vote
0answers
28 views

Merge raster tiles in PostGIS

I have several raster tiles that are adjacent and non-overlapping, so they form a mosaic. I am trying to merge two adjacent rasters using PostGIS but am getting an error that they do not have the same ...
0
votes
1answer
22 views

Reprojection not generating properly the tiles

I am executing this query with cartodb.js. I am moving the markers radomnly to generate a new layer. cartodb.createLayer(map, { user_name: 'mickemr', type: 'cartodb', sublayers: ...
3
votes
1answer
47 views

Postgis query on 3D cube does not use index

I am testing Postgis on the follow query: SELECT * FROM particles WHERE position &&& 'LINESTRING(0.08537 0.0738 0.0145,0.0953 0.0837 0.0345)'; that returns about 100k rows from a ...
0
votes
1answer
37 views

How to cut contour lines at the edge of a data source

I have calculated some contour-lines using gdal-contour for two elevation model into a Postgis database. One is high res and the other lower res. Now I am seeing problems at the edge of my high ...
0
votes
0answers
35 views

How to arrange polygon in Postgis

I have a lot of polygons in a Postgres database. I want to show the polygons, but in order of the the biggest to the smallest. I used the following code: SELECT ST_Area(area_polygon) as luas FROM ...
0
votes
1answer
48 views

Problem with spatial index PostGis

I'm using Postgis 2.1. I have this table with about 50k rows: CREATE TABLE rilevazioni ( geom geometry(Polygon), stimolo integer, tmstmp timestamp without time zone, id bigserial NOT NULL, ...
1
vote
1answer
80 views

Matching GPS points to the road network

I am a newbie in Postgres and Postgis and I am trying to do a matching of GPS points to the road network. I need to find closest road from a shapefile and take speed attribute from it. I am using ...
4
votes
3answers
177 views

3d vector and geometry operations in open-source GIS

There is some really good open-source software available to work with 2D vectors. For example QGIS has operations like buffer / clip / dissolve / select by location / join attributes by location... ...
0
votes
0answers
15 views

How to store a circle in PostGis database row [duplicate]

I'm using PostGis 2.1. I need to store different type of geometry like polygon 2D,polygon 3D and also circle. I need these polygons represent areas in which an event occurs. Then I'll have to do ...
2
votes
0answers
72 views

How to create line segments between pairs of pixels in a raster?

I want to draw several lines between pixels (please see the image below) according to some criteria : First Criterion: The distance between 2 pixels is less than 2000m and greater than 500m ...
1
vote
1answer
70 views

ST_Intersection for polygons

I'm looking for a query that returns overlapping areas of two tables with polygon geometries. Using row_number() over() the entries of the gid column are not unique in the case of dumped ...
0
votes
1answer
53 views

Find shortest path between two points without spatial database

I have an an certain area contains less than 200 roads(polylines), and I need to calculate a shortest path between two specified points inside the area. I know maybe I can use the pgroute in postgis ...
2
votes
0answers
39 views

Import OSM Notes dump into PostgreSQL?

I'm planning to write some software to improve handling of OSM Notes, so I need them in postgis database. Following the documentation I found there is notes dump on osm.org, but I can't find if ...
2
votes
0answers
66 views

Visualizing variability in the size and shape of polygons

I am working with a data set of area restrictions imposed by criminal courts. These restrictions ban a person from entering a demarcated area. These restrictions vary in their size, shape, and ...
1
vote
1answer
35 views

simplify tiled geometries while preserving anything on the edge

I have a dataset of polygons split into evenly sized tiles. How can I go about simplifying them, but not along the tile edges, so that there aren't any gaps between continuous features when the tiles ...
0
votes
0answers
56 views

Why is mapserver returning a blank image?

I am trying to load a layer from a postgis database, mapserver does not return anything. I think I have narrowed the problem down to the fact that the sql query mapserver is running is returning ...
1
vote
1answer
70 views

Determine XY offset in meters between two lat/long points (EPSG:4326), and accurately recreating point locations using XY offset

I have two tables in EPSG:4326, one for home locations and one for site locations. I need to be able to generate the XY offset in meters between the home location, and the site locations. I then need ...
2
votes
1answer
35 views

ArcGIS resampling rasters by maximum pixel value?

I need to resample a binary image of linear features like roads, rivers to a coarser resolution, conceptually combining multiple pixels into a single one. 1 indicates presence of the linear feature, ...
0
votes
0answers
37 views

Speeding up PostGIS ST_AsGeoJSON

I am writing a query that would give me the geojson element contains the outline of a US State along with some additional information. The problem I am running into is the function ST_AsGeoJSON from ...
0
votes
0answers
40 views

How to use a PostGIS sequence in QGIS editing session?

I can't seem to get the sequence on my PostGIS table to increment to NEXTVAL in a QGIS editing session. My PostGIS table is defined as: CREATE TABLE qgis_topology_editing_test ( geom ...
0
votes
1answer
74 views

Trying to bind pop-up in leaflet via GeoServer GetFeatureInfo. Is there anything wrong in my code?

Simple Leaflet Map <script src="js/leaflet.js"> </script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> ...
0
votes
0answers
22 views

Display graduated QGIS buggy?

I counted points in polygons in PostGIS like this UPDATE hexagons SET count = (SELECT count(*) FROM points WHERE ST_Within(points.geom, hexagons.geom)); That came back with that UPDATE 1554 That ...
0
votes
0answers
29 views

load raster (geotiff files) to postgis with url

I tried to load rasters to postgis with raster2pgsql but this not satisfy my project because it uses local files. i have 5000 and will be more in future geotiff files in cloud host. is it possible ...
1
vote
1answer
57 views

“Get” results of PostGIS [closed]

I am getting warm with post PostGIS. I am working in the Command Line. What I am wondering is how do I "get" the results of PostGIS. So imagine I have this select name, neighname from neighborhoods ...
0
votes
1answer
23 views

Parameterizing Postgis function in GeoServer's SQL Views

I have a problem when parameterizing a postgis function in sqlviews If i create this sql, all works like a charm attaching this &viewparams=idvia:6753 to the url SELECT ...
0
votes
1answer
64 views

spatial query using GeoExt and openlayers

I want to allow the the User to make advanced custom queries against a layer.So he can search by name or another attribute and get zoomed to the requested feature ( hospital in my case) . I m ...
1
vote
1answer
37 views

Raster and Geometry ST_Intersects slows when add buffer in PostGIS

I have a table containing rasters for the whole of the UK, the below query is very fast (0.1 seconds) and gets all of the rasters that are intersected by the line between a start point and an end ...
1
vote
1answer
31 views

SLD styling rule for first and last geometry feature in PostGIS table

Writing a SLD file to style a Points layer which I publish as WMS with GeoServer, is it possible to specify a rule that is only applied to the first and last features in the underlying PostGIS table? ...
1
vote
1answer
63 views

Is there any method to retrieve SQL queries into a GeoJSON file using JSP?

I want to display the contents of my PostGIS database of various shape-files in leaflet pop-up dynamically. I know there are static methods available that retrieves attributes. But I need to by ...