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

learn more… | top users | synonyms

7
votes
3answers
3k views

How to insert a GeoJSON polygon into a PostGIS table?

I need to insert a polygon from GeoJSON to my PostGIS table. This is how the SQL query looks like. INSERT INTO tablename (name, polygon) VALUES ( 'Name', ST_GeomFromGeoJSON ( { ...
1
vote
1answer
1k views

Loading shapefile to a specific table in postgis using ogr2ogr

I have already created a geometry table in postgis. I want to load several shapefiles into that table using ogr2ogr. But I didn't find the parameter which could specify that table. ogr2ogr -append ...
0
votes
1answer
80 views

Force Geoserver SRID 0

I'm developing a gis solution which uses only geometry data. I designed my spatial DB with PostGIS and now I'm performing some trials connecting the DB with GeoServer map server (using the ...
-1
votes
1answer
151 views

How to store data for gis system?

I'm developing a GIS solution using Postgis database and geoserver as web map server. The solution to develop will analyzes the defects (as a polygon) and process parameters values (as a linestring) ...
2
votes
0answers
402 views

Clustering table on geohash index and geohash ordered table

I wonder if there could be a performance gain to re organize the rows in a table by Geohash and then CLUSTER this table on the Geohash index of the geometries. CREATE TEMPORARY TABLE tmptbl AS SELECT ...
1
vote
1answer
237 views

PgAdmin cannot load postgis for a database

Postgis works fine on my other postgresql databases, but I can't load postgis and postgis_topology extensions on a new database. I get following error message: ERROR: could not load library (path to ...
6
votes
1answer
2k views

PostGIS select by lat/long bounding box

I have a minLat, minLong, maxLat and maxLong from a box drawn on a map. Right now, my query to get all the points in the box looks like this: SELECT * FROM geomTable WHERE (longitude BETWEEN minLon ...
1
vote
1answer
231 views

Polygon to fill gap

Using postgis I want to fill a gap between other polygons. Can you help with some directions what functions to use ? Thank you and sorry if the question is rather noobish. Image to explain from ...
0
votes
0answers
20 views

How to find all possible paths by Postgis / Pgrout [duplicate]

There are functions available to find the shortest paths in Postgis / Pgrouting extension. But is it possible to find all the possible paths between two points/nodes ? Is there any such function ...
1
vote
4answers
597 views

How do I stop the map at just one world/globe?

I am working on a project to put google maps layer and adding our data layers on top of it. using openlayers and google maps layer with out layer of top of it now the google layer has max resolution ...
1
vote
1answer
180 views

PostgreSQL: transform spatial column from PG_GEOMETRY to ST_GEOMETRY

I have spatial Data stored in my PostgreSQL database as PostGIS Geometry (PG_GEOMETRY). It looks for example like this: 010100002031BF0D0000000000F989264152B81E057E6D5841 Now I would like to move ...
3
votes
3answers
420 views

What Is The Ideal Workflow To Map (British) Postcode Territories

I'm looking for the best workflow for mapping postcodes and calculated territories, but being relatively new to mapping I'm struggling on a few details and also the best practices for displaying these ...
1
vote
1answer
171 views

How do I convert MultiLines to MultiPolygons using Postgis

In postgis I'm using the following query to buffer lines to polygons: UPDATE rivers SET poly = ST_Multi(ST_Buffer(lines, 0.01)) where id = 1; The column 'lines' is a MultiLine and the column ...
1
vote
1answer
65 views

geoserver fail in publishing all data field [closed]

I am trying to load my data from postgis to geoserver, and when I try to publish them, I don't get all the fields from the database and when I click on reload field type it does nothing, also I have a ...
0
votes
1answer
84 views

mapnik verbose?

I've got a PostGIS NHD layer thats not rendering in mapnik (using toposm code scripts) and I don't know why. I've confirmed that the table data is there, positioned correctly and has the proper ...
4
votes
0answers
115 views

Joining layers with respective elements with PostGIS Topology

Recently I have started using PostGIS topology extension, but I have some difficulties in understanding how the structure works: One of the key points is the use of "layer"s: as of what I understand, ...
3
votes
3answers
1k views

How to add a polygon from PostGIS ST_AsGeoJSON into Leaflet?

I try to use the following function to add polygons to my Leaflet map. function polygon(geojson) { alert(geojson); // alert for testing layer = L.geoJson(geojson); layer.addTo(map); } ...
3
votes
1answer
341 views

How to get Lon/Lat values from the postgis raster type column

I have a tiff raster in my PostGIS 2.0 database. I want to get the value lat/lon and extra data like temperature from the raster type column in postgis table. I want the table with columns ...
0
votes
3answers
90 views

Query to find the Intersection coordinates of multiple Polyon

I am using the below Query to find out the intersection coordinates of 2 Polygon and its working fine,but how to use or modify the query to find the intersection area coordinates for multiple(or N ...
10
votes
6answers
1k views

Is there a way to connect to PostgreSQL in ArcCatalog without SDE? [duplicate]

Is there a way to connect to PostgreSQL in ArcCatalog without SDE? I came across this post from 2011 that suggested using zigGIS but I can’t find a working link to the program. A little background: ...
2
votes
1answer
153 views

Is is possible to import PostGIS functions from another database?

Seeing that I can't find the question asked here before, I have a feeling that I'm doing something wrong! However, here is my problem: I have one PostGIS database with 525 functions, and one with ...
2
votes
1answer
562 views

How to get polygons from PostGIS table to PHP array best?

Currently I fetch polygons from a database table using ST_AsText(). The results are in text format, like the following. POLYGON((84 104,212 48,321 122,243 179,275 238,131 240,84 104)) I am not ...
0
votes
2answers
176 views

How can I find the SRID from the WKT out of a GRIB file?

I have a grib2 file which I'm trying to import into PostGIS 2.0 Raster and process. Trouble is, I can't figure out what the SRID is supposed to be, or one close enough for government work. Running ...
-1
votes
1answer
283 views

QGIS and Python - create line with multiple points in postgis [closed]

How can I create a line, with Python functions, with many points that are records in Postgis? Thank you
2
votes
1answer
282 views

Raster Tile Merge Performance of PostGIS 2.0

I'm attempting to intersect Australian Census boundary polygons with the 1" SRTM DEM (10.5bn points across Australia), and output the result as a single raster image on the fly. The DEM is stored in ...
0
votes
2answers
953 views

Cannot insert simple geometry data

I installed PostgreSQL 9.2.4 and PostGIS 2.0.3 on my Windows 8 machine. Then I created a table using phpPgAdmin and added a geometry column using the following statement. SELECT ...
2
votes
1answer
560 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 ...
5
votes
1answer
454 views

How to install PostGis on EC2 micro-instance

I tried to install PostGIS on my Amazon EC2 microinstance using sudo yum install postgis2 and got following error message: $ sudo yum install postgis2 Loaded plugins: ...
2
votes
1answer
310 views

Converting mixed mapinfo tab files

Hi I need a little help/ ideas on how to convert tab files. The problem: I have many TAB files produced daily by 3 party app, I need to batch import the files into postgres. Most files import fine, ...
0
votes
2answers
379 views

How to split a linestring every 1000 points in postgis

To assume compatibility with my survey software, I would like to lighten geometries of my linestrings by cutting them every 1000 points without creating or interpolating points. I transformed a ...
0
votes
1answer
632 views

Cant Instal psycopg2 on mac 10.8.2

I know there Have been a lot of similar questions asked but none address this issue as I far as I can tell. When I am trying to install the sextante plugin, or run PostGIS Manager in QGIS I receive ...
1
vote
1answer
373 views

PostGIS not converting GIS data into latitude/longitude values

I am running PostgreSQL and PostGIS. I am trying to do something mind-numbingly simple: determine the latitude and the longitude of a point. Unfortunately, PostGIS stubbornly refuses to transform the ...
7
votes
4answers
287 views

Is there a way to identify and remove similar GPS tracks in PostGIS or ArcGIS?

I have a large number of GPS tracks from a number of different users. I'd like to identify tracks that take the same route and remove those duplicates. For example, a user takes the same streets from ...
2
votes
0answers
105 views

Installing knn on PostgreSQL for windows

I am trying to install the extension KNN for clustering as an extension on my PostgreSQL database. I have downloaded the file http://www.pgxn.org/tag/analysis I found instructions on how to ...
2
votes
1answer
170 views

Calculating points in the USDA's Cropland Data Layer coordinate system

I need to integrate against the USDA's cropland data layer. They've got a demo and some API docs. The important query I need to run is this, given an (x, y) of say (1551459.363, 1909201.537): ...
0
votes
1answer
259 views

ST_MakeEnvelope returning too many geos

I am using the following query in my db: SELECT bg_id, ST_AsGeoJSON(the_geom) FROM bg WHERE bg.the_geom && ST_MakeEnvelope(xxx, xxx, xxx, xxx); It seems to execute alright but when I draw ...
0
votes
1answer
184 views

What should I start with WebGis Mapserver?

I'm not native English Speaker and I'm a graduated student who want to have a master degree in software engineering. I have a thesis relative with "Build a WebGis for air pollution in Vietnam's ...
5
votes
2answers
1k views

How to implement Spatial Autocorrelation using QGIS or PostgreSQL (or any free application)?

I am a total newbie on the GIS scene so I hope this is not a stupid question. I have two layers in a PostgreSQL database. The first layer contains points where events happened in Europe. The second ...
1
vote
1answer
199 views

Assigning a nearest polygon to a point

I have a point layer of households and a polygon layer of tax lots. I want to assign a nearest tax lot polygon to each household point. Note that as the household points are coded on road, not within ...
3
votes
1answer
241 views

Visualizing Spatial Query

I'm new to GIS applications and trying to figure out what options I have for visualizing spatial query results that combine raster and vector data using OpenLayers/GeoExt/GeoServer/PostGIS. A ...
1
vote
0answers
425 views

How to add legend in WFS openlayers

How can I publish WFS openlayer with legend, have tried different examples such as http://api.geoext.org/1.0/examples/vector-legend.js. But when I tried using this firebug shows an error=> ...
0
votes
1answer
52 views

Finding polygon parents

I have a PostGIS table full of polygon geometries. Some of these polygons are contained inside other polygons in the same table. I need to find which polygons have parents and self-relate them to ...
0
votes
0answers
82 views

Shooting star algorithm in postgres 8.4 and postgis1.4 showing fatal error and remaining are working fine

When I try to run this shooting star algorithm, the postgis suddenly loosing connection to postgres and showing error no connection to server SELECT * FROM shortest_path_shooting_star(' SELECT gid ...
1
vote
1answer
281 views

Incorrectly Projected PostGIS data in TileMill

When I bring PostGIS data in EPSG:900913 into TileMill, my layers end up on other continents. This is my workflow: (1) Save shapefiles in QGIS to EPSG:900913 (2) Import the shapefiles using PostGIS ...
3
votes
1answer
444 views

How to find the country in which a point is located?

I have a PostGis database created with osm2pgsql. I am looking for a way to add the country name in which a point is located to the point row. It must work also for countries with enclaves, such as ...
2
votes
0answers
25 views

Spatial overlay data from many lines into a single line

Hello I have joined lines in my data set into longer lines (based on similar attributes) to reduce the number of rows in my data set. Now I want to take the information from the original smaller lines ...
2
votes
1answer
188 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
1
vote
1answer
350 views

Wrong projection on WFS layer with OSM baselayer [duplicate]

I am trying to add a vector layer with a WFS protocol. var wfs = new OpenLayers.Layer.Vector("WFS", { strategies: [new OpenLayers.Strategy.BBOX({resFactor: 1})], ...
1
vote
1answer
156 views

Win7 Senior users_Which pgRouting and postGIS versions are stable with postgreSQL8.4?

I'm working on a postgreSQL ,postGIS and pgRouting project on Windows 7 I need to work on a stable version (no time for risks), and I can see that many people are asking the same question many ...
1
vote
5answers
2k views

Unable to install the PostGIS extension to PostgreSQL on Ubuntu 12.04 LTS

I just installed Linux Ubuntu 12.04 LTS (on a virtual machine). I then successfully installed the PostgreSQL 8.4 database management system. I am now trying to install PostGIS, which is an extension ...