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

learn more… | top users | synonyms

1
vote
0answers
21 views

Getting OSM data for a particular jurisdiction

I'm trying to make a street map of New York City (and only New York City). I've downloaded OSM data for the area (from here), but it contains lots of data from the suburbs. Currently, I've loaded ...
0
votes
0answers
14 views

Export .dbf maintaining column data type

I require a shapefile's .dbf to contain two types of text columns VARCHAR(n) and CHAR(n) to meet specs (attribute format) of gov receiving body. Have to send them the .shp, .dbf and .prj. Within ...
1
vote
0answers
21 views

Focal Mean of neighbors using ST_DWithin on points in PostGIS

I'm trying to calculate focal means on a grid of points in PostGIS. I know that a raster calculation would be more efficient, but I only need to run the algorithm once to get the data, so I don't ...
1
vote
2answers
45 views

How can I speed up these queries

I am trying to make some calculations using PostGIS and PostgreSQL. There are 3 important tables : wbn, wgo and wvb. These tables have about 500.000 objects in them (geometries). The problem is that ...
1
vote
0answers
14 views

PostGIS 3D Extrude function

I selected buildings from OSM (which represents my city). I insterted a new column 'height' and I filled with a random number exactly number 2, so every building have 2metres altitude. Buildings are ...
0
votes
2answers
21 views

How to get feature from PostGIS to OpenLayers with ASP.NET?

I need to show my feature from this table in PostGIS in my ASP.NET web page web. Has anyone done that?
1
vote
1answer
65 views

What index to use in this situation

I am working with 3 tables with 3 x 500.000 rows. There is one colomn that gives each object a unique ID (UIDN), there also is a colomn with the geo data (the_geom). There also are some other columns ...
3
votes
1answer
39 views

MS SQL Server 2012 to Postgresql

How to use MS SQL Server 2012 spatial database in postgresql using foreign data wrapper?
1
vote
0answers
34 views

Raster slightly displaced after exporting from PostGIS database

With the following queries I've exported a raster (GTiff) from my postgis database: 1.Creating a large object: WITH buffer AS ( SELECT id, ST_Buffer(geom,50) AS geom FROM ...
1
vote
1answer
22 views

How to split/divide linestrings of larger lengths in postgis

I want to split/divide linestrings in my data. I have roads data and I want to have every road segment having length not more than 250 meter. Check the shape length of this particular line feature. ...
1
vote
1answer
16 views

Trouble using ogr2ogr w/ -s_srs to combine inconsistent EPSG files into my postgis DB

I'm having trouble combining shapefiles from TIGER and different local governments into a single postgis db to query legislative locations. I've imported all data to multipolygon geom, but found some ...
1
vote
1answer
26 views

3D functions with SFCGAL in PostGIS

I have this setup: "POSTGIS="2.1.2 r12389" GEOS="3.3.8-CAPI-1.7.8" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.9.2, released 2012/10/08" LIBXML="2.7.8" LIBJSON="UNKNOWN" TOPOLOGY RASTER" on ...
0
votes
0answers
26 views

How to split a polygon by a polygon and apportion attributes - postgis [duplicate]

I would like to split polygons by polygons and have the numerical attributes be apportioned. For example: I have a parcel that needs to be split by region. With How to split polygons with another ...
1
vote
2answers
33 views

What is the best way to take a WKB value in SQL Server Management Studio and create a PostGIS geometry in PGAdmin III?

Normally, I would just use WKT strings but I'm investigating some possible geometry weirdness with the Text methods in SQL Server. I would like to copy/paste the WKB values from the SQL Server ...
1
vote
1answer
20 views

Strategies for managing (and ultimately merging) duplicate business locations in a spatial database

I am working on a project right now that involves using multiple (very large) "location directories" to identify with the highest possible inclusiveness, a diverse set of business locations. These ...
1
vote
0answers
49 views

How to save a google map direction into a postgresql/postgis database?

I have taken a direction(route) from google map. Can I save this resultant direction/path/route to my postgresql/postgis database? How?
2
votes
2answers
39 views

Do I still have to use a template DB for PostGIS?

createdb mydb -T template_postgis Is this -T template_postgis still necessary in new versions of PostGIS? I never saw this db being different, it always has those 3 sql files you run there. Is this ...
0
votes
0answers
17 views

How to ensure that Tilemill interprets my postgis query as intended?

One of my layers (a postgis query from my local osm2pgsql database) is being translated incorrectly in Tilemill. The query is attempting to select the way, the area of the polygon, and the sport=* ...
1
vote
2answers
42 views

PostGIS to GeoJSON with GDAL: how to get lat/longs?

I'm trying to convert line features from PostGIS to GeoJSON files, as follows: from psycopg2 import * from subprocess import call conn = connect(dbname='gis') cur=conn.cursor() cur.execute("SELECT ...
2
votes
1answer
25 views

Extra detailed bounding polygon from many geometric points

I have a database of around 100,000 postcodes each with lat/lon which I have converted to geom type in PostGIS. Each postcode also has one of 5 "regions". I wish to generate an accurate bounding ...
1
vote
2answers
47 views

How to find all features in one table that intersect features in another table in PostGIS?

I have two tables, boundary polygon table and location point table. I need to find all boundary polygons that contain at least 1 location point. What is the proper way to do this in PostGIS? I tried: ...
1
vote
1answer
18 views

Is there a way to edit the host name of Postgis layer?

Recently I change my server to a remote host. That's means all my work there I used Postgis layers, the host name at the source is set to 'localhost' and I need to change to 'remotehostname'. The ...
1
vote
1answer
22 views

convert XML to PostgreSQL using MATLAB

In a weeks time I should be able to transfer the GIS data provided in the XML format to PostgreSQL database. I have prepared the PostgreSQL database (empty) and looking at Matlab scripts. (I am on ...
1
vote
0answers
18 views

qGIS' Database Manager “Load as New Layer” Option Not Working

I'm trying to visualize some of my database queries on qGIS. I run a valid SQL query which returns a subset of my table that should be easily loaded as a layer. I then check "Load as new layer," ...
3
votes
1answer
22 views

Update/refresh edited PostGIS table in QGIS

I imported a PostGIS table (with geometry) from my PostgreSQL database as a layer in QGIS. Later, I edited the table using PostgreSQL UPDATE commands. Is there a way to quickly update (like a refresh ...
0
votes
0answers
20 views

Consult the charts of a line

I have a table of bus lines and other bus stops in PostGIS. Are conformed to the image below, the lines and the stops on the sides. I want to relate the lines with parades through a spatial query. ...
2
votes
4answers
67 views

How to assign geometry to records in a table that contain an ID of a geometry point?

We are looking to map out 'incidents' at schools, but the incident table, which contains a few thousand records, only has a school number (plus the incident data). The table format is an Excel ...
1
vote
2answers
52 views

Conversion of point grid to a raster with open source tools (Gdal, QGIS …)

I'm looking to do something which seem simple to me, but I haven't found a solution since 2 days I looked for. I've got a Postgis DB with lot of points (WGS84) spaced of 100 meters which cover a ...
2
votes
1answer
24 views

pass an array of geometry to postgresql function

I am trying to pass an array of geometry to a postgis function using JDBC with JAVA: CallableStatement proc = conn.prepareCall("{ ? = call somefunc(?) }"); ...
1
vote
2answers
39 views

PostGIS ERROR: getPoint4d_p: point offset out of range

I have a set of streets (LINESTRING) in a PostGIS 9.1 PostGIS 2.1 database. I need to obtain points from the lines, on the right and on the left of the street. I offset the lines with: ...
1
vote
1answer
45 views

Finding closest Intersection between line strings (PostGIS)

I want to find the distance between one point (excavation sites) and a line (rivers) for the cardinal directions. What I thought would be the easiest way is to draw lines between the excavation site ...
0
votes
0answers
22 views

OpenStreetMap Road and Polygon Data as 1x1 Degree Shapefiles

I am working on a global project for which I want to use OSM data as a model input. I am looking for advice on the best way to produce 1x1 degree WGS84 shapefiles from either regional extracts or the ...
1
vote
1answer
33 views

ST_Union to merge tables containing lines?

I have to build a street network with Postgis that will be used with pgrouting. I have two tables: 1) the_network (182 lines): is a MULTILINESTRING table. Having columns road_name (varchar) / ...
0
votes
0answers
7 views

Credential Dialog, disabling default Realm information messages disclosing password

I'm using the QgsCredentialDialog for determining user access to the database. When a user is failing to log in correctly the log in credentials are shown in the dialog (Fig. 1). Despite the ...
0
votes
1answer
25 views

Self organizing maps with Postgis

I am trying to plot hot regions. It's reorganizing mapping We have a table "product" with three attributes : lat log n_items: number of items that we sell I'd like to group point in one polygon ...
1
vote
1answer
28 views

Trying to understand / troubleshoot intersection behavior of postgis

I'm trying to calculate the percent of intersection between two polygons using postgis. I was able to do so successfully for 90% of my polygons, but about 1500 have very unexpected values. I ...
3
votes
0answers
61 views

Editing PostGIS topology in a web browser

I am trying to conceptualize the best process for editing topology from PostGIS in a web browser. Ideally what I would like to accomplish is the loading of a topology (imagine the lower 48 states of ...
3
votes
1answer
89 views

ST_Buffer returns inaccurate results with radius of over 1 meter

I have a specific location: lat, lng and accuracy(meters) I want to return a geography object that will represent a polygon that surrounds this point with a given radius that will be equivalent to ...
2
votes
2answers
41 views

Extract a PostGIS dump from OSM with a particular tag

I'm new to OpenStreetMap. I want to extract all restaurants from Switzerland with their capacity if available. I am using osmosis. I tried: osmosis --read-pbf file=switzerland.pbf --tf accept-nodes ...
1
vote
1answer
28 views

Weird ST_Contains behaviour

I'm creating a polygon and then checks whether one of the origin points is contained inside the polygon. To my surprise, I get False (?!) What is wrong here? SELECT ST_contains(ST_GeomFromText('POINT ...
1
vote
2answers
34 views

Can 'Source' and 'Target' in the roads table for routing be duplicate?

I am using pgr_ksp for finding multiple paths for single source and destination. I am wondering if 'source' and 'target' in a roads table are unique or not. because when i am doing routing on my road ...
0
votes
0answers
4 views

Query from plugin that shows result on Map and in Attribute Table

I'd like to create a plugin that performs a static (no user input required) query that, based on a condition, selects all the features on the map and displays these in the attribute table. I have the ...
0
votes
1answer
30 views

PostGIS transform geometry with long crs

How do i transform a geometry to a new geometry with a crs like urn:ogc:def:crs:EPSG::25832 st_transform(geom,integer srid) obviously doesn't work since my srid is a string found a solution ...
1
vote
0answers
42 views

Display postGis query result on Google maps Api [closed]

I have MULTILINESTRING Geometry in Postgis and as Google Api does not provide any way to plot MULTILINESTRING , i'm converting MUltiLINEstring to LINESTRING through ST_Merge function. But when i'm ...
1
vote
0answers
16 views

How to set tolerance value of ST_Intersects query in TileMill?

I want to place river names in Tilemill. I use "text-dy" to displace label from the center line of a river. But for labeling polygonal rivers, names extracted from lines are used too. So at a small ...
1
vote
1answer
64 views

How to cluster similar lines in PostGIS?

In PostGIS I have a large database of linestrings which I have obtained using ST_makeline function. I would like to cluster similar lines based on where the lines start and end. Here is an example ...
0
votes
0answers
29 views

How to get create new object right in postgresql

I created a .shp in QGIS successfully and now i want to move on this to postgis db, following this command shp2pgsql -s 2964 roads.shp lakes_new | psql qgis_db but i got this error how to solve ...
0
votes
1answer
24 views

Error with Gdal 1.10 install on Ubuntu 13.10

I've installed GDAL 1.9 then upgrade to 1.10 on Ubuntu 13.10 and then now it's error (gdalwarp can work but gdal_translate is fail) gdal_translate ERROR 1: gdal_translate was compiled against GDAL ...
3
votes
1answer
45 views

Configuring Geoserver to use a specific postgis geometry column as the default

I have a PostGIS table with two geometry columns, both multipolygon but one with SRID 4326, the other 3857. When publishing the table in Geoserver, I realize that Geoserver defaults to using the first ...
1
vote
2answers
53 views

adjusting polygons to boundary and filling holes

here's the problem: Where: 1: department boundary 3: polygons inside department boundary that "touch" the department boundary(1). They are not necesary fitting well inside 2: holes between 1 and ...