PostgreSQL is an open source object-relational database system.

learn more… | top users | synonyms (1)

2
votes
2answers
162 views

PostgreSQL/PostGIS Geom to JSON with Inner Join to another table

I am currently producing JSON from a database successfully using the following query: SELECT row_to_json(fc) FROM ( SELECT 'FeatureCollection' As type, array_to_json(array_agg(f)) As features FROM ...
2
votes
1answer
110 views

GROUP BY on geography in postgres 9.4.0 returns wrong/different results

table definition: CREATE TABLE search ( id bigserial NOT NULL, location geography(Point,4326) NOT NULL, location_aggregated geography(Point,4326) NOT NULL, created timestamp with time zone ...
0
votes
1answer
46 views

Point inside st_dwithin with wrong results

I want to get all points, that are in the same area. Therefore, I have the following query for my table check: SELECT l.location_id, l.location FROM check l INNER JOIN check l2 ON ST_DWithin ...
1
vote
2answers
82 views

How to get the number of polygons of a geometry in PostgreSQL

How can I get the number of polygons that form a geometry in PostgreSQL? For example U.S map has a lot of islands in addition to its main lands. I want to count these islands plus the main lands.
0
votes
0answers
39 views

display thematic map using openlayers

iam displaying map from mapfile(mapserver) in c# using openlayers mapfile is connected to postgres it is working well but now i want to diaplay thematic map using the postgrs database using ...
1
vote
1answer
62 views

How to create Spatial Reference System in QGIS?

I have some Attribute and the coordinate and the coordinate reference system. I want to create a DBmanagamet form my spatial data. To do that I want to create one table with name Spa_ref_sys, but I ...
2
votes
0answers
107 views

Postgres OSM planet reverse geocoding

i'm building function for reverse geocoding in Postgres using PostGIS function's. For now i was able to clean up all the data that was useless to me(rivers, buildings,etc.). I got 3 ...
4
votes
1answer
66 views

Using more than one ST_function in one query

I have got stuck with a dynamic analysis that I would like to include in a project I am working with. I want to save the query in the project file or make it to a view in my database. I have tried a ...
1
vote
0answers
39 views

Batch load multiple shapefiles to Postgis

According to the shp2pgsql help, the options drop, append, create and prepare are mutually exclusive. So, if I want to create a table from a shape and then append multiple other shapefiles, I do ...
6
votes
1answer
135 views

How to create ArcSDE Geodatabase in PostgreSQL without ArcGIS Desktop?

I am programming a small application using Arcobjects, and I need to create an ArcSDE geodatabase on PostgreSQL. In ArcSDE at 10.2 there is no Post Installation Wizard. How do I create a Geodatabase ...
0
votes
0answers
30 views

Geoserver SLD repeat = PropertyName

i've got Geoserver up and running, rendering spatial data in Openlayers, based on a view from a Postgresql/Postgis database. I'm trying to get most of the values for the SLD file by the object ...
1
vote
2answers
93 views

Load multi CSV files from local disc to Postgres

I want to load a lot of CSV files from a local disc in an already created postgres database. Which is the easiest way to do that? By using SQL or Java? I suppose that I need a loop for doing that, but ...
3
votes
2answers
87 views

How to reproduce FME Change Detector results in PostGIS?

we would like to use the function change detector from FME in PostGIS. We had a try with the following SQL-Statements but the function doesn´t work. There are no results in the end. The single ...
3
votes
1answer
75 views

From hundreds of shapefiles to PostGIS with some kind of directory/file structure

We have more than 700 shapefiles which we will import in a PostgreSQL/PostGIS database. We want to use a single database to make joins on our tables without using foreign database wrapper. Our data ...
0
votes
0answers
39 views

Invoke PostGIS geocode function using Python

I have a PostGIS Geocoder built with using Tiger data. Using SQL, I am able to execute all database functions and queries. I want to use it with my Python program. One of the option would be to write ...
2
votes
1answer
48 views

How can you tell which port number an existing Database Connection is configured for?

I have a database connection to a postgresql database on a non-default port, 5433. I specify TESTDB,5433 as the instance and I can connect with no errors. If I open that connection properties ...
1
vote
1answer
61 views

Connect to postgresql using ARCSDESQLExecute

I'm trying to connect to a postgresql database using ARCSDESQLExecute from ArcPy. When running my script as stand alone (debug from pyscripter) it works fine. When running my script as a tool from ...
4
votes
0answers
106 views

Error installing PGRouting database extensions

Im trying to install pgRouting and I cannot reach the end of the way because of the following error: psql:/home/user/share/postgresql/contrib/pgrouting-2.0/pgrouting.sql:2459: ERROR: could not load ...
1
vote
0answers
50 views

Open source UML modeling software (GIS)

I am wondering is there any opensource UML to Postgresql Mysql tables conversion software which also includes the geospatial datatypes ? Note:I want conversion from UML to database. and NOT ...
1
vote
1answer
197 views

Postgis query to convert UTM to Lat long

I want Postgres/PostGIS queries to convert UTM coordinates from UTM 43N projection to Decimal Degrees 32643 projection. select ST_X(the_geom), ST_X(the_geom) from table
1
vote
1answer
89 views

Import of OSM data into PostgreSQL with osm2pgsql polygon problem

I've mananged to import my great-britain osm file successfully into postgres and I can query everything fine. osm2pgsql -s -j -G -l --number-processes 8 -K -U james -C 10000 -d osm myfile.osm I'm ...
4
votes
1answer
76 views

How to Specify FID column name in shp2pgsql

In ogr2ogr I can specify the name of FID column using the option -lco FID={columnname} when importing a spatial data in PostGIS database. I am using shp2pgsql in case of shapefile and cannot find a ...
0
votes
0answers
107 views

Displaying Google Map using MapServer, C# and PostgreSQL?

I am displaying Google Map (MapServer) by using C#. And also highlighting the districts on the Google Map using PostgreSQL data. Every thing is working well but when I use any options like zoom in, ...
0
votes
1answer
123 views

Polygon intersection with LineString in PostGis

I have a table which contains GPS coordinates at certain times. I created a LINESTRING from them ordered from the oldest to newest. I also have a POLYGON and I would like to determine the subset of ...
0
votes
1answer
61 views

How to load all states of TIGER into PostgreSQL?

I downloaded TIGER2014 from the Census FTP and I was wondering how I would be able to load all the geometries at once. I learned about loader_generate_script and loader_generate_nation_script but I ...
1
vote
1answer
31 views

postgres db in mapserver

I am trying to generate a map in mapserver by connecting a postgres database but it is not displaying any maps. My table name is a19010100001001. mapfile is LAYER.map MAP NAME "MP" SIZE 400 400 ...
1
vote
0answers
79 views

Is there any VRP solver in Pgrouting 2.0?

after looking at older posts and googling for a while i guess there is not vrp solver (multiple trucks). there was DARP in pgr1.x but i can't see it in 2.x. i found a lot of information on ...
2
votes
3answers
88 views

Calculate Color of Object So No Adjacent Objects Repeat

I am attempting to assign one of 16 colors to map objects (e.g. counties, states, ZIP Codes, etc.) so that no two adjacent objects share the same color. I'm seeing tons of articles online about ...
0
votes
0answers
40 views

line features show up as polygons in GeoServer

the layers are located in a postgreSQL Enterprise Geodatabase. I created a new line feature class and added it to the database and then added it to geoserver. But in geoserver it comes in as a polygon ...
1
vote
1answer
28 views

How to find out postgis.backend?

How can I find out which postgis.backend (geos or sfcgal) I have?
2
votes
0answers
95 views

How to get Geography data to GeoJSON in PostgreSQL?

I am using PostgreSQL database and there is a field in a table(area), i.e., public.geography(Points,4326). It contains below type of records "0101000020E6100000BA83D89942334540780B24287ED051C0" I ...
0
votes
1answer
470 views

Loading Multiple CSV Files into PostgreSQL Table

I am having multiple CSV files. Those CSV files are the log files created as a result of running a windows batch file. The location of these CSV files lies on the server and i want all these CSV files ...
0
votes
1answer
49 views

ERROR: attempt to redefine parameter “postgis.backend”

I just install "SFCGAL". When I use "ST_3DIntersection", It get below error: ERROR: attempt to redefine parameter "postgis.backend" SQL state: XX000 How can I fix? I already saw ...
2
votes
2answers
144 views

Finding all ways that are partly within a bounding box

I'm trying to write a query that will return all OSM ways which are contained within a bounding box of min/max gps coordinates. I get these cooridinates from the greater london bounding box on ...
1
vote
1answer
99 views

Does ST_Intersection work in 3D?

I am using "ST_Intersection" between two 3D lines which I believe do not intersect, but the result gives me their intersection. SELECT ST_ASText(ST_Intersection( ST_GeomFromText('LINESTRING( ...
3
votes
2answers
55 views

Can GeoServer Mosaic extension footprints be something other than a shapefile?

According to the GeoServer documentation for the Image Mosaic extension... http://docs.geoserver.org/2.4.x/en/user/tutorials/imagemosaic_footprint/imagemosaic_footprint.html It asks for a shapefile ...
1
vote
0answers
55 views

Issues installing GDAL with PostgreSQL

I'm trying to install gdal-1.11.0 on CentOS 6 machine. Following the instructions, this is my config ./configure --prefix /usr/local --with-fgdb=/usr/local/FileGDB_API ...
1
vote
1answer
51 views

Postgres: plpgsql combine ST_Overlaps and ST_Intersects

I have a question regarding creating a trigger function in postgres with 2 conditions: when creating a linestring in QGIS their must either overlap nor intersect. So i wrote 2 function, each working ...
7
votes
2answers
264 views

Find headwater polygons

This is a follow up question to this question. I have a river network (multiline) and some drainage polygons (see picture below). My goal is to select only the headwater polygons (green). With ...
1
vote
1answer
271 views

PostGIS ST within does not exist

I'm quite new to postgresql and postgis so this error will probably due to some rookie mistake. I want to run the spatial query ST_within. When I describe the query like this SELECT nw.entity_id AS ...
0
votes
0answers
25 views

How to choose entrys in pgr_kdijkstrapath over checkbox in HTML?

I want to create a GIS, where people live at pre-defined places(all of them play a defined musical instrument). A route should be created from these people to the place where they play together. It ...
0
votes
0answers
32 views

How to create unique plane with PostGIS?

How to create a unique plane, with (x , y ,z) as center and a vector as normal, in PostGIS? I already saw "Make3DBox" function, but it does not make a unique one.
0
votes
2answers
53 views

Can you do aggregate functions among nearby geometry in PostGIS?

I want to do aggregation based not on group but on geometry, is that possible in PostGIS? For example to calculate max, min, average price for all listings that's nearby a geometry point, how can I ...
0
votes
1answer
44 views

How to upgrade an PostgreSQL 8.3(32-bit)/ArcSDE 10.0 database to PostgreSQL 9.2(64-bit)/ArcGIS 10.2?

I need to upgrade a large production PG8.3(32-bit)/Arc10.0 database with a fair amount of programming (that has circular references) as-is. This is a system that I inherited, so I don't have the ...
3
votes
1answer
135 views

Visualising a raster PostgreSQL table in QGIS

I have imported a raster tif image into PostgreSQL with this command: raster2pgsql -s 32643 -I -M filepath.tif -F -t 100x100 public.databassename > filepath.sql And imported the output SQL file ...
3
votes
1answer
156 views

PostGIS multiple conditional statement on spatial join

I want to make a multiple conditioned spatial query in PostGIS 2.0/PostgreSQL 9.3., OS Windows 7. There are 2 tables, cadastre (Polygon) and roads (Linestring). Query: Select the sum (one number) of ...
2
votes
0answers
223 views

How to load GeoJSON into PostgreSQL database using Python?

What I have tried to do is (In Python IDLE): import psycopg2 import json try: conn = psycopg2.connect("dbname='carto' user='postgres' host= localhost password='password'") except: print "I am ...
6
votes
2answers
420 views

Find start of river

Edit: Follow-up question here (= Find headwater polygons). How can I determine the start of a river in PostGIS? I have a river network (Multiline) and want to find the startpoints of the rivers. ...
4
votes
0answers
105 views

Spatial query too slow to handle bigger OSM extracts

I'm trying to compute some statistics for OSM data using PostgreSQL 9.3.5 and PostGIS 2.1.4. I started with a small bavaria extract which I downloaded from Geofabrik. The db schema is the normal API ...
1
vote
1answer
76 views

How do I change the PostgreSQL data directory in the OpenGeo Suite 4.5?

I am using OpenGeo Suite and I would like to move the PostgreSQL databases files to a different drive than my operating system. The default location installed by OpenGeo Suite is in the ...