A version of the PostGIS open source spatial database

learn more… | top users | synonyms

0
votes
0answers
23 views

Overlay two images using Openlayers [on hold]

I would like to overlay two images (one image is sub-image of the other) using openlayers(data loading from PostGIS database). Is is possible to overlay without the projection system of the images?
3
votes
3answers
91 views

How to create random points in a polygon in PostGIS

I have a polygon layer, and would like to generate random points in each polygon. An initial searching in Google resulted this website which presents a function for this purpose: ...
2
votes
1answer
44 views

How to make a good table or view for QGIS in PostGIS?

I have a PostGIS db from OpenStreetMap (osm2pgsql) with my custom table. There are two problems with it: When I list tables, the columns from my table are scanned for geometry type, and it takes ...
0
votes
1answer
40 views

Why can't I perform any operation over a 700MB MIF file containing 5 multipolygons? It takes forever

I'm trying to work with a MIF file containing 5 really big multipolygons, but every operation I try takes hours, or just crash because of memory issues. Mainly using ogr2ogr, to transform MIF file to ...
0
votes
0answers
13 views

Can't get X coordinate of PointM in PostGIS

Here are two queries, and I can't understand how to filter points if st_x does not work in WHERE clause. select st_x(geom_merk), st_asewkt(geom_merk) from road_density limit 5; ...
0
votes
0answers
32 views

Best way to filter points dynamically in PostGIS?

I have a table with geom column (all SRID=4326) with a gist index on it a dynamically generated grid of points I generate a raster heatmap. I want to find each geom in a bounding box around ...
2
votes
3answers
95 views

Problem with result of query in PostGIS

I run the following query and irrelevant of the point coordinates and radius I always recieve all the records of the table I'm querying. Can anyone point out what the problem could be with this query? ...
2
votes
1answer
52 views

Problem with reading data from PostGIS as KML file using PHP

I am using the following PHP code in order to read data from PostGIS and save it in KML format as a file. When I load the page a document with ".PHP" extension is returned (not .kml) which inside has ...
2
votes
2answers
63 views

Problem in running query on PostGIS using PHP

Would you kindly help me solving this problem. I'm trying to use the PHP code provided here in order to read geo-data from PostGIS. The code seems clear without any problem (also nobody has ...
3
votes
1answer
189 views

Loading Shapefiles into PostGIS using shapefile import/export manager

I am a complete beginner with PostGIS. I've started learning it using the tutorials provided by Boundless. In section 4 of this tutorial where I want to import shapefile in PostGIS, I do not have the ...
1
vote
2answers
86 views

How can I do spatial queries in client side?

My current project is Map visualization. In this application I am taking the Input as JSONArray/CSV file and the outputs are Heat Map, pin Map, Thematic Map etc.. So, here I am using postGIS for only ...
3
votes
1answer
295 views

Copy a spatial table from one PostGIS database to another PostGIS database

I have two PostGIS databases on two different servers. The first server is PostGIS 2.0 and the second server is PostGIS 1.5. On the PostGIS 2.0 I have a table "lakes" with MULTIPOLYGON geometry ...
0
votes
0answers
85 views

How can I ensure srid is properly set on Postgis when importing shapefile?

I am uploading a shapefile to Postgis via Geoserver rest api but I end up with querying issues especially with srid i.e "ERROR: XX000: Operation on two geometries with different SRIDs". The import has ...
0
votes
0answers
34 views

drupal cartaro ask me postgis 1.5

I would install drupal cartaro, I have a host service with postgis 2.0 and a service with geoserver installed. Cartaro recommend me to use postgis 1.5. Do you know some solution for to use pg 2.0? I ...
1
vote
1answer
231 views

Import Error:No module named shapely.wkb

OpenERP GeoEngine I have installed OpenERP 6.1 version, works fine .,When i'm trying to add CamptoCamp GeoEngine Modules with OpenERP getting below find eror: Installation Prerequisites: OpenERP ...
1
vote
1answer
304 views

PostGIS package problem on Ubuntu 12.04.2 LTS

I've started getting an error on Ubuntu when trying to upgrade packages: "Not all updates can be installed Run a partial upgrade, to install as many upgrades as possible" When I run a partial ...
2
votes
1answer
55 views

how to differentiate between common parts of the triangle and extract linestring from it

Can you help me break down shape A to different linestrings: lines 2 & 3 AND line 1? The shape contains three different polygons (A, B, C). I wish to determine the start/end point of each part ...
3
votes
0answers
213 views

Select features within a country or bounding box effectively using PostGIS

I imported the planet OSM file into a PostgreSQL 9.2/PostGIS 1.5 server using osm2pgsql. I now want to select certain map features which lie within the bounding box formed by a countries borders, e.g. ...
0
votes
0answers
28 views

Can driving_distance return all sets of distance from different starting points at one time?

I'm now using the extension of pgRouting, driving_distance, to search for the distance along the river system: In the figure, the starting point is 3, but I want to get the distance starting from ...
0
votes
0answers
37 views

driving_distance does not return all sets of distance

As title, I am working with pgRouting, trying to get the distance matrix along the river system. I use driving_distance function and it seems like I am getting what I want: But when I check the ...
0
votes
0answers
17 views

publishing postgis raster in geoserver [duplicate]

I have stored a table of raster file through raster2pgsql in postgis. When i connect it to the geoserver and publish it, the bounding box limits are described illegal. Also the raster images are saved ...
1
vote
1answer
88 views

Postgis invalid geometry from shape file

I'm having trouble converting a Feature class (shape file) to a DB table (Postgresql 8.4/Postgis 1.5). This is the command in the pg log: INSERT INTO "public"."distritos" ("Shape" , "DEPARTAMEN" , ...
0
votes
1answer
59 views

pgRouting:routing problems using reverse_cost

I saw this post:Routing issues with pgrouting, and try the ability of reverse_cost. As the result of this post, if there is only one way to go from one node to another, even though the reverse_cost ...
0
votes
1answer
91 views

Can pgRouting work more efficiently?

I use a river network on which has a lot of nodes to test pgRouting, and I run the SQL, searching for the shortest path between nodes. SELECT * FROM shortest_path(' SELECT gid as id, ...
1
vote
1answer
113 views

pgRouting:how to use reverse_cost?

I add a new column, naming it "reverse_cost", and give it the same data in the shape_leng column. But as I run the shortest path algorithm in pgadmin, I got an error message. here's my sql code ...
0
votes
2answers
159 views

How to create a new column to store the length of a linestring in postgis?

I am working with pgRouting, following this nice guide:A Beginner’s Guide to pgRouting I am now in this step:Calculating shortest routes, with these codes below SELECT * FROM shortest_path(' SELECT ...
1
vote
2answers
261 views

Function for Selecting Points in a Polygon

I've been banging on this for a few hours, but since I'm relatively new to PostgreSQL and PostGIS, I can't find the solution. I'm trying to create a stored procedure (function) which will return all ...
2
votes
1answer
345 views

generate height data from DTED maps

I have 16 DTED maps of (1 degree x 1 degree). I have to generate combined height matrix of maximum 4 (1 degree x 1 degree) DTED maps in my C++ application. Can someone suggest to me which open source ...
2
votes
3answers
320 views

ST_Covers: Geography Implementation is not working, Geometry Implementation taking too long

I have a query: (This query uses geographical implementation of ST_Covers function) SELECT ST_Covers(ST_GeoGraphyFromText('MULTIPOLYGON(((179 -89,179 89,-179 89,-179 -89,179 ...
7
votes
1answer
326 views

How to split two interscting polygons by the average linestring of the shared area (QGIS / python shapely)

I have two polygons, POLYGON((-5 -5,-5 5,5 5,5 -5,-5 -5)) POLYGON((1 1, 1 7, 7 7, 7 1, 1 1)) and wish to split them evenly. The result should be a split along the red marked line. I'm using ...
3
votes
2answers
935 views

raster2pgsql part of PostGIS?

Hi GIS Stackoverflow people, I wanted to use the PostGIS functionality raster2pgsql, but I had to discover that the Python function was not installed with my PostGIS installation. Do you know if ...
2
votes
1answer
465 views

How to relate Non-Spatial table to Spatial table in two different Postgis DBs?

I need to relate a Non-spatial table to Spatial table, but both are in different database. Spatial_table(dbname:dist) gid district_name district_code geom Non_Spatial(dbname:census) ID ...
3
votes
0answers
424 views

How can I properly add PostGIS data into MapGuide Maestro?

I am having trouble connecting a PostGIS database to MapGuide Maestro. Actually, I have added the PostGIS data into Maestro, but when I click to validate the layer it shows an error message: ...
4
votes
1answer
290 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
2answers
260 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 ...
4
votes
1answer
111 views

Using all dimensions with postgis functions

I have points as geometry format in table that I use for some analysis. All points are saved in four dimensions eg. x, y, z and m - lon, lat, alt and time. The issue is that for the analysis are used ...
0
votes
3answers
3k views

Get geometry from coordinates

I have a table with geometry column called point, saved in SRID 4326. I want to get the geometry by its coordinates, but something didn't work. I suspect database configuration or something. Here is ...
1
vote
1answer
569 views

“Geometry” Problem while creating Postgis database on Ubuntu

I am trying to build pgrouting on ubuntu. Therefore, I now firstly try to create a Postgis database on ubuntu. I am following the instructions on this site: Installing PostGIS 1.5 on PostgreSQL 8.4 ...
5
votes
1answer
196 views

Spatial graphing, distribution of polygon area over latitudes

Given a polygon in a PostGIS database, what is the best way to create a graph of its distribution over a range of latitudes? I'm picturing a graph of a curve, where the proportion of the total area ...
7
votes
2answers
2k views

Postgis 2.0 upgrade problem with postgres data [SOLVED]

I have a serious problem: on Wednesday, April 2 OpenSUSE 12.1 is updated, and the package was to update the PostGIS-a version 1.5.3 to 2.0.0. After this operation, Postgres does not display records. ...
6
votes
1answer
2k views

Explode MULTILINESTRING into individual segments in PostGIS 1.5

I have a MULTILINESTRING in PostGIS consisting of several LINESTRING's. Consider each LINESTRING to have a set of POINT's P1, P2, ... PN forming the line segments L1, L2, ... LN-1 where ...
1
vote
2answers
726 views

How to split a feature and save back to database?

How to split/cut a polygon through OpenLayers split method and same editing save to the PostGIS?
5
votes
2answers
2k views

how to create a new postgis database for usage with QGIS under windows

After installing postgresql with postgis under windows xp I have 3 databases: postgis postgres template_postgis now I try to create a new spatially enabled database in pgAdminIII: I select ...
6
votes
2answers
2k views

Can't import OSM data to PostGIS, permission denied

I use Postgres 9.1 on Xubuntu 11.10. I've created a db 'aus' and user 'aus', granted ALL on the db to the user. Now I try to import the data, and it outputs this error: $ osm2pgsql --create ...
7
votes
2answers
2k views

PostGIS ST_Buffer Radius Help

I am trying to find all points within a five-mile radius of a given point. I have a query like this: SELECT * FROM table WHERE ST_Contains(ST_Buffer(geomFromText('POINT(0 0)', 4326), ?), latlon) I ...
7
votes
2answers
830 views

Creating a spatial PostGIS table as a result of a PostGIS query

When I want to store the results of a spatial query as another PostGIS table, what should I do? I am interested in identifying all residential buildings that fall within a set of parcels: CREATE ...
2
votes
3answers
1k views

Inserting polygon centroids into an additional column in PostGIS

I'm trying to calculate the x and y centroids for a table using ST_Centroid. The documentation says that it returns the geometric center of a geometry. I first made a column X: ALTER TABLE ...
4
votes
1answer
665 views

Geodjango distance between two points appears incorrect

I want to show you something. I am using django+postgis and I am experiencing wrong distance values between two points. This is my model: class Location(models.Model): name = ...
5
votes
2answers
379 views

Does PostGIS not work with psql?

I have a sql script that creates several tables, a trigger, and a trigger function. All the commands work in pgAdmin when I execute them in the "Query" section. My goal is to put all these commands ...
13
votes
4answers
3k views

How to create a circle in PostGIS?

I'm using PostGIS 1.5.2, with geometries in SRID:900913. I need create a circles using a list of points as centre, with a radius of 600 kilometers. I'm using this query: INSERT INTO circles (geom) ( ...