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

learn more… | top users | synonyms

15
votes
2answers
8k views

How to change the geometry type from Point to Multipoint within an existing table in PostGIS?

Is there a PostGIS function that can change geometry type for an existing table? We need to change from POINT to MULTIPOINT. The table will be empty when we change the geometry type and we cannot ...
0
votes
1answer
323 views

one row is discarded while importing shapefile into postgres

Please help me in following issue. I need to import a polyline shapefile into Postgres9.1 through shp2pgsql command.When i did like this, i got an error as "NOTICE: CREATE TABLE will create ...
4
votes
1answer
355 views

Self-intersecting polygon using extreme values

I have this polygon POLYGON((1.2E-15 1.1E-15,1.31E-15 1.21E-15,-180 -90,180 90,1.2E-15 1.1E-15)) It uses an extreme coordinates like (1.2E-15 1.1E-15) and (180 90) When I call ST_isValidReason, ...
3
votes
1answer
362 views

How to Load RDF Data to PostGIS?

I want to load some sample RDF (Relational Data Format) to POSTGIS. Are there any tools or methods to do this.
2
votes
1answer
1k views

How to insert google maps lat/lng into postgis in geometry datatype

I came across: https://developers.google.com/maps/articles/phpsqlinfo_v3 I've changed the code a bit and all process is well done for postgis database. I get the data from infobox when user clicked. ...
0
votes
1answer
140 views

Retrieve data from table for spatial queries in PostGIS

We just want to write some spatial queries for our PostGIS tables, but we can only write queries with geometry columni like (POINT(36 43). Assume that we have two columns like geom and name, we want ...
4
votes
1answer
577 views

How to load a postgres view using pyQgis?

Under Qgis 1.8 on Windows 7 I have this problem with my pyArchInit plugin: I need to load on the map canvas my geometries from a postgis layer. Till the 1.7.4 version I use the method explained on the ...
1
vote
1answer
769 views

GeoServer WPS Aggregation Functions Example

The scenario: I want to present a user with names of polygons from a layer in GeoServer. I then display the polygon(s) whose name(s) the user selected. What I've done: I have a search box, which ...
11
votes
5answers
4k views

Free map service for private web applications

Background Looking to display a map (for internal use only) on a web page. The application must be able to add custom layers (without sending the data to the map service host): Municipal zones ...
4
votes
1answer
664 views

Can PostGIS constrain a column to multipolygons and polygons?

I'm currently using PostGIS 1.5.3, but I will be upgrading to 2.0 soon. So please note any differences between the two versions that are relevant to the following questions. Is it possible to create ...
4
votes
1answer
2k views

Performing Geoprocessing SQL Queries in QGIS from a PostGIS Database

This may be a dumb question, but is there way to run a PostGIS geoprocessing SQL query in QGIS? Specifically, I am thinking of running SQLs such as ST_Union, ST_Split etc etc. I have tried the ...
2
votes
1answer
2k views

Publish PostGIS raster to geoserver

I have a database of raster and vector and I want to use them in my webmapping. There is not a problem to publish the vector using geoserver but I can't publish my raster. Is there possibility to ...
0
votes
2answers
357 views

How to retrieve a single polygon from a multipolygon layer in GeoServer

I have a multipolygon layer in GeoServer. The layer represents states within a country. I want to enable a user to search for a specific state, and then only the selected state to be displayed on the ...
5
votes
2answers
379 views

How to put 20K points on a map

I have an sqlite 3 database with 20K entries each of which has lat long data and I wanted to create a layer from that data. From what I have read I need to import it into a postrgres DB but I'm not ...
3
votes
2answers
369 views

Invoke PostGIS functions outside of the database? Need to force 3D in GeoDjango

I'm looking to ensure that all geometries saved to the database are three-dimensional. It's easy enough to do with a call to the database, select ST_Force_3D( ST_GeomFromText( blah blah ) ) ...but ...
1
vote
1answer
222 views

postgresql pgrouting define C function function with int* arguments

I want to create a psql-C function with an undefined length list of integers (GIDs for example). An erratic example using V0 function definition that works is like: int mytest4(int *x, int i){ int ...
3
votes
3answers
253 views

How to setup PostGIS for use with multiple machines?

I'm a beginner user of postgresql/postgis. I am starting to use Linux more and more but still rely on windows (on different machines). How would I setup a postgis database that I could work with under ...
6
votes
1answer
641 views

PostGIS query vs QGIS filter

I have a PostGIS dataset with around 3 million shapes. I only need to view about 1,500 of these shapes at any given time, but the shapes I need to see depends on which feature is selected in a ...
0
votes
1answer
475 views

Out of range error when converting from geometry to geography in PostGIS

I am attempting to convert a geometry column in the postgres database to a geography column. I created a new column like this: alter table scene add column footprint_new geography(POLYGON, 4326); ...
0
votes
3answers
436 views

raster data retrieval from postgis using c++

I have raster data in a postgis server (I am able to see it in qgis). When I retrieve it and form gtiff image out of it using gdal, the generated image is not correct (there is a coloring problem). I ...
4
votes
2answers
189 views

Removing “the_geom” field in the .csv output of Geoserver

Good day sires. My team is currently working to develop a web-based GIS for a government client and we're using Geoserver 2.1.1 as our server application. We're trying to play around with ...
9
votes
2answers
367 views

How do you protect your PostGIS credentials when using QGIS 1.7?

I'm fairly certain this should be a community wiki, but I don't know how to make it one. So if an admin sees this please change if appropriate. So.....How do you protect your PostGIS database data ...
2
votes
1answer
407 views

determine whether a circle intersects a county boundary in postGIS

I'm using PostGIS 2.0.1 and need to determine whether a circle (center + radius) intersects a county boundary (polygon). The query I'm using is this: SELECT DISTINCT(u.id) FROM siteareas_poly sa, ...
7
votes
2answers
2k views

What is the SRID of census.gov shapfiles?

I downloaded the county files from: http://www.census.gov/cgi-bin/geo/shapefiles2011/main I cannot figure out what SRID to use with them. When I am trying to generate a class file from ./manage.py ...
5
votes
2answers
493 views

Best strategy for polygon search?

I have a fairly simple question. What is the best strategy to do the following scenario? I think this is a very common scenario: I have a several thousands of dataset with polygon/points. Each ...
3
votes
1answer
219 views

Intersect multilinestring (A) with multilinestring (B) retaining linear sequencing in resultset? [closed]

I have a PostGIS table testtin2 which is a sort of pseudo TIN consisting of a single multilinestring geometry, which I am intersecting with another table align, also a multilinestring, to generate a ...
4
votes
1answer
734 views

How to upload shapefile to PostGIS using cURL and GeoServer REST API

The GeoServer REST API docs here does not detail how to do this. I'd like to create a PostGIS table and corresponding featureType in GeoServer using the REST API, without having to chain requests. ...
9
votes
2answers
746 views

Migration from ArcSDE (SQL Server) to PostGIS (PostgreSQL)

We've got all the geospatial information of our company within an ArcSDE Database (over SQL Server): points (locations of the antennas), lines (elevation, rivers), polygons (protected areas, ...
4
votes
1answer
239 views

Reclass all values < 0 to -9999 in PostGIS

I have a tiled raster in a PostGIS table and I would like to change the value of all pixels which have values less than 0 to -9999. How should I do this? I suspect it involves ST_SetValue and ...
6
votes
3answers
1k views

How to get distance & bearing between a point and the nearest part of a polygon?

I am fairly new to writing SQL and using PostGIS so apologies if this seems a bit simple or obvious. I have a table of polygon features held in a postGIS database and I need to write an SQL query to ...
2
votes
0answers
320 views

Parcel ID Mapping (brainstorming)

In my project I have a table full of residential properties by Parcel_ID. Table 2 is a TIGER streets shapefile. I would like to build a query in MS Access displaying all properties within a mile ...
1
vote
2answers
309 views

postgis, mapserver & openlayers: if data is not in table give an error / pop-up

I have created a website with postgis, mapserver & openlayers. On the website you can enter a postal code and then a drivetime isochroon is created. The problem now is that you can enter ...
1
vote
1answer
798 views

Create closest point on multilinestring to use in shortest_path()

I am working a routing based application where I need to create a route between two points of interest. The problem which I am facing occurs after calculating network topology using ...
4
votes
3answers
220 views

PostGIS Uploader - Need Many .shp files in One table

How do I put many shape files into 1 table? The PostGIS plug-in shape file uploader makes one seperate table each time it uploads a shape file.
1
vote
1answer
988 views

PostGIS query with Lon Lat

Need SQL syntax for ... I have a table with individual polygons like a jigsaw puzzle. Given a Lon Lat, I need to find the polygon where the lon lat in located. I am trying: select * from ...
10
votes
1answer
3k views

Merge Multiple Tables into a New Table in PostGIS

I am looking to merge a number of individual tables into a new table in PostGIS. This is an easy task when working with Shapefile data, but I am unsure how to do this in PostGIS. Any help would be ...
8
votes
2answers
263 views

Moving existing hard drive with PostGIS data directory to a new computer

I have a new computer that is replacing an old machine that has PostGIS installed. The old computer has a 2nd hard drive where the PostGIS data directory is stored. I want to move this drive over to ...
1
vote
4answers
2k views

Joining 2 tables to create layer in Geoserver with MultiPolygon and Point data types

I got problem when using the SQL View function. My objective is to create layer in geoserver from joining 2 tables. I have 2 tables, table_a: Table "public.table_a" ...
4
votes
2answers
514 views

Programmatically setting a layer's bounding box in Geoserver

I have a system built on PostGIS/GeoServer/OpenLayers. Data (a ship's voyage track) is inserted into the database in real-time - a bunch of variables and point geometry type. This is served up via ...
2
votes
2answers
1k views

Why am I unable to publish a postgis layer to geoserver?

I left arcgis and microsoft sql and now I am trying to connect Qgis+PostgreSQL (PostGIS) + GeoServer. I've brought my postgis database to the server, created a "store". And now I'm trying to publish ...
1
vote
0answers
82 views

Make a thumbnail of a raster in PostGIS

I'm fiddling around trying to create a thumbnail of a fairly large (originally 27MB) raster, chunked into 64x64 blocks. I've got the following and it works, quite well, but I'm wondering if there is a ...
4
votes
2answers
2k views

How to setup PostGIS JDBC with Hibernate?

I try to setup an Java Application with Hibernate and PostGIS but I always get nasty exceptions like : java.lang.NoSuchMethodError: org.hibernate.type.CustomType.<init> ...
2
votes
1answer
242 views

Query for segments at same place and time in PostGIS

A newbie-question: I've imported the segments of several GPX-Tracks in a PostGIS-Table. Now I'm looking for a query that returns all segments that: are spatially overlapping (within a specific ...
2
votes
3answers
489 views

How to pull lat/lng from a map canvas and update a database

So if i want to pull out lat/lngs after user clicks on a map canvas (lat/lngs are pulled using any javascript API (leaflet, wax etc.) and add this to a postgresql database using a query, how do i do ...
3
votes
1answer
315 views

gdalinfo gives no georeferencing information for a PostGIS raster

I have a PostGIS raster dataset which I am trying to access via GDAL. I've had various problems with making this work, so thought I'd try running the gdalinfo command to check that GDAL can actually ...
4
votes
3answers
899 views

Create Spatial Index in PostGIS on an entire Schema

I have loaded a number of shapefiles using SPIT (QGIS plugin) to my PostGIS database. These layers did not have a Spatial Index created upon loading. I am wondering if there is a way to create a ...
3
votes
1answer
593 views

PostGIS 2.0 ST_Transform with Rasters cannot find custom SRID

I'm trying to calculate an average value in a buffer around a point. Given a raster in EPSG 4326 and a similar point, this is fine, except that the values will be skewed as they are not projected in ...
2
votes
1answer
537 views

How to transform ETRS to EPSG?

I have data in the ETRS 89 LAEA format (SRID: 3035). But I have problems to transform it. Example data: N2736 E4541 I want to transform it to EPSG WGS84 (SRID: 4326), to check the coordinates on ...
3
votes
1answer
2k views

convert list of points to line or polygon

I have a list of Points in a PostGIS table. The rows can be grouped by a date something like: myTable id INT date DATE lat NUMBER lng NUMBER geom GEOMETRY(POINT) now I need a table where all ...
4
votes
1answer
519 views

Importing multiple shapefiles with tablespace and inheritance defined

In the UK we are very fortunate to have the Ordnance Survey who provide the whole of Britain in vector format. The data is provided as over 60 tiles, each of which contains something like 16 ...