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

learn more… | top users | synonyms

0
votes
1answer
448 views

Column exists in DatabaseMetaData, but does not exist in relation?

I am using JDBC to query a PostgreSQL database. And I want to populate a column called wiki_url based on the value of another column, level which will determine which value of 5 columns to concatenate ...
2
votes
2answers
949 views

How to project a geoJSON file in OpenLayers?

I have a json file well formed. I want to read a json file as a base layer from OpenLayers. <script type="text/javascript"> var styles = new OpenLayers.StyleMap({ ...
0
votes
2answers
759 views

Error import ShapeFile shp2pgsql-gui

I'm trying to import a shape file to my PostGIS database but I can not, give a look: Importing with configuration: 12mie250gc_sir, public, geom, / ...
12
votes
2answers
677 views

PostGIS interpolation / triangulation options

I'm looking for an open source workflow to automate DEM construction. We have a series of sites that fall within a LIDAR dataset. We want to create site specific DEM's for each site, and we're ...
1
vote
1answer
393 views

Why does Geoserver not serve my primary key/ id?

I have a postgres/postgis table with the columns: gid [PK] serial NOT NULL, geom geometry(MultiPolygon,900913), crop text My layer in Geoserver however only shows me the feature types "geom" and ...
2
votes
1answer
534 views

How to bulk delete shapefile columns?

I have shape-file with next attribute table: - name of features, unique number for each feature of layer I must split shape-file by NAME field, but in result in attribute tables of layers should be ...
3
votes
2answers
200 views

Where can I find the freeware ST-Links PgMap?

I am trying to connect to a PostGIS database from ArcGIS Desktop 9.3.1 Some web-searching suggested that zigGIS would be useful. Unfortunately zigGIS has reached the end of life, and the author of ...
1
vote
1answer
250 views

Convert native box to geometry

I have an old table that contains bounding boxes of lat long coordinates in a "box" type. How do I convert them to PostGIS geometry ? I tried using ...
1
vote
0answers
123 views

GeoServer and PostGIS connection technology

Does anybody know how GeoServer connects to PostGIS. Which technology is used? Is it JDBC? Thanks
3
votes
1answer
2k views

Merging multipolygon data into a polygon

I have a MultiPolygon representation of some shapes in POSTGIS, I am trying to convert them to Polygon data. I tried, st_geometryn(r.geom, 1) but that didnt work because the way polygons are ...
1
vote
0answers
853 views

How to handle postgresql/postgis geometry type errors in a function?

I have created the following function in PL/SQL to make a polygon from a set of linestrings: CREATE OR REPLACE FUNCTION _myfunction( _fid integer, _rid integer ) RETURNS VOID AS $$ ...
1
vote
2answers
469 views

Polygon intersection with bounding box with polygon's holes intact

I am trying to serve GeoJSON FeatureCollection tiles with each feature's geometries trimmed to the tile boundary. I am working on a Leaflet plugin to re-assemble the geometries. It works by building ...
3
votes
2answers
227 views

In Postgis 1.5, how can I split lines in points while retaining the id?

Hypothesis: Having 2 linestring tables: pipelines (id integer, street varchar(50), shape geometry) streets (id integer, name varchar(50), shape geometry) Each pipeline passes/intersects several ...
2
votes
0answers
193 views

Projecting PostGIS in Openlayers

I have a layer(base layer) with MultiLineString Geometries and now I need to project the layers(overlays) in the base layer from PostGIS using OpenLayers. However, I got an idea how to project table ...
1
vote
0answers
27 views

How to perform a join on simultaneous spatial and attribute criteria in PostGIS [duplicate]

Possible Duplicate: How to perform a join on simultaneous spatial and attribute criteria in ArcGIS? I have two point layers and want to perform a spatial join on nearest distance. I have a ...
2
votes
0answers
49 views

Is it possible to permanently save the Edit Widget for a Postgis layer?

Is there a way of configure the editing type for a POSTGIS layer through Edit Plugin and do not lose the changes after remove the layer or exit the program?
0
votes
1answer
164 views

Trigger on link length and filling attribute table

I create linear geometry in QGIS 1.8.0 (geometry stored in PostGIS 2.0). Help create trigger functions: in database should not be a lines less than 2 meters (linear geometry with length <2 meters ...
4
votes
2answers
2k views

postgis error: when adding features geometry has z dimension but column does not

I have to define a geometry column in PostGIS for 2D points, but when I try to import points from DXF to postgres I get the following message: "postgis error: when adding features geometry has z ...
8
votes
4answers
1k views

What is the best web editor and server for postgis?

I'm looking for a web editor (similar to openstreetmap) that works with an map Server (postGIS). This should permit edit and create new structures on map. What is the best option? Can you help me? ...
2
votes
1answer
325 views

How to return nearest point to input lat/long with distance?

I am trying to write a query with PostGIS that returns one row where the geometry of that row is the closest to an input point. I would also like to include the distance between these points in the ...
2
votes
3answers
541 views

How does ST_Azimuth work?

I do not understand the function behaviour. I am giving the function a point B that is North of point A so I would expect something around 90 degrees but I get 263 degrees instead. In another example, ...
6
votes
2answers
3k views

PostGIS ERROR: could not load library “/usr/lib/postgresql91/lib64/postgis-2.0.so”

OS is openSUSE 12.1, PostgreSQL - 9.1, PostGIS - 2.0. Postgre/PostGIS are installed from Application:Geo repository. After recent updates when I try to connect to my database I get the following ...
4
votes
4answers
707 views

Caching / Preloading data for use with WMS queries

Hoping someone can help me with this issue. I've got a map implemented in my web application using OpenLayers that makes WMS queries to GeoServer that in turn queries a Postgres (PostGIS) database to ...
6
votes
2answers
222 views

How to sample a 3D raster along a 3D path (or 4D raster along 4D path)?

I have a 3d raster dataset of atmospheric variables (lat x lon x altitude). I would like to sample this raster dataset along a 3d path. Any idea how I can achieve this, preferable with qgis or ...
3
votes
1answer
87 views

PostGIS - improving sql statement

I've managed to create the below statement that creates a table based on a point in polygon query. However it creates a column that gives a true/false value which I then delete out all the f values ...
11
votes
2answers
544 views

Are there any tricks to using a schema other than public in PostGIS?

I'm currently setting up a fresh install of PostGIS 2.0.2 and PostgreSQL 9.1.6 on Ubuntu. I've recently come across some information indicating that using the public schema to store all data is not a ...
3
votes
1answer
186 views

Creating a vector based design from a raster database

I have a raster table that I've created using Postgis raster. It has 365 records and the table looks like this: +-----+------------+---------+------------+ | rid | rast |filename |date_of data| ...
1
vote
1answer
2k views

SRID 4326 and geometry conversion

From this line: SELECT ST_AsEWKT(geom) FROM buildings LIMIT 1; I get this result: "SRID=4326;MULTIPOLYGON(((404269.308014269 4543087.6184561,...)))" I'm wondering if the coordinations are ...
2
votes
1answer
3k views

How to fix incorrect SRID of the geometry column? [duplicate]

I've been told to use AddGeometryColumn to properly add a column with correct/preferred SRID. however I wonder if it's possible to fix/change the current column instead of adding a new? If there's no ...
1
vote
1answer
222 views

Why does Find_SRID return zero?

using SELECT Find_SRID('public', 'myTable', 'myColumn'); I get zero as the result, what does it mean? Regards,
10
votes
3answers
1k views

How to speed up queries for raster databases?

I have a raster database in postgresql/postgis with these columns: (ID, rast, data_of_data). 'rast' is the column that has raster files in WKT format. An example query to find the DN value of a ...
3
votes
3answers
671 views

How to find SRID for random polygon?

I'm testing spatial database performance on a dataset. Spatial objects in this dataset (stored as WKT in a flat text file) are random valid polygons which have vertex coordinates (x,y) where 100,000> ...
1
vote
1answer
347 views

loading multiple shapefiles using shp2pgsql in a bash script

I have this bash script (loadShapefiles.sh) to load multiple shapefiles at a time. The script and the shapefiles are stored in the same directory. When I run the bash file with the command of bash ...
0
votes
0answers
161 views

Can I do full SQL expressions through the “WHERE” clause in UpdateCursor?

Run as a standalone python script for a shapefile in a toolbox on ArcMap. For example: psql_url_pop = '''SELECT shapefile.NAME_# + shapefile.WIKI_URL FROM public.shapefile''' rows = ...
1
vote
2answers
772 views

dealing with 2 different coordination systems in postGIS

I'm seeking a function that converts degrees to the following format: POINT(405115.926025391 4543389.4354248) I dont know this format's name, but is there any function to do so? Cheers, EDIT ...
18
votes
4answers
28k views

How to get coordinates from geometry in PostGIS?

This line: SELECT geom FROM myLayer.geom will return a hex value, i'm wondering how would it be possible to get decimal values, a result that look likes human-readable coordination? Regards,
2
votes
2answers
530 views

How fill length and feature count in PostGIS table for each polygons

I'am new to PostGIS/PostgreSql. I have a database which containts two shape-files : polygonal layer towns and linear layer of roads To calculate the length and feature count of 'Streets' inside ...
5
votes
1answer
612 views

How can you join attributes from polygons to points which are within the polygon feature using PostgreSQL and PostGIS? [duplicate]

Possible Duplicate: How to perform a spatial join of point and polygon layers in PostGIS? I don't know how to solve my actual problem. I have polygons and points (some points are located ...
5
votes
2answers
925 views

How to recreate unique reference number with QGIS or PostGIS?

I have a shp file with about 500 odd records in it. It has an ID field but I want to add in a new field with a unique reference number. Can I use the field calculator to generate a unique reference? ...
2
votes
1answer
750 views

Getting points within a range from a postgres database?

ok so this is query i'm making which returns no result: SELECT building.gid FROM building WHERE ST_Dwithin(building.geom, ST_GeomFromText('POINT(long lat)',4326), 400) If I run this ...
1
vote
0answers
193 views

How to config geoserver to read style of vector layer from postgis/SQL store?

I've imported vector layers from map info pro to both SQL server and post gis using easy loader. In both cases I've included style column in the exported table. When I create new store in geoserver ...
5
votes
1answer
289 views

PostGIS ST_Rotate distorts polygon

I'm trying to rotate a box around its southwest corner using PostGIS. However, I am not getting the expected results when doing the rotation. I'm using SRID 3785. The image below shows what ...
3
votes
2answers
2k views

General GeoDjango Opinion

I'm forced to crawl out of my intranet and create a public GIS site with quite an extensive dataset. All of my data is contained within PostGIS. I started dabbling with Geoserver/Postgis/OpenLayers ...
3
votes
3answers
1k views

Spatial index to speed up the query

I have spatial table in PostgreSQL 9.2 / postgis 2.0 that I have to extract some information from it. But my query is hopelessly slow. How could I make use of spatial index to improve the performance ...
1
vote
0answers
268 views

How can I use Convex Hull to select an area with a space from the points?

This refer to this post : Read Here My goal is to select an area covering some points, but maintaining some space from points of border, like in the follow picture : I think ST_Convexhull will do ...
7
votes
1answer
629 views

How to set up GeoDjango with PostGIS 2.0?

I would like to run GeoDjango (Django 1.4) with Postgis 2.0. Whenever I try to run syncdb I get the following error for geographic fields: Failed to install index for stores.Store model: operator ...
2
votes
1answer
464 views

Detect city from coordinates

I need to know how to detect which city belong certain coordinates. Wich is the best way to do this? Thanks in advance. Pd: excuse my english
2
votes
0answers
679 views

why preview image is blank for ImageMosaicJDBC (postgis raster) layer?

I follow http://docs.geotools.org/latest/userguide/library/coverage/pgraster.html to publish a ImageMosaicJDBC layer in geoserver. the layer seems published ok and saved, but the preview of this layer ...
2
votes
1answer
277 views

GeoServer: Show (Random?) Subset of Features

Background We have a GeoServer layer backed by a PostGIS table with 22 million smallish features covering the continental US. We're using GeoServer to serve the features as a WMS layer to a client ...
4
votes
2answers
596 views

How to remove redundant points using Open Source GIS (preferably)?

We have points table including vehicle routes.In huge traffic conditions,devices collecting data on route may output redundant points where at any coordinate same points may repeat.We can easily ...