Tagged Questions

A version of the PostGIS open source spatial database

learn more… | top users | synonyms

0
votes
1answer
13 views

Error while make Build osm2pgrouting on openSUSE 13.2

i am getting the error while make /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: cannot find -lpq collect2: error: ld returned 1 exit status make[2]: *** [osm2pgrouting] ...
0
votes
1answer
76 views

Spatial search performance on a collection of Points in a PostGis database

Let's assume you have a huge PostGis spatial table (using Postgresql 9.2, postgis 1.5) : BIGTABLE ( p Point, someData varchar ) which contains millions of records. Each record has been created ...
1
vote
0answers
11 views

PostGIS 1.5 libstdc++ error

After some package updates on my Debian machine all my database queries involving postgis functions or types are returning: Error message from server: ERROR: could not load library ...
1
vote
1answer
61 views

Get lat/lon in degrees using PostGIS

I downloaded the shape file https://dati.comune.milano.it/media/rdp/comunemilano/dati/MM_FERMATE.7z, it represents the Milan's subway stations. I used ogrinfo to output the shapefile's summary and ...
1
vote
3answers
48 views

How do I query for geometry inside the Arctic Circle?

I have a large PostGIS database of lat/lon points. How can I query for any points that lie above the Arctic Circle?
4
votes
3answers
373 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
67 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
44 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
31 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; ...
2
votes
3answers
137 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
274 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
261 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
2k 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
170 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 ...
4
votes
1answer
1k 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
110 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 ...
1
vote
2answers
416 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
403 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
64 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
300 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. ...
1
vote
1answer
122 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
71 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
107 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
162 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
216 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
413 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 ...
3
votes
1answer
567 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
426 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 ...
8
votes
1answer
446 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
1k 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 ...
3
votes
1answer
654 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
486 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
335 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
344 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
164 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
4k 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
603 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
212 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. ...
7
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
900 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?
6
votes
2answers
3k 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 ...
7
votes
2answers
3k 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
3k 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 ...
6
votes
2answers
1k 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 ...
3
votes
3answers
2k 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
821 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 = ...
4
votes
2answers
419 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 ...
15
votes
4answers
4k 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) ( ...
6
votes
1answer
2k views

How to measure length of line accurately?

In postgis 1.5 for the below given query the answer is 1540651.62674101 meters , SELECT ST_Length(ST_GeomFromText('LINESTRING(77.83042478941326 9.98463896136159,78.03469506809812 23.90398909552571 ...