PostgreSQL is an open source object-relational database system.

learn more… | top users | synonyms (1)

1
vote
0answers
172 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 ...
3
votes
1answer
979 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 ...
0
votes
1answer
377 views

Eclipse can't find Driver.class from postgresql-9.2-1002.jdbc4.jar file nor AbstractJdbc4Connection class

I am using the jar file in my configuration path after following the example from postgresql/jdbc tutorial. But after I added the jar file and configured it for my reference library when I run it I am ...
2
votes
0answers
181 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 ...
2
votes
1answer
223 views

How to filter or query data in GRASS?

I have a PostGIS dataset with just over 2 million rows. Each row has a PostGIS geometry point value and several attributes. I'd like to do some analysis on certain subsets of the data, but I can't ...
6
votes
2answers
2k 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 ...
6
votes
3answers
215 views

Are there any open source Python modules compatible with arcpy that will allow complex SQL queries?

I am trying to handle string (non-geometry) duplicates in a large attribute table of a shapefile without having to convert to gdb and back or connect to a postgres db. I need to be able to use a count ...
3
votes
1answer
532 views

How to manage the osmosis command line?

This refer to this post : Read Here I'm in trouble when using osmosis command line to export data from planet-latest.osm.bz2 directly to osm2pgsql using some criteria to select what to transfer. I ...
1
vote
0answers
339 views

How do I find the pgAdmin connection parameters?

I need to create a connection from arcmap to pgadmin using a python module because of an arcpy script, but I am unsure of how to get the pgadmin connection parameters. I think it may be some kind of ...
3
votes
1answer
151 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
1k 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
2k 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 ...
0
votes
1answer
151 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,
1
vote
1answer
239 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
143 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
594 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 ...
2
votes
1answer
563 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 ...
2
votes
2answers
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 ...
3
votes
4answers
1k views

What is the easiest way to detect geometry type from text in PostGIS?

I have some records with different types of 'geometries (poly,line,points)' stored as string. I'm trying to use ST_GeomFromText as I want to do some intersection with them. What is the easiest way to ...
0
votes
0answers
17 views

Is it possible to query for values in fields with the column names partially matching another field's values in psql?

I am trying to query the values of a series of columns NAME_# with the # matching the values of another column LEVEL and then populating another column with what I retrieve
5
votes
2answers
142 views

Confused about PostGIS and Postgres terminology

I am documentating my stuff and not sure what is the right way to write this, "I have installed Postgres and added the shapefile to the Postgres database. This database is then PostGIS enabled" or ...
3
votes
2answers
5k views

How to install PostgreSQL 9.2 with PostGIS 2.0 on Ubuntu 11.10 (or higher)?

I have read this question: Install PostGIS v2 for PostgreSQL v9.2, but it didn't resolve my problem. I added the PostgreSQL backports PPA and installed the postgresql-9.2 package, but there is no ...
2
votes
1answer
148 views

Why is pgrouting astar not consistent?

I route from 1 end of a circular route to the opposite end. Visually it is obvious that going clockwise is shorter, however shortest_path_astar sometimes picks clockwise and sometimes anti-clockwise. ...
2
votes
0answers
11 views

updatation query along a point [duplicate]

Possible Duplicate: GIS QUERY on point and buffer All, I have a PostGIS/Postgresql DB that has one table in it. One with point geometries and the other that represents buffer as polygons. ...
2
votes
1answer
781 views

How can I fix QGIS PostGIS Manager error 'shp2pgsql' is not recognized?

I have QGIS 1.8.0 installed via OSGeo Installer and work on win 7. All I need is to upload the shapefile to the database via this plugin. Unfortunately I am receiving an error: Something's wrong: ...
4
votes
3answers
99 views

GIS QUERY on point and buffer

I have a point table and the buffer geometry is created around the point. I have defined the if the point is within the buffer_distance then its value is =1 and if it is outside the buffer its value ...
2
votes
1answer
229 views

How to extract a single road from OSM GIS Database?

Is there a way to extract a single row out of the OSM-GIS-Database (by a Query). It would be so much easier, if I could find an EER Model of the Database. I was searching a long term and found very ...
2
votes
1answer
173 views

How to create infrastructure coverage using pgRouting?

I'm trying to reproduce what Underdark did here. I succesfully installed pgrouting and the two required function (nearest neighbour and driving_distance). cdv_osm_v contains all the openstreetmap ...
1
vote
1answer
138 views

Intersecting 3 tables with Spatial SQL

I have three tables I need to intersect but not sure how to get the third Heres what I have so far: SELECT nyc_neighborhoods.name, SUM(nyc_census_blocks.popn_total) AS POP FROM nyc_neighborhoods JOIN ...
5
votes
3answers
377 views

how to parse a XML Document file associated with the shapefile into a PostGIS/PostgreSQL table

I have a shapefile, and information on its attributes is stored in a XML Document format. For example, the attribute of COUNTY is stored as follows: -<attr> ...
1
vote
2answers
1k views

How to find the nearest line from a point?

I have a table of Roads in PostGIS which geometry is "geometry(MultiLineString,4326)". Its attribute are gid osm_id name ref type oneway bridge maxspeed geom Now i want to know ...
2
votes
1answer
163 views

How to link pgrouting edges with street names to route user based in street names?

I have installed postgreSql + postGis + pgrouting and I have loaded OSM data into my database using osm2po and shp2pgsql. How can I search for points in the map using the street names and then route ...
4
votes
1answer
249 views

Is there a way to select what to import from planet-latest.osm.bz2 to database?

Is there a way to select what to import from planet-latest.osm.bz2 to database? I want to do something like : osm2pgsql ... --place='city' --admin_level='2' My goal is to use only cities and ...
1
vote
2answers
222 views

How to remove shapefile from PostGIS

I added a shapefile to the PostGIS using, ogr2ogr -f PostgreSQL PG:"host=server_ip user=username dbname=dbname password=password" yourshapefile.shp; Now I want to remove it. What is the command ...
8
votes
2answers
7k views

Adding shapefiles to PostGIS database

I was able to create a Postgresql database and then I executed, createlang plpgsql geospecies psql -d geospecies -f postgis.sql psql -d geospecies -f spatial_ref_sys.sql So now can I directly ...
0
votes
1answer
500 views

Unable to locate PostGIS in OpenGeo Suite using command line

I am working on this new ubuntu 12.04 server and I need to work on the Postgres database which is PostGIS enabled. The problem is I am not sure how to locate the database using command line. The ...
3
votes
2answers
154 views

Multiple queries in a row

I have osm data imported into PostgreSQL with osm2po tool (wich makes the data routable). Also I have imported data relationed with nodes and node_tags with osmosis tool. I need to obtain a set of ...
0
votes
1answer
823 views

Django client install postgresql/postgis on Ubuntu 12.04

Does anyone know what apt packages one should install for a postgres(8.4)/postgis(1.5) django (1.4) client on ubuntu 12.04? All recipes seem to assume that I want to install the full ...
2
votes
1answer
418 views

QGIS ->ArcGIS Server configuration possible?

Is it possible to connect a QGIS Desktop 1.8.0 to an ArcGIS Server 10.0 ? and of course publish services on it?. The configuration would be like this Quantum GIS-> ArcGIS Server 10.0 on Amazon EC2+ ...
4
votes
2answers
353 views

How to find out what features /tags are included in an .osm or .pbf file?

I would like to load osm data into a postgis (postgresql) database. In How to load OSM data into PostGIS preserving all Tags? there has been a solution posted: Download the OSM files (in .osm ...
3
votes
0answers
235 views

Is there a way to start the route on pgrouting from a coordinate that is not a node?

After execute all steps from this pgRouting tutorial, now I have a map that creates and displays routes, but as the routing methods rely on parameters representing vertex Ids that was created using ...
6
votes
1answer
366 views

Join based on maximum overlap in PostGIS/PostGresQL?

I have two sets of polygons in two tables. The sets overlap each other. For each polygon in set A, I would like to get the ID of the polygon in set B that it overlaps the most. I'm using PostgreSQL ...
2
votes
1answer
205 views

Creating 3D terrain from point data in PostgreSQL?

I am quite new to arcgis and I would like to create a 3d terrain. Now I have a postgresSQL table containing a list of points with their geometry data and the Z value for each point. What I would ...
4
votes
2answers
2k views

How to find the nearest point from POI in PostGIS?

I have Point of Interest data in MySQL. This are the fields latitude,longitude,address,types in which I have stored the data. Now i want to import it into PostGIS Database. But does it required ...
8
votes
2answers
519 views

PostGIS Intermittent INDEX Performance

I have a table containing approximately 55 million data points ( point is a geometry with SRID 4326 ) and for my query I need to join this to an area table ( currently have ~1800 areas ) which ...
7
votes
2answers
254 views

Update database row with points that fall within polygons

All, I have a PostGIS/Postgresql DB that has two tables in it. One with point geometries and the other that represents country boundaries as polygons. I would like to add the country name that each ...
4
votes
1answer
321 views

Improve database performance for geospatial

I have a database with osm data imported with osmosis tool. I want to search for the nearest POIs from a given point. For this purpose, I perform this query: select id from nodes where ...
3
votes
1answer
955 views

Postgres/Postgis doesn't work after update

I work on OpenSUSE 12.1 and after today's upgrade (2012 NOV 14) Postgres and Postgis doesn't work. If I login to Postgres server by PgAdmin, get the message: translated from polish "ERROR: can't acces ...
2
votes
1answer
266 views

update tables data dynamically

Can u help me in creating a trigger and function so that every time i change the flag in table A the buffer distance should get changed and also its geometry field also , ie the polygon area? I have ...
5
votes
2answers
533 views

OGR to read from oracle, and then write a CSV

I need to read an Oracle (not spatial) table with OGR. I have no problem with ogrinfo. I use this command: ogrinfo -ro OCI:user/password -sql "select * from HR.EMPLOYEES" I have this kind of ...