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

learn more… | top users | synonyms

1
vote
4answers
61 views

PostGIS importing shapefile error w/ official manager

I'm having some trouble when trying to import an shapefile of the Sao Paulo Brazil's state (I downloaded it from the web and I'm using the own PostGis manager to import it). Here's an image! The ...
2
votes
0answers
30 views

GeoServer ImageMosaic PostGIS index update

I use GeoServer where I created an ImageMosaic storage following this manual. When I create new datastore, all *.tif files are indexed into DB (PostgreSQL with PostGIS). How can I create new index in ...
1
vote
1answer
120 views

Simplifying Shapefile without risking Spatial Accuracy?

I am building a feature for a web application. Basically would use the ABS (Australian Business Statistics) data to render the regions on the Google Maps. I am able to implement the basic working ...
0
votes
1answer
40 views

How to insert a feature using WFS-T based on a criteria?

I am pretty new to WFS/WFS-T and need help with some suggestions on how the following requirement can be implemented. We have a need to insert a feature into a PostGIS database based on the following ...
2
votes
1answer
51 views

How to concatenate geometries?

I use the sql below it returns me several geom_way: SELECT St_astext(geom)FROM pgr_fromAtoB('ways',-51.1995,-30.0487604,-51.2157942,-30.0469069); Return: LINESTRING(-51.1995 ...
1
vote
1answer
34 views

I'm not able to save edited layer connected via PostGIS in QGIS

I have project and i was doing editing layers in QGIS. These layers are connected in QGIS via PostGIS. 1 layer of the 4 layers was saved correctly but other layers gave me error message. Error ...
1
vote
0answers
26 views

How to dissolve inner polygons in a multipolygon

I'm trying to get the boundary of a collection of zip codes. Here is my current sql: SELECT ST_AsText(ST_SimplifyPreserveTopology((ST_Union(geom)), .003)) as poly FROM zcta5_data WHERE zcta5 IN ...
2
votes
2answers
61 views

How do I select Census Block Groups inside a Zip code?

Long time listener, first time caller. I already have my data imported, problem is my SELECT statements aren't yielding the results I'm looking for. I specifically need all the Block Group ...
1
vote
0answers
38 views

How to calculate bus route transfer by using pgrouting?

Let say I have route 1 from A -> B -> C, route 2 from C -> B -> D, how can I write SQL for pgRouting which can let me have the result route 1 -> route 2 when I want to get the shortest path from A ...
0
votes
1answer
56 views

Geoserver+postgis+leaflet

I have been using the getfeatureinfo operation on layers published from shapefile and it works however the data which is being served from within postgis throws an internal server error. I am not sure ...
5
votes
2answers
86 views

How to replicate ArcGIS Intersect in PostGIS

I'm trying to replicate this ArcGIS process in PostGIS: http://blogs.esri.com/esri/arcgis/2012/11/13/spaghetti_and_meatballs/. This describes how to break buffered points down into polygons based on ...
1
vote
0answers
52 views

How to calculate the average distance among set of points as measure of closeness

I have three series (or tables) of points in PostGIS which I want to compare. I would like to know how "close" each series is when compared to the other two. In other words I would need some measure ...
2
votes
2answers
96 views

How to create more networking osm

Using localhost page generated by osm2po roteamente noticed that the link is made to link even disabling snapping. Logically thought to create more nodes in the network, but how can I do this ...
1
vote
1answer
41 views

Associating location data from PostGIS for a Choropleth map?

I'm trying to build my first choropleth map from data that we have stored in our PostGIS enabled Postgres database. So far I've been able to build a map on Mapbox using a topojson set of UK postal ...
1
vote
2answers
46 views

Get km route between two points with lat / lng

I'm doing the following query to get the distance between two points with pgrouting: SELECT sum(cost) AS cost FROM pgr_dijkstra( 'SELECT id, source, target, km as cost FROM ...
2
votes
3answers
56 views

How to display a table with more than one geometry column in QGIS?

In PostGIS, it is possible to use addgeometrycolumn more than once on the same table. Example: I have one table "scenes" with many attributes, and 2 geometry columns: the_geom1 and the_geom2. select ...
1
vote
1answer
45 views

Implementing Wrapper of PostgreSQL?

How can I implement the Wrapper of PostgreSQL? I found this useful looking wrapper from a FOSS4G routing with pgRouting Workshop but I do not know how to implement it!
4
votes
0answers
29 views

How to extract sublinestring from a linestring with overlapping segments

Problem statement: Given a bus route (defined as a linestring ln.the_geom), and a set of bus stop locations (pt1.the_geom,pt2.the_geom,...ptn.the_geom), divide the bus route into segments between bus ...
9
votes
2answers
279 views

What is the best hack for importing large datasets into PostGIS?

I have to import large Shapefiles (> 1 million records) into PostGIS, and I have been wondering about the best way to do it. In my question I used the word "hack", instead of tool, on purpose ...
1
vote
1answer
28 views

Does PostGIS have a Vincenty Distance calculation?

I have compared some distance calculations between geopy and PostGIS ST_Distance_Sphere, and it seems that PostGIS ST_Distance uses a calculation that is similar to the great circle distance rather ...
1
vote
0answers
35 views

PostGIS Raster functions not working

Hopefully I have a simple question that I'm not phrasing correctly in google. I'm trying to learn about storing and producing rasters in PostGIS. There are tons of examples and documentation online ...
1
vote
2answers
78 views

How to map all 0.001° graticules that contain land?

I'm trying to map all 0.001° graticules (across the planet) that contain land. My first attempt naively tried to brute force this by literally looping over the entire planet in 0.001° increments and ...
0
votes
0answers
47 views

C# geometry hex decoder

When i am storing in the database things like: Point(90 90). I get back 010100000000000000008056400000000000805640 which is a hex encoding of the geometric type. Does anyone know a library for c# ...
0
votes
1answer
98 views

PostGIS Column has Z dimension but geometry does not

I am able to create a geomtry column for 3d multiline using this: CREATE TABLE trajectories ( gid serial NOT NULL, vehid character varying(10), state integer, geom ...
0
votes
0answers
34 views

Postgresql Postgis Query is taking long time

I have a table that included only 472 rows and geometry of table is Multipolygon. I am sending query to databse via PgAdmin III select * from mytable // this query takes 99413 ms this is vey long ...
1
vote
1answer
44 views

Do large vertex counts in PostGIS cause performance issues in WMS?

I am wondering if large geometry (geometry with large vertex count) in PostGIS might cause performance issues for GeoServer (or other product) in serving the WMS (not WFS)? This question also ask ...
1
vote
1answer
56 views

Distance Between Two Points vs Length of Linestring

So I have two points that I want to calculate the distance between. If I use: SELECT ST_Distance_Spheroid(point_a, point_b, 'SPHEROID["GRS 1980",6378137,298.257222101]') / 1000 FROM ( ...
1
vote
1answer
48 views

GeographyFromText and ST_SetSRID+ST_MakePoint different results?

Why am I getting different results? SELECT ST_DISTANCE( ST_GeographyFromText('SRID=4326;POINT(13.401111 52.383343)'), --berlin ST_GeographyFromText('SRID=4326;POINT(9.997559 53.533778)') ...
2
votes
1answer
63 views

Error at or near “select” PostGIS

I'm using node.js to connect to a PostGIS database to check if an input feature significantly intersects with an existing feature. The error seems to be with the nested SELECT statement - can anyone ...
4
votes
1answer
57 views

Binary insert into Postgis geography column results in value being inserted as geometry

When writing WKB as a value (and as a binary parameter) to a geography column, the persisted value is not geography. Example Java is also available here: ...
0
votes
0answers
45 views

PostGIS Spatial query taking a very long time

I'm trying to return a count of crimes (points) that occur in each police grid (polygons), as well as the geometry data, but the query takes ~22 seconds. This seems oddly high and will be problematic ...
1
vote
1answer
52 views

Union of several linestring to multilinestring using MS SQL Server

Followed Postgreql query is the existing one used to combine serveral linestring to a single multilinestring. is there any equivalent of this in SQLServer . SELECT ST_AsText(ST_Collect( ARRAY[ ...
6
votes
1answer
170 views

Hex grid value interpolation in POSTGIS

I have a table of tessellated hexagons that I created as a hex binning grid to cover an area. I've then overlaid a point set to give some of the hexagons a value, see diagram:- The shapes with ...
2
votes
1answer
41 views

How to export postgis points as blocks in dxf with ogr2ogr

I'm trying to export postgis points as blocks to DXF format. I have a simple table in postgis with columns: CREATE TABLE pod_com_azimuth ( ogc_fid integer, rotation double precision, pointtype ...
2
votes
1answer
78 views

How to generate pgrouting source and target with OSM?

Is there anyone here can explain me more details for pgrouting's source and target? I'm wondering how to generate with the given lonlat in OSM PostGIS entities. In pgrouting's website, they are ...
6
votes
1answer
120 views

How to get the centroid of a set of points in POSTGIS?

I use PostgreSQL with POSTGIS extension. I have a set of points in the_geom column from a table myshema.myobjects I would want create a select statement to get the centroid of this cluster, so from a ...
3
votes
2answers
117 views

Recommended opensource solution for storing, publishing and querying GIS data

Our company has millions of feature classes currently stored through ArcSDE on SQL Server 2008 R2. We are kind of slowly making our way to opensource software. What we want to achieve is to be able ...
0
votes
1answer
16 views

How to get pgrouting source and target value using openlayers 2/3?

Is there anyone can teach me how to get the pgrouting's source and target parameters in openlayers 2/3? I plan to get those parameters by click the OSM map layer. Currently, I can only get the lonlat ...
1
vote
1answer
30 views

Remove inner polygons postgis

I'm trying to remove inner polygons with postgis. I've created a routine, that resumes in: From a polygon table, with a unique id: -Create a linestring table from polygon -Import to postgis -Get the ...
1
vote
1answer
58 views

How to write a (memory) layer from QGIS to PostGIS?

I am looking for an "elegant" solution to write, from a python script, a layer from qgis and into a new table of a PostGIS database. I thougth that this might be solved by QgsWriteVectorLayer, but I ...
0
votes
0answers
29 views

Problem in importing .osm file with osm2pgrouting 2.0

i've got two different systems: First system is: Ubuntu linux 64bit Postgres 8.4.8 Postgis 1.5.1 pgrouting 1.05 osm2pgrouting 0.2.0 This the system i've used for an old project that is already ...
1
vote
1answer
67 views

How to compute a line intersection point in a street layer in postgis 1.4?

I have a street layer downloaded from osm. I need to calculated intersection point as we do in qgis from vector menu -> Analysis tool -> Line intersections. I am new to postgis/postgres. any how i ...
0
votes
1answer
63 views

Pgrouting install debian 7.5 whezy

I need to install pgRouting on a Debian 7.5 64-bit server. I have PostgreSQL 9.1 and PostGIS 1.5 running. But somehow I can not install pgRouting. 1 - To use add-apt-repository ran the command: ...
1
vote
0answers
76 views

Undefined symbol error when creating postgis extension

When trying to create postgis extension, I'm getting an error, no references in google on it. maptest=# CREATE EXTENSION postgis; ERROR: could not load library "/usr/pgsql-9.3/lib/rtpostgis-2.1.so": ...
3
votes
2answers
131 views

PostGIS: Insert a Point using Python

What is the right way to insert a Point to a PostGIS database using Python?
1
vote
1answer
64 views

Extract lat, lon Points from Polygon

I have PostGIS database, and want to extract lat, lon pairs sequence from Polygons (and MultiPolygons). As a very fresh PostGIS user, I'm able to just extract the Polygons: SELECT ...
1
vote
1answer
46 views

How to add labels parallel to lines, polylines or multilines using Leaflet?

I want to add road name parellel to its line or if the line is curved, then the label should also be curved. How to add these name labels using leaflet? example image
0
votes
2answers
75 views

Dealing with custom projections (from prj file) in PostGIS (also GeoServer and OpenLayers)

Basically I want to perform spatial queries like distance calculations in PostGIS using data from shapefiles with different projections, some of which have no SRID code that I can find and also which ...
0
votes
1answer
48 views

PostGIS change column type varchar => geometry

I have a Postgres database with PostGIS extension on it. Also, I have a table with column lat with type (varchar 40). Column values are like this: 52.1432514 52.1431855 52.1431586 I want to convert ...
4
votes
3answers
310 views

PostGIS non functional on Ubuntu 14.04

I am unable to create the PostGIS extension on new databases in Ubuntu 14.04: $ psql pg_testing -c "create extension postgis" ERROR: could not load library ...