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

learn more… | top users | synonyms

1
vote
2answers
298 views

Is it possble to set a PostgreSQL schema and table name as a variable in Mapserver?

In Mapserver it is possible to set a variable when connecting to postGIS. This way I have created an fill-in form where you can enter a postcode and then you get a result. How can do this with ...
3
votes
1answer
602 views

QGIS connection to PostGIS showing wrong TYPE

I've got a user that it trying to edit his polygon layer but gets a message PostGIS error while adding features: ERROR: Geometry type (Polygon) does not match column type (MultiPolygon) When you have ...
3
votes
1answer
628 views

How to set up a background map in WGS84 projection for interactive map?

I've started developing my own interactive map and I have some things which are not clear to me. I heard that OSM, Google maps and all similar maps use Google Mercator projection. But if I use that ...
5
votes
2answers
180 views

Append table in PostGIS - Geometry Violation

In PostGIS I have imported a shapefile - some of this is Invalid according to PostGIS. Following online help I have first split the invalid polygons into a new table: CREATE TABLE s_invalid AS ...
5
votes
1answer
126 views

Is adding a new table for every layer a good design idea?

Is it a good design idea to maintain separate tables for each layer in a PostGIS database?. Every layer is defined by users. A user creates his/her layer say ATM location. Thats meant by defined by ...
3
votes
3answers
710 views

Geoserver, PostGIS and Postgres setup better on which web server?

Is it better to have Jetty or Apache as a Webserver for GIS stack?
8
votes
3answers
370 views

Why doesn't pgRouting return the best path?

Let the next portion of a graph: When I use the function shortest_path between the points A and B, I got the blue path. Why does this happen?
3
votes
0answers
98 views

How to PGRoute from OpenLayers via PostGIS/PostgreSQL [duplicate]

I need to route a shortest distance for a map which I have loaded from a PostgreSQL by means of JSON file. I can project the map in my browser and I can identify the linestrings. For a particular ...
3
votes
2answers
294 views

how to search for a Point of MultiLineString geometry in a json file using OpenLayers

I have a json file with large geometries(MultiLineString), here I got a Point among the json layer(baseLayer). I would like to search for a Point's LineString in the layer, from which MultiLineString ...
2
votes
2answers
1k views

KML from EPSG:4326 to EPSG:900913

im trying to create KML files manually (XML format) by extracting data from a postGIS database with "geography" values in a column. But i belive i need to transform the projection of each row in the ...
2
votes
1answer
105 views

How to save the edited features on a layer back to postgis table?

I have postgis + openlayer+ geoserver. I have developed an app which can show layers from postgis DB, allow user to edit,add,view features on a vector layer. Now, my need is to save the edited or ...
3
votes
1answer
358 views

PostGIS: worldwide area calculation

I have a table with polygons in EPSG 4326. These polygons are distributed all over the world, for example: POLYGON((10.7324632658845 59.9253049236956,10.7331908150806 ...
7
votes
2answers
784 views

How to find the nearest city for a POI in a OpenStreetMap/PostGIS database?

I'm interested in finding additional data for the POIs in OSM database. Currently I can use the following SQL for getting the name+long+lat for all the POIs SELECT name, x(transform(way, ...
7
votes
3answers
3k views

How do I get the area of a WGS84 polygon in square meters?

The following gives me the area of the polygon in square degrees: SELECT ST_Area(ST_GeomFromText('POLYGON((871325.790874952 6105405.3261047,871418.748307692 6105359.72944624,871346.22022442 ...
7
votes
2answers
729 views

How to get distance between one point and all other points in a table?

I have a table in Postgres with lat and long columns. Can I use the ST_Distance_Sphere or ST_Distance_Spheroid methods to get the distance between one point and all other points in the table? Do I ...
4
votes
1answer
380 views

postgis create geom from lat long

I ran this query successfully, but the column highwayid isn't updated as expected: update unique_latlongs set highwayid = (SELECT h.osmid FROM rn.highways h WHERE h.geom && ...
4
votes
2answers
529 views

QGIS saving analysis output as Postgis table

i am using QGIS and Postgis together. I can load data in Postgis and than i import it to QGIS. But i am trying to save an analysis output (example: buffer analysis, voronoi polygon or SEXTANTE ...
12
votes
5answers
438 views

What in-depth spatial database systems tutorials exist?

Is there a good tutorial that explains in depth the internals of a GIS and a spatial database system such as PostGIS with examples and without any background assumption? I'm specifically looking for ...
1
vote
1answer
197 views

Is the GIS Repository In Ubuntu in a different stream than the main repository?

I was checking out this: https://wiki.ubuntu.com/UbuntuGIS and it outlines how to install PPA for GIS. I performed a basic apt-cache search on a few things and QGis and mapserver are available. Such ...
1
vote
1answer
423 views

Is it possible to use Leaflet, PostGIS and PGRouting for web mapping?

I am newbie at Open Source GIS. I have already create a web mapping using custom tiles and leaflet. I have used my my own database. Tilemill was used to create the tiles and leaflet was used to ...
1
vote
1answer
104 views

caching part of a postgis layer in mapserver

I'm creating a layer in mapserver using postgis. The layer consists of many polygons. Sometimes some of those polygons will change. Is it possible to cache the layer tiles using something like ...
4
votes
1answer
486 views

Update a newly added column of a table using ST_Intersection as a filter

I would be really grateful to anyone that could help me with the following issue. I have ever used PostGIS much before - so could be considered a newbie... My Situation: I have TWO PostGIS tables: ...
5
votes
1answer
116 views

Should the geometry column always be the last column of a postgis table?

When we need to add an attribute to a table (e.g. a table of 350,000 polygons), my instinct is to always recreate the table so that the geometry column is last. I think this is a best practice for ...
5
votes
4answers
412 views

How to build PostGIS database schema for flexibility and normalization?

I'm creating a database that will be used by researchers in population genetics with different goals and sampling strategies. The database needs to accommodate locations as points, lines, or polygons ...
2
votes
4answers
936 views

Query Postgis Table with PHP

Would you be so kind as to help me with the following in OpenLayers. I need to be able to use the coordinates from a user click in a postgis query. To catch the coordinates of a click I built a click ...
12
votes
2answers
3k views

Postgres/Postgis spatial index - no speed up

I have a spatial table in a postgres/postgis database. Every row in it represents a Polygon. It is of following form: +----+--------+ |gid | way | +----+--------+ |241 | 01030..| The geometric ...
6
votes
1answer
1k views

What is a “non-noded intersection”?

Can someone provide a precise definition of what a "non-noded intersection" is? There are various GIS platforms and toolkits that have errors with this text, and Google search results for this tend to ...
2
votes
2answers
350 views

Why does GeoServer copy my PostGIS tables?

I have some geospatial data in a PostGIS database. I want to serve that data to a web map app with GeoServer. But every time I add a table as a layer in GeoServer, it creates a duplicate table in ...
3
votes
3answers
803 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 ...
3
votes
1answer
694 views

Dynamic SLD styling - unique colours for linestrings

I have a postGIS table that looks like this: (plus a 'track' geometry column, a linestring for the vessel's track) sampling_interval | voyage_name | start_time_utc | id | ship_name | ...
5
votes
1answer
853 views

Why isn't StackBuilder installation of PostGIS working?

I've installed PostGIS (ver. 2.0.1) on my Mac using EnterpriseDB's StackBuilder, which I also used for my PostgreSQL (9.2.2) installation. Although StackBuilder says that PostGIS is now installed, and ...
1
vote
1answer
530 views

Broken image from mapserver, png not rendering

I'm trying to render WMS MapServer data on top of Google Maps using the OpenLayers JS library. My problem arises when I try to render the data as a series of points throughout the New York City area. ...
0
votes
1answer
444 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
946 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
757 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
673 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
387 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
528 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
199 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
249 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
851 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
466 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
192 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 ...