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

learn more… | top users | synonyms

1
vote
1answer
42 views

Spatial Join in CartoDB

I need to update a table of points with the FIP code of the nearest county polygon from a separate table. I've managed to update the column for those points that Intersect a county polygon with this: ...
0
votes
0answers
111 views

Draw postgis geometries in google maps api

Postgis have a base with a table of data lines and other points. I'm doing a java applet to query these tables and space to draw on google maps. My question is: what better way to spend these ...
1
vote
0answers
41 views

Finding the Closest Points using ST_ClosestPoint() for MULTIPOLYGON

I am working to match between the closest points of two tables. I have two tables: Building, SchoolBuilding. Building Table: Contains Polygones, SchoolBuilding Table: contains Points (From ...
2
votes
1answer
85 views

Transferring data between spatial databases

I would like transfer spatial data from PostGIS to Oracle Spatial. I want to use Python's modules psycopg2 and cx_oracle. Transfer Oracle > PostGIS is OK, but in opposite version I have problem with a ...
3
votes
1answer
87 views

how to snap two line vertex in two different layers used in QGIS

I want to snap between two poly-lines from 2 different layers (Layer1 in Brown and Layer 2(postGIS layer) in Pink color- ), but my snap option don't work. I have changed the tolerance to different ...
0
votes
0answers
187 views

Indoor mapping with floor plans and item(s) to track

Warning: GIS noob here. Essentially I want to be able to create a floor plan for a given room. Consider the following image of a floor plan in image format: I would have the measurements of every ...
4
votes
3answers
75 views

What is the PostGIS 2.x equivalent of the pre-PostGIS 1.5 ~= operator?

Stemming from my other question: When would a PostGIS geometry compare using ~= return true when ST_Equals returns false?, what is the PostGIS 2.x equivalent of the pre-PostGIS 1.5 ~= operator? It ...
2
votes
2answers
47 views

Import CSV file into Postgis DB with Location-field formatting?

I am working to import CSV into table in my Postgis Database. First, I created the table Create Table test ( name varchar, created_date Date, location double precision ); When I excuted the ...
2
votes
4answers
104 views

Best way to 'join' polygons

I'm looking for the best ways to 'group' a budge of block polygons in a new polygon that should be the town. My block layer is something like this: Or zoomed: And I'm looking to get something ...
1
vote
5answers
207 views

Problem installing PostGIS on Ubuntu Server 13.10

I've installed PostgreSQL 9.1 and postgis on Ubuntu Server 13.10 as follows: sudo add-apt-repository-ppa:ubuntugis/ubuntugis-unstable apt-get update apt-get install postgresql-9.1-postgis then I ...
2
votes
1answer
57 views

When would a PostGIS geometry compare using ~= return true when ST_Equals returns false?

I have a couple of featureclasses in a 10.2 geodatabase/PostgreSQL 9.2.2 database and I've been struggling with the FeatureCompare tool--it is telling me geometries are different on some features ...
2
votes
1answer
48 views

Is there a way to use some sort of “instancing” when storing polygons in a spatial database?

I am quite new to GIS database addons, and I am still exploring the possible uses for them. In general the idea of storing objects indexed by their position which enables additional operations is ...
2
votes
2answers
54 views

Measure areas, lenghts in specific regions (Australia, Sout East Asia)

I'm in need to find a suitable projections to measure correctly areas and lenghts for 2 areas of interest. I want to measure both factors for: 1) First region Australia & New Zealand (1st ...
1
vote
1answer
48 views

Calculating difference between bearing values in degrees

Suppose I have 3 geographic points, A, B and C. I can calculate the bearing of B from A (in degrees) using this SQL snippet: degrees(ST_Azimuth(geogA,geogB)) as brg_a_b ...and the same of C from ...
0
votes
1answer
59 views

Does ora2pg support the SDO_GEOMETRY spatial type?

I've been searching the net up and down for days now and can't find a definite answer to this question, neither on google nor on the official page (http://ora2pg.darold.net/). Does ora2pg support ...
1
vote
3answers
63 views

How ensure data put into PostGIS gets proper CRS attached?

I recently had an intractable problem that we finally traced back to the fact that some points in a PostGIS table had a CRS associated with them and others did not. This resulted in some points being ...
1
vote
0answers
47 views

Interpretation of PostGIS geocode function ratings

Edit: I am using Postgres 9.2 and recently installed PostGIS along with the Tiger Geocoder from the extras folder and downloaded all the latest Tiger data. I have been testing the Tiger Geocoder ...
4
votes
2answers
213 views

SQL Syntax to extract (convert) Strings with Degrees Minutes to Decimal Degrees

I have a PostgreSQL/PostGIS database with a two string fields containing Lat and Long coordinates in degrees and decimal minutes, like this 45° 24.5' N 3° 43.01' E. How can I convert them into ...
2
votes
4answers
98 views

Linking up GPS points taken from rail network

Bit of a newbie here, trying to work out whether any PostGIS functions can help with my task. Apologies in advance if my use of GIS terminology is not up to scratch yet. I have a large database of ...
1
vote
1answer
85 views

Publishing OSM data in GeoServer that has been imported into PostGIS

I'm trying to publish data on GeoServer. I'm using Postgres/PostGIS and I've used osm2pgsql to load the data into the database. I've configured a store correctly (I can see the tables from the ...
3
votes
2answers
144 views

What is this PostGIS query doing to show great circle connections?

I'm trying to draw a flight map in CartoDB. My starting point is a single lat long point. We'll pretend it is this: ST_GeomFromText('POINT(-71.060316 48.432044)', 4326) And I want draw lines ...
5
votes
1answer
133 views

Spatial database containing coordinates for stars in the sky?

My goal is to map the Skydome ( stars in the sky projected in earth surface ) using GIS. Has anyone done this before? I can't find any project close to this. What I just need to know is if there is ...
0
votes
2answers
118 views

Architecture for java ee application

I´m new to GIS development. I have read about Openlayers, maps servers (i choose Geoserver), geodatabase (in my case i choose PostGis) and theory of gis in general. I´m developing a Java EE ...
1
vote
1answer
55 views

Scaling CartoDB to multiple machines

I'm interested to scale CartoDB installation to multiple machines to distribute computational resources. We start using torque with some big tables (more than 5 to 10M points) and the processing for ...
2
votes
2answers
59 views

Postgis 2.0 simplifying multipolygon

I have a data set of national boundaries for the African continent. These are in a multipolygon table in postgis. Each country has multiple entries (rows) such that some of the countries in my table ...
0
votes
0answers
98 views

Mapnik render Error : Could not create datasource for type 'postgis'

I try to use mapnik render for a tile server. During the initialization 'renderd -f -c /usr/local/etc/renderd.conf', the following error message is displayed : An error occurred while loading the map ...
3
votes
1answer
297 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
147 views

Populate feature grid with database query results Using JSON, JSP

I convert database query result into json format.But this json data not populate on feature grid, Not showing any errors.not able to understand the error.please tell me what is wrong with this code I ...
0
votes
0answers
35 views

Postgis extension is not detected although it's installed

I have a database with postgis extension installed. i can verify it by running \x then \dx. The postgis and postgis_topology is available. But, if i run SELECT PostGIS_Version();, it says ERROR: ...
3
votes
1answer
98 views

Computing radius of gyration in PostGIS

The radius of gyration is a measure of the standard deviation of distances between points (and their center of mass), i.e., how frequently and how far points are moving. A formal definition is: I ...
0
votes
0answers
32 views

Why CQL DWITHIN returns different result than PostGIS DWITHIN?

I have 2 tables in PostGIS that I publish to geoserver. both have same SRS (2039). When I do the following query in PostGIS , I get 69 results : SELECT a.gid,b.gid FROM Table_A a INNER JOIN ...
0
votes
2answers
104 views

How can I add a PostGIS query result to OpenLayers?

I'm doing a query on PostGIS that returns a lot of geoemtries as results (more than 1000 which is why I can't use Geoserver CQL) - the query WHERE CLAUSE is being changed each time by the user (its ...
1
vote
2answers
45 views

How to calculate area or centroid of the_geom in CartoDB?

Is it possible to calculate area or centroid of the_geom in cartoDB? It would not be a huge time saver, and I am doubtful that it is an option but figured I would ask.
1
vote
2answers
75 views

PostGIS - Select points from a table that exist in a custom polygon

We have a property search site where the user draws a polygon on a map and then the app displays all properties that fall within the polygon. We have properties stored within a Postgres table that ...
1
vote
1answer
52 views

pgRouting and Openlayers error when insert controls variable

I've got another problem here :( I'm following the foss4g_w12 tutorial for building a pgRouting WebApp using openlayers, everything goes well until I added the following statement to my code: ...
7
votes
2answers
138 views

How to check if points are within a circular sector using PostGIS?

I want to get the stars within the black region as shown above. To find this I have the centre of circle (lat, long), radius and the angle of region (45 degree). I am new to postgres. I worked on ...
0
votes
1answer
67 views

Why does reading shapefile from PostgreSQL database give Error reading OID from table …?

I'm using arcgis 10.1 and i have a connection to a PostgreSQL 9.3 database. When i try to load a shapefile using the add query layer I get an error when opening the attribute table. The error says ...
1
vote
1answer
159 views

OpenLayers + GeoServer's WMS — Passing Feature ID into a Variable

I have a WMS PostGIS-based polygon layer served by GeoServer, and whenever I click on any feature I want to get its gid value, so I can pass this value to the DOM. Unfortunately, I could not find a ...
1
vote
1answer
68 views

Is there a way to use OSRM with PostGIS

Is there a way to use OSRM with PostGIS (Windows)? Related: Why mobile routing is so fast?
6
votes
3answers
173 views

How can I obtain the same area values provided by the Census for TIGER boundaries using PostGIS functions?

In PostGIS, how can I compute the area of Census Boundaries and obtain the same results as are provided by the Census? For example, most Census Boundaries include attributes for Land Area and Water ...
0
votes
1answer
51 views

How to provide a WFS in multiple projections

I would like to set-up an editable web feature service (WFS-T) for serving my geospatial data. The data tables are in a PostGIS database on the same server. For security reasons my server admin ...
2
votes
1answer
48 views

PostGIS: How to understand ST_RasterToWorldCoord() right? (PostGIS 2.0)

After putting raster in to postGIS by this Thank @Sorin for helping me out! Now, I want to output raster tile, then view it on QGIS. But the problem is the output of ST_RasterToWorldCoord(raster ...
3
votes
3answers
175 views

Best choice for building static maps: PostGIS, SpatiaLite or Shapefile?

I usually build static topographic maps, which are mostly printed. I'm often using OSM and rasterfiles (mainly different DEMs). The areas I'm mapping seldom exceeds 20.000 km². I'm using exclusively ...
0
votes
1answer
157 views

postgis and osm2pgsql: authentication failed

Id like to import osm into my postgis to use it with qgis. I followed exactly these instructions: http://wiki.openstreetmap.org/wiki/PostGIS/Installation At step #Activate_PostGIS: psql ...
0
votes
1answer
61 views

Serving WMS using Mapserver (Mapfile)

I want to display a map from Mapserver in Openlayers 2.13. I've prepared the Mapfile: MAP NAME "WMS Server" IMAGETYPE PNG EXTENT 106.637 -6.36199 106.78 -6.231 SIZE 600 300 IMAGECOLOR ...
3
votes
1answer
46 views

Use selected value in postgis function

How can I use the selected value from a SELECT statement in a PostGIS function. e.g. using the geom_way from SELECT geom_way FROM osm_2po_4pgr ORDER BY ST_Distance(ST_GeomFromText('POINT(21.323329 ...
2
votes
1answer
58 views

PostGIS Raster: Outputting raster into GDAL supported file?

I have import a raster into my postGIS database via raster2pgsql. My raster tiled to 100x100. Now I'm trying to export (output) the raster to GDAL supported file (for example: PNG). Following the ...
2
votes
1answer
48 views

using PostGIS to calculate distance of a route over a large area

I'm new to PostGIS and looking to measure the distance of the Pacific Crest Trail which spans western North America from Canada to Mexico. I have a data set containing the lat lon and dates from GPX ...
4
votes
2answers
88 views

How to optimize a ST_Within query to count lightning occurrences inside a country?

I just started learning PostGIS, and right now i'm trying to count the number of lightning strikes in my country (Brazil in this case). I have the following tables: earth_feed --> This holds the ...
2
votes
3answers
82 views

How to get a bbox selection of huge shapefile as GeoJSON?

I have a 4.29 GB Shapefile from which I want to extract features as GeoJSON, defined by a bounding box. This should be as fast as possible, because I want to use it in a web application. My first ...