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

learn more… | top users | synonyms

1
vote
1answer
24 views

Load postgis database with PK from two fields in QGIS [closed]

I have a PostGIS database having a Primary Key from two fields id_cat and id_cdad. When I load this database in QGIS in my computer under Linux there are no problem. I unmark "Select ID" and I can ...
0
votes
1answer
37 views

how to debug mapserver / postgis returning 0 results? ( MapServer WMS 1.1.1 / Google Earth / QGis )

user30184 answered the same question here Why is mapserver returning a blank image? user30184 answers to start by specifying SRID and that it often has to do with extent and projection. I imported a ...
3
votes
2answers
46 views

Does Oracle Spatial calculate geodetic distance?

I've got to migrate a PostGIS database to Oracle Spatial, and am stuck on a problem: In a view, I have a column that amounts to ST_Distance(geography(geom_1), geography(geom_2)), effectively ...
2
votes
2answers
36 views

PostGIS Address model/schema industry standard?

Is there an industry standard or best practices for a database of Addresses? I've searched for examples of Address models, and all I've found are very barbaric models that have something like address ...
3
votes
1answer
49 views

How to cast geometry to varbinary in PostGIS / PostgreSQL

In MSSQL Server, casting geometry to varbinary(max) produces a string that looks like this: 0x3D0B0000010CA0F3BE3B5CE9474100EC414E3AF93941 When you insert that string into a geometry column, a ...
4
votes
2answers
73 views

How to display vertex markers in QGIS for non-editable layers?

I've a PostGIS layer with read-only privileges. Is there any way to display the vertex markers of the layer?
2
votes
1answer
34 views

Load filtered OSM relations into Postgis with OSMOSIS

I am really hitting the wall trying to grips with merging filters in OSMOSIS. I would like to load relations, their related nodes and ways. If I use a tag filter like this: --tf accept-relations ...
1
vote
0answers
34 views

How to connect PostGIS raster data to Geoserver?

The data I have used is DEM. It creates a table and has 2 columns in PostGIS. Is it necessary to create a new table again and follow the configuration process as mentioned here The error - INFO | ...
1
vote
1answer
59 views

Convert a raster to GeoJSON polygons in PostGIS

I'm trying to convert a raster to a polygon and export it from PostGIS as GeoJSON. Specifically I want each pixel to be a polygon with associated the raster value. PostGIS seems to have a few ...
3
votes
0answers
24 views

Postgis - Construct linestring of length N

Give a table of linestrings (roads) ogc_fid, wkb_geometry And a road with ogc_fid = X In postgis how could I construct a linestring that is of length Y metres made up of roads starting from road ...
3
votes
2answers
155 views

Find points that are unique between two tables

I have been trying to work out a query that returns the geometry of points that are unique (eg. not supliacte). Is there a simple way to perform it in just one query? geom is the only common ...
3
votes
0answers
30 views

How to get the geometries based on column values in postgis?

I have the following table in postgis I want to group the species along with geometries based on column values of 'val' i.e 11,11,11,11,11,11,11-corresponding species 6,6-corresponding ...
3
votes
2answers
36 views

What is the SRID of LCC projection?

I have a raster file with LCC projection and a point dataset with SRID 4326. I want to extract raster value to point. When I use the query SELECT ST_Value(rast, geom) val FROM testraster5, ...
0
votes
0answers
32 views

populating a geojson from postgresql with php depending on zoom level

i am about to load a few thousand polygons (a grid 500x500m) from a postgresql db into a leaflet map with php script converting the data into a geojson. the php script populates the geojson depending ...
0
votes
1answer
20 views

ST_BestSRID function in PostGIS

This talk by Paul Ramsey mentions that there is a _ST_BestSRID function in PostGIS. I assume it exists to find the best projection when casting unprojected data for other uses. I cannot find docs on ...
1
vote
0answers
28 views

ST_Intersects in postgis

My version : postgres 8.4.1/postgis 1.4.0 I want to perform a simple spatial join with the following query : SELECT code_insee, nom, id_canton, lib_canton FROM localisants.alca_toponyme_commune ...
1
vote
0answers
29 views

QGIS - Alternatives to Offline Editing Plugin

I am looking for a way to edit my postgis layers offline (in field) using a Microsft Surface Tablet. I have been testing the "Offline Editing Plugin" unsuccessfully. These are the issues I have ...
1
vote
0answers
22 views

St_intersects returning false results in postgis

I want to intersect point geometry with raster. In postgis I'm executing select st_intersects(geom,rast) from testraster1,pft_pft and the result is false even though the points are sitting on ...
1
vote
1answer
35 views

Finding and merging lines that touch in PostGIS?

I would like to select and merge segments that touch like in the image below. My table contains single segments with their own id (shown in the figure), I just want to isolate single "group" of ...
1
vote
1answer
67 views

How to install pl/r pl/python pl/v8 in Ubuntu?

I am trying to find instructions on installing the PostGIS Procedural Languages (PL) for R, Python and V8 as required for the "PostGIS in Action" 2ed. book. I searched on google and couldn't find ...
0
votes
0answers
21 views

What does skew X/Y do in PostGIS?

I am just wondering what the exact function of skewX and skewY in raster constructors is. According to the documentation linked: ST_MakeEmptyRaster — Returns an empty raster (having no bands) of ...
3
votes
2answers
114 views

How to interpret a WKB (Well-known-binary)?

I read this example of a WKB (well know binary) from "PostGIS in Action" 2ed.: SELECT ST_AsBinary( ST_GeomFromWKB( ...
4
votes
0answers
41 views

Why won't my points (that I created by intersection) won't intersect with the geometry they've been created from?

I created a set of points by intersecting a linestring layer with the boundary of a multipolygon layer like this: CREATE TABLE freiraumkataster_grenze AS SELECT gid, ...
1
vote
1answer
44 views

Why is raster data in range 0-255 in PostGIS?

I'm having trouble interpreting some data I've loaded into a PostGIS database. I scraped rasters from here and converted to sql files using raster2pgsql. I'm now using PostGIS's special functions to ...
5
votes
1answer
94 views

How to use ST_Difference to create linestrings from non-intersecting polygon boundaries?

There are two tables with polygon features in my PostgreSQL database. I want to create linestring features where the boundries of the polygons are not intersecting. CREATE TABLE schema.poly_a ( gid ...
1
vote
0answers
22 views

QGIS crashes when using PostgreSQL/PostGIS triggers

When using PostgreSQL/PostGIS triggers saving layer edits gets slower and slower every time when saving a layer edit. This issue occurs after a few up to a few dozen saved layer edits. Finally QGIS ...
1
vote
1answer
77 views

How to check the encoding in the .dbf files?

I am having difficulties when I try to load a shapefile into my database, the is because I do not know the encoding of the dbf portion of the shapefile. The attribute tables are in Spanish, I have ...
1
vote
1answer
38 views

Can't create PNG file with “st_png” function PostGIS and Java

I have this code in Java: conn = DriverManager.getConnection ("jdbc: postgresql: // localhost: 5432 / postgis_23_sample" "postgres", "admin"); conn.setAutoCommit (false); String s = "SELECT ...
5
votes
2answers
75 views

How can I cluster all points in a postgis table together based on their distance from each other?

I have a PostGIS (in postgres 9.3) table which has Points. I want to figure out the "clusters" in the data. If 2 points are < X distance apart, they should be added to a cluster, and this should be ...
1
vote
1answer
23 views

PostGIS update statement returns wrong information

I have two tables in postgis with polygon data. Both are in wgs84. I want to update a column (column1) in the one table (table1) with information from a column (column2) in the other table (table2), ...
1
vote
1answer
39 views

Performing raster calculations with more than two bands in PostGIS?

We need to perform raster calculations using more than two bands in PostGIS. At the moment, ST_MapAlgebra has a two-band form but doesn't support more than that. I'm open to any solution others ...
0
votes
0answers
30 views

How to “INSERT” geotiff raster into postgresql/postgis table using psycopg2

Can someone walk me through how to insert a raster into a prebuilt postgresql table? The table has the postgis extension and I've been able to manually insert a geotiff using raster2pgsql, but I would ...
2
votes
1answer
43 views

GeoDjango, distance filter based on database column

I have a geodjango model with fields coverage = 10 * 1609.344 reference_point = Point(-72,45) #or some other lat lng class ServiceArea (geo_models.Model): center = ...
2
votes
1answer
32 views

Select a subset of a PostGis table

I'm using a big table imported by a *.shp file of the city of San Diego. When I run pgr_dijkstra it takes more or less 5000ms, even for small distances. I was thinking, in order to improve ...
1
vote
0answers
18 views

PostGIS: Find nearest point given coordinates from another table

So I have two tables, one table is called stores which has the name of the store as well as the geom column that contains the coordinates for the stores. The other one is customers which has the ...
4
votes
0answers
30 views

Wrong coordinates after loading OSM to postgre

After loading OSM data for whole Europe to postgres (Osm2pgsql) I'm trying to add them to Geoserver, but the coordinates are totally wrong. The SRS is correct (4326), but the coordinate values are ...
1
vote
1answer
29 views

Adding more information to a PostGIS table via QGIS [duplicate]

I have a table within PostgreSQL/PostGIS that contains all point data. I need to add another large dataset to this existing table without overwriting the table. When I go into DB Manager within QGIS ...
2
votes
1answer
43 views

Visualize PostGIS 3D line geometry [closed]

I have PostGIS table with 2 geometries ( "GEOMETRY(MULTILINESTRINGZ)" and "GEOMETRY(LINESTRINGZ)" ). There are lines made just from 2 points - XY are WGS and both of them have random elevation Z (I ...
1
vote
1answer
31 views

Given a lat/long how to find the nearest node in a route calculated by pgr_dijkstra?

I'm creating a table route_<route_id> for the route given by pgr_dijkstra, like this. In my application, I have a websocket with a mobile client that it's sending it's current position every x ...
4
votes
0answers
48 views

Tolerance in PostGIS

I am working with spatial data in land management using Oracle. The daily task is to perform spatial analysis: defining the mutual disposition of land plots borders, territorial areas etc. The ...
-3
votes
0answers
29 views

Npgsqlexception unhandled by user code

When am doing cascadingdropdown using ajax toolkit am getting this exception can anyone help on thisenter link description here
1
vote
1answer
25 views

GeoDjango and PostGIS distance query efficiency concerns [closed]

For example, if I want a query that says "show me all houses within 50km from here and order them from nearest to furthest", these are the questions and concerns I have: Assuming we are using EC2 ...
4
votes
1answer
47 views

How to use “left” and “strpos” to get the left part of a string with an expression?

I have a table in QGIS with full names and I want to parse into first name(s) and last name. I’ve created the columns and am using Expression Builder to do this. Here's what I'm trying and it's not ...
0
votes
0answers
30 views

How to not display a layer, if its below a other semi transparent layer?

I have two polygon layers (PostGIS). One of them is semi transparent. If the other layer is below the semi-transparent one, it should not be displayed. My situation at the moment is: The grey ...
2
votes
0answers
43 views

How to pull a shapefile into R from PostGIS database (in Windows)?

I'm currently working on pulling data from a PostGIS database for the first time to map in R and need some help. The database contains a shapefile of countries/regions of the world. I am able to pull ...
1
vote
0answers
23 views

pgrouting pointAtoB function

Has anyone successfully implemented pgr_fromAtoB function? Sometimes I get 0 results from points in the same line string, sometimes I do get results, How can accuracy be improved?, or maybe do I ...
2
votes
1answer
45 views

Calculate data from a set of raster files

I need to make some calculations with data from raster files saved in my postgis database. I need, build a map, using the average from a set of these raster files, for example. Besides, I need to ...
3
votes
2answers
74 views

Simplify/generalize Polygons and keep topology of different layers PostGIS/QGIS

i have some polygons of a country, states, districts, communities and i want to simplify the geometry. i already simplified the geometry of each layer but afterwards of course it doesnt fit with the ...
3
votes
1answer
74 views

Distance in meters between two geographic coordinates

I want to determine the distance in meters between two geographic coordinates. The points are: Lat (deg) Lon (deg) A: -33.3930906 -70.5452765 B: -33.3993212 -70.5468767 So if i calc the ...
3
votes
3answers
79 views

Importing OSM files to PostGIS

I have installed QGIS 2.4.0 on Windows. I also downloaded an OSM file form Geofrabrik (SouthAmerica). I have been searching an option (plugin also) in QGIS for importing the OSM file to my PostGIS ...