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

learn more… | top users | synonyms

2
votes
1answer
964 views

Problem in importing raster data from PostGIS to Geoserver

I am using Opengeo Suite 3.0.2, PostGIS 2.0.3 and PostgreSQl 9.2. I am trying to import raster data from PostGIS to Geoserver but facing an error. I follow this tutorial link to import the raster ...
2
votes
4answers
1k views

Finding center point of MULTILINESTRING using PostGIS?

How to find the center point of MULTILINESTRING, which lies on the multiline? I am using SQL in PostGIS
4
votes
4answers
1k views

Create a point x meters from origin using st_translate in postgis

How do I create a point 1000 meters away from a reference point? The ST_Translate only supports geometry type. I also tried using ST_GeomFromText but that returns a unit and not in meters. Here is ...
0
votes
2answers
481 views

PHP PostGIS to geoJSON missing required parametar error

I'm using this PHP PostGIS to geoJSON script: https://gist.github.com/bmcbride/1913855 But I keep getting this error: 'missing required parameter: geotable' This is my code: # Retrive URL ...
2
votes
0answers
34 views

How can I convert a shapefile from a single line segment to separate side segments using PostGIS?

I have a shapefile (STC) which is a single line segment per street with information for both the odd and even sides of the street. This .shp file has to be converted to separate side segments. To do ...
1
vote
1answer
174 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 ...
8
votes
5answers
3k views

How to split OSM roads into individual segments at intersections?

I want to create a road-network for use with pgRouting using OpenStreetMap data. I loaded a shapefile from GeoFabrik into a Postgres table (with PostGIS enabled). However, one problem I had was that ...
0
votes
0answers
26 views

Unable to install pgrouting for postgres 9.3.5/postgis 2.1.7

I am running postgres 9.3.5 and postgis 2.1.7 on Ubuntu Server 14.10. I am trying to install pgrouting, but having no luck. 1) I tried the following based in the official workshop documentation: ...
3
votes
1answer
76 views

How to handle large amounts of points

I'm using Postgres 9.4.4 with Postgis 2.2.1., my issues is that i have about 3 million of points i want to fetch and display on a map with leaflet. The problem is that those are too many points, what ...
1
vote
1answer
174 views

how to fix this ERROR: Start vertex was not found

I am attempting to make an SQL selection but receive an error. My statement: SELECT * FROM network JOIN (SELECT * FROM shortest_path(' SELECT gid AS id, start_id::int4 AS source, end_id::int4 ...
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 ...
0
votes
1answer
39 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 ...
2
votes
1answer
198 views

Use bbox in geoserver sql view

I'm doing this sql query using geoservers sql views: SELECT kmeans, count(*), ST_BUFFER(ST_CENTROID(ST_Collect(geom)), qrt(count(*))*1000 ) AS geom FROM ( SELECT ...
3
votes
0answers
58 views

Import Large Shapefile to Postgres

I'm trying to import a large dataset to Postgres, of about 600MB, that sits on a remote AWS server. But I get the following error Not enough memory to allocate requested memory (nRecords=26923892). ...
3
votes
3answers
667 views

Why is geography faster than geometry for distance calculations?

Intuitively, I thought geometry would be faster than geography distance calculations, but this says otherwise: ...
1
vote
1answer
27 views

Syntax error at or near “1” — PostGIS in Action — Chapter 11 SQL data dump

I'm following along with PostGIS in Action, 2nd ed., chapter 11, while attempting the SQL dump from the data files and I'm getting the following error: ERROR: syntax error at or near "1" LINE 189: 1 ...
3
votes
2answers
47 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 ...
29
votes
11answers
17k views

How to connect to PostGIS database from ArcMap?

How can I connect to a PostGIS database from ArcMap? Solutions for ArcGIS 9.3, 10.0 and later are acceptable. Ideally, I would like to be able to perform spatially enabled queries and receive the ...
1
vote
0answers
39 views

Length not respected in ST_Segmentize

When segmentizing a geography line in Postgis, the max segment length does not seem to be respected when the line is more than 3000km. The error grows when the length of the line increases. Below the ...
2
votes
1answer
481 views

How to obtain closest point of point over polylines layer in PostGIS 1.4 (without st_ClosestPoint)?

I´ve got a polylines layer (pipes) and a points layer (valves) and In Postgis 1.4 I would like to obtain the closest points but exactly on the closest polyline. In other words, i need to locate each ...
1
vote
1answer
169 views

Openlayers wfs no fid being passed from tinyows

I have a webapp - OpenLayers<->tinyows<->postgis. With 1 layer I have a problem. On localhost all works well - here is a snip of the xml I get back: <gml:featureMember> <tows:trad ...
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 ...
3
votes
1answer
54 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 ...
1
vote
2answers
504 views

can't geocode with PostGIS 2.1.1

I don't know where's the mistake... I am using the process from the PostGIS documentation (http://postgis.net/docs/manual-2.1/postgis_installation.html#loading_extras_tiger_geocoder) . I created a ...
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
1answer
294 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 ...
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, ...
2
votes
1answer
187 views

Admin Sample GXP Viewer

I have Geospatial application which is using GXP, GeoServer, GeoExt and PostgisSQL. We would like to enhance the application by adding a user friendly Admin system, similar to what GeoNode has. This ...
2
votes
1answer
45 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 = ...
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 | ...
3
votes
2answers
830 views

Debugging ogr2ogr “AddGeometryColumn failed” and “Terminating translation prematurely after failed translation of layer”

As noted in the title, I'm getting the following error: ERROR 1: AddGeometryColumn failed for layer pretty_polys, layer creation has failed. ERROR 1: Terminating translation prematurely after failed ...
2
votes
1answer
305 views

Conflicts while installing postgresql9.3-postgis2.1,QGIS and gdal-bin

I want to use postgresql9.3-postgis2.1 and gdal-bin parallel . I have refer instruction here for installing postgresql-9.3 on ubuntu 12.04. I have install qgis from here While installing gdal-bin it ...
3
votes
0answers
25 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 ...
5
votes
1answer
96 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 ...
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
1answer
423 views

What is the maximum number of vertices for polygons & polylines in PostGIS?

What is the maximum number of vertices for polygons and polylines (including multipart) in PostGIS? Thanks
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, ...
1
vote
1answer
373 views

Invalid join selectivity error in postgis 2.1.3

I have 2 tables, one for points and one for polygons. I want to find points falling within theese polygons, so I quered: select p.id, l.id from points p inner join polys l on st_contains(l.geom, ...
3
votes
2answers
116 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( ...
1
vote
2answers
302 views

adding geometries to a source, target table for multiple rows in pgrouting

I am having an issue trying to perform the pgr_dijkstra algorithm and getting back a line in my table for multiple rows. I have a table that has a columns of source, target node id's but I cannot ...
1
vote
2answers
307 views

invalid KML representation on ST_GeomFromKML

I exported a table with a geography(MultiPolygon,4326) column using ogr2ogr to a KML file. When trying to re-import any of the shapes using the ST_GeomFromKML function I get the following error: ...
0
votes
1answer
239 views

GeoDjango: Find all points within radius?

I am working in GeoDjango (with a Django 1.7 and PostGIS 2.1.4 backend). I have a model with a PointField in my database and I am trying to find all items within 10km radius of a point. Here is my ...
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
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
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
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
0answers
30 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
1answer
82 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 ...