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

learn more… | top users | synonyms

1
vote
1answer
41 views

PostGIS Query returns duplicated rows

I'm trying to create a shape file of a state. I have a map of US zipcodes that I downloaded from the US Census and I want do create a shapefile of zipcodes in Florida. I ran this query which ...
1
vote
1answer
24 views

Get points in a union of circles

I am trying to create a postgis query that would get all the points in an union of circles (possibly more than a thousand of circles with different radius). The circles would be created dynamically ...
0
votes
1answer
49 views

Error while connecting qgis with postgres?

sql="select long,lat from poidata.poi_ca from where city LIKE '%unnyvale'" uri = QgsDataSourceURI() uri.setConnection("localhost","5432","gis_data","postgres","vajja") ...
0
votes
1answer
38 views

Issue using pgr_dijkstra from Postgres pgRouting

I am using Postgres with Postgis extension to retrieve streets (only for pedestrian use) and several "natural" points. I need to make updates every minute and i am working on a small bounding box. For ...
2
votes
0answers
56 views

QGIS does not display all Features of Layer and behaves weird instead

I have a weird problem with QGIS trying to load a Layer from a Postgis Database When I open the Layer from Postsgis I have two choices: Method one: Either, I use the Panel "Browser", where I can ...
2
votes
1answer
38 views

Show Log of the Sql statements that QGIS generates to retrieve Data from Postgis

Is there a ways to - make QGis log its generated SQL Statement or to - force POSTGIS to log all interaction with QGIS? There is something strange happening to the WFS layer I retrieve in QGIS, since ...
2
votes
1answer
26 views

ST_Intersects not working with ST_Expand from a point

I would like to do a real simple thing: I have a bounding box B1 (ST_MakeEnvelope) and I want to see if a square of 100 meters arround a lat/long position intersects the other bounding box (B1). I ...
1
vote
1answer
15 views

QGIS Relations loss of form style

I'm currently creating a project for management of highway drains in QGIS which involves the recording the feature attributes and logging of multiple inspections against a feature. I have a layer for ...
0
votes
2answers
65 views

Intersection of Shapefiles, clean borders

I'm trying to create a shapefile of the state of zip codes (in this example, I pick Virginia). However, the zip codes do not line up exactly to the state borders. So I run the following query to get a ...
0
votes
0answers
30 views

Postgis ST_Azimuth only returning a small range of angles

I have a puzzler with postgis and ST_Azimuth. I have a table of points (taken from country borders, and run through the QChainage plugin). I want to find the azimuth from a fixed point (15.0,50.0) to ...
0
votes
0answers
18 views

using changeset for larger region to update OSM data in PostGIS

I'm using the OSM import and update workflow described here to maintain OSM data in a PostGIS database. Import (osm2pgsql): osm2pgsql -c -d gps -U gps --cache 8000 --number-processes 4 --slim ...
0
votes
1answer
59 views

How to connect QGIS to PostGIS? [duplicate]

I want to establish connexion QGIS and PostGIS in order to run the pgRouting Layer, how can I do it?
3
votes
2answers
62 views

Construct curve of equal distance from two straight lines

Given two straight lines defined by two points each, I want to get the line which separates points nearer to line a from points nearer to line b. The attached PostGIS code is an example case, it finds ...
0
votes
0answers
23 views

How do I set up a PostgreSQL database for use with PostGIS and GeoDjango?

The Django docs say to use createdb -T template_postgis geodjango but I already have a database set up. While trying to find out what this actually does and a way to apply it to an existing ...
1
vote
1answer
25 views

How to select from geometry column in postgresql?

I've got a table which it has a geometry column filed by some point (ex. "POINT Z (116.309627 39.991285 148)"). now I want to select point's id from the table. I wrote follow sql Code but I force an ...
0
votes
0answers
10 views

TileStache Dynamic query based on zoom level

I wanted to make tilestache to be able have a different query for different zoom level. For certain zoom level I wanted TileStache to query from different postgres table. How can I achieve this? Is ...
0
votes
0answers
11 views

Can't set cache on tilestache

I've successfully installed tilestache on my server and able to load a geojson from it. But when I change the config file to use disk cache, the server return 500 on requesting the tiles. What I add ...
0
votes
0answers
27 views

PosGIS: Longest line connecting point to line

I have a point and around it lines and polygons in the rule of obstacles. I want to connect the point to each of the lines, with a line, such that this connecting line is not intersect any obstacle ...
0
votes
1answer
17 views

Intersection of two vector tables data in postgresql

I have satellite raster data is converted in to pixels using create table gtru_tile_pix as SELECT (ST_PixelAsPolygons(rast)).val, (ST_PixelAsPolygons(rast)).geom FROM ...
1
vote
1answer
42 views

A few PgRouting database design questions

Does someone know how the cost field in PgRouting is calculated? What are 'source' and 'target' good for? 'osm_source_id' and 'osm_target_id' contain the same information using different numbers. Is ...
1
vote
1answer
46 views

Percent total from postgis clip

How would I calculate the percentage of streets that have sidewalks summarized by census tracts using PostGIS. My sidewalks file has an id that links it to its adjacent street and I've worked out how ...
1
vote
1answer
35 views

PostGIS connect points to 1 closing/bounding line

I have this points represented as geom: And when I apply: ST_MakeLine(points.geom) I got this: When I need something like closing/bounding line (and even better the whole area as 1 geom): ...
0
votes
1answer
32 views

PostGIS: Simple query selecting nodes of polygon

I know it's very simple but anyway: (Asked also at stackoverflow) INPUT: Regular OSM buildings .shp table PostGIS Point location RADIUS (around above location), lets say 500m. RESULT: I want to ...
1
vote
1answer
18 views

Tile server return empty features

I have successfully installed tilestache. I also has succesfully add a layer using shapefile from here. But when I tried to use my own shapefile, the server always return empty featurecollection. I ...
1
vote
1answer
24 views

QGIS is not starting because of deleted file libgeos_c.so.1,How can I fix it

QGIS is not starting because of deleted file libgeos_c.so.1,How can I fix it It was originally running but some how I have deleted this file for some porpose installation of postgis for postgress but ...
3
votes
2answers
149 views

How to classify a raster using QGIS Plugin interacting with PostGIS?

I'm developing a QGIS plugin where users can enter some parameters (like distance, depth, area...) and by submiting the plugin interact with a PostGIS database and extract informations form vector and ...
0
votes
1answer
31 views

transform MULTILINESTRINGs to curves in cartodb

I have a table with a column that contains MULTILINESTRINGs, where every string contains the longitude and latitude of a starting- and an end point, e.g.: MULTILINESTRING((97.0253024 ...
0
votes
1answer
29 views

Average distances between two point sets bound by polygon

I have a table of boundary polygons, a table of points and a table of other_points I want to work out the average distance between points contained within and other_points for each polygon. So far I ...
0
votes
1answer
38 views

Couldn't Excute command line PostGIS pgsql2shp

I am using postgres 9.3 with postgis 2.1 on Ubuntu 14. When I tried to dump pgsql table using pgsql2shp, I get the following error. Error: pg_wrapper: pgsql2shp was not found in ...
2
votes
1answer
39 views

How can I export a shapefile from PostGIS with a GeoJSON query?

I tried to export a shapefile from my PostGIS installation using pgsql2shp as follow pgsql2shp -f tiles.shp -h <host> -u <user> -P <pass> <database> "SELECT id, the_geom FROM ...
1
vote
2answers
46 views

Rasters loaded in Postgres/PostGIS using raster2pgsql contain blank lines

I recently set up an Ubuntu Server as a Postgres/PostGIS database server. In an effort to serve a collection of aerial photos to my colleagues, I loaded 608 GeoTiffs (non-overlapping 1km tiles each ...
4
votes
1answer
50 views

Slow Planning for Postgis ST_Intersects

I am trying to run the following query: SELECT * FROM fences where ST_Intersects(geom, ST_GeomFromText('POINT(-73.990452 40.994184)', 4326)) When I run Explain Analyze I get the following: "Index ...
1
vote
0answers
23 views

PostGIS: Compute isovist

I'm using PostGIS with OSM table of buildings. How can I compute isovist from single location point while only the buildings (represnted as geom's) are the obstacles. Thanks,
2
votes
2answers
61 views

how to snap points to lines in QGIS/PostGIS?

I'm attempting to snap approximately 900 points to a line table. I've tried recreating what I have found from a couple of PostGIS answers but not having much luck. To test, I've created two ...
1
vote
1answer
30 views

add geometry to MULTILINESTRING in cartodb

I have a table that contains a column with MULTILINESTRINGS (which are the coordinates from two places (i.e. long0,lat0,long1,lat1), like this: MULTILINESTRING((97.0253024 4.3685491,8.5618685 ...
1
vote
1answer
31 views

Convert Postgresql Polygon to PostGIS POLYGON

I have an existing table in postgres which contains a plain old posgresql polygon. I have added a new column using SELECT AddGeometryColumn ('public','fences','geom',4326,'POLYGON',2); I would ...
1
vote
0answers
22 views

Collect near polygons [closed]

I have the following data: The data have 5 level (in tones blue). I want to collect only the nearest polygons with the same level and sum the number (represent client number). When I collect only ...
1
vote
1answer
52 views

Performance Improvement of Postgres vs PostGIS

I am trying to run the following query thousands of times per second to determine which is any polygon contains the passed in point. SELECT * from areas WHERE poly @> ? Poly is the name of the ...
2
votes
0answers
32 views

How do I optimise performance on a local QGIS + PostGIS installation?

I'm learning how to manage a local PostGIS (ver 2.1) database, with spatial indexing enabled on the shapefiles that I've imported (using the PostGIS Shapefile Import/Export Manager). I have imported a ...
0
votes
0answers
19 views

GeoWebCache Speed SQL Server Store

How to increase GeoWebCache speed, Am using geoserver 2.7.2 for tile cache and data store creating from a SQL Server database it will take 1 day and above to complete cache and it terminated several ...
1
vote
1answer
31 views

How to store multi-valued attributes in PostGis using Postgresql [closed]

I have a with meterid,meterreading,reader and date read.I wish to store this data using Postgis database. I used this code via postgresql to create the table CREATE TABLE MeterRdg( meterid ...
1
vote
1answer
59 views

Converting from kilometers to degrees distances?

We have geometries in a Postgis database with SRID WGS84 and we have found lookups directly in degrees to be much faster than in kilometres, because the database can skip the projections I would ...
0
votes
0answers
12 views

how to use st_intersection() with re-projection in POSTGIS?

This is a shipping route from 'portland to busan' and I want to check the route against land_polygons like how much distance is traveled by a route through land.And the problem is while checking the ...
0
votes
1answer
35 views

Multipolygon From Multilinestring PostGis

I have been looking for a answer for days. I dont even know if its possible. Tried: ST_AsGeoJson(ST_MakePolygon(ST_transform(geom,4326))) ERROR: Shell is not a line ...
0
votes
0answers
26 views

PostGIS dijkstra routing - specifying source and target as bigint instead of int4?

I'm currently working on a problem where I have to use PostGIS's pgr_dijkstra to calculate the shortest route from a starting point to a destination, and then use ST_AsGeoJSON to convert the route to ...
0
votes
1answer
30 views

Alpha Shapes in pgRouting - missing FROM-clause

I am attempting to follow Anita Grazer's post on creating alpha shapes in pgRouting. The article was written several years ago, so some of the functions have been updated and names have changed. I ...
5
votes
2answers
203 views

Password Protect QGIS project

On a shared computer, I have a QGIS project which links up to a PostGIS database that contains my data. If a user wants to access layers from the db, they have to enter the db credentials, so that's ...
0
votes
0answers
10 views

collada2pgsql: importing 3d models into postgis

I have been researching for a tool (open source) for importing collada (.dae) file into postgis and i have found this collada2pgsql command. I really don't know where to find it but it seems to be ...
0
votes
0answers
27 views

Aggregate/merge data upon insert into PostGIS (via gdal)

I am working on a project where I take a large raster file (1.5GB+), put it through a number of image-processing operations, and finally convert it to vector data. Being that the raster is large, I am ...
0
votes
2answers
35 views

PostGIS Multipolygon - holes

I have MULTIPOLYGON in my PostGIS database to store countries (with islands etc.). But I need to add holes to my borders for lakes. How can I store multipolygon with holes? I am using ...