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

learn more… | top users | synonyms

0
votes
0answers
3 views

What is the easiest way to avoid shapefile columns being imported as PostGIS `numeric(p,s)` data type?

Considering the number of shapefiles I've imported to PostGIS (using shp2pgsql or ogr2ogr), I'm a little surprised I haven't come across this before. But I have a shapefile that has numeric columns ...
1
vote
1answer
17 views

Updating table setting a case with ST_Intersection

I'm trying to update a geometry column using this command: UPDATE mad SET geom_p=CASE WHEN ST_CoveredBy(mad.geom,b.geom) THEN mad.geom ELSE ST_Multi(ST_Intersection(mad.geom,b.geom)) END AS ...
1
vote
1answer
34 views

PostGIS - syntax error inserting GeoJSON

I am trying to insert a GeoJSON into PostGIS, but I am encountering a syntax error. I can't seem to see where the problem is - I'm sure it is an easy issue to resolve, but my inexperienced eyes can't ...
1
vote
1answer
19 views

Why can't PHP insert new geometry on PostGIS?

(Copied this question from stackoverflow, since it may have more answers here.) I'm using ogr2ogr to upload a GPX file to PostGIS. When I do it on command line (Ubuntu 14.04), it works fine. ...
4
votes
1answer
270 views

Building a ol3 web application with dynamic content and user registration

My set-up: Currently I’m using a PostGIS database, with a GeoServer service and displaying the data with OpenLayers 3. I use WFS data to display the features in clusters and I’m able to edit them ...
-1
votes
0answers
21 views

Most representative spatial queries [on hold]

I would like to do few tests of different spatial databases and compare response times for different types of queries. There are some studies available but they often do not present the selection of ...
-7
votes
1answer
41 views

how to minimize the time for the execution of the request? [on hold]

hello i'm tired with this query, and i would minimize the time for execution of this request, so how to minimize the time for the execution of the request (13 million MS and not yet)!! update troncon ...
0
votes
0answers
9 views

WMS Layers from Azure Geoserver not loading with multiple users

I am loading multiple WMS layers into a leaflet web application from an Azure virtual machine Geoserver that pulls data from a PostGIS database on the same machine. The layers load through quickly ...
3
votes
1answer
47 views

Make TileStache cache faster

I am serving vector tiles using TileStache, I have everything set up like I want. My data is stored in Postgres and I am using the VecTiles provider to serve GeoJSON tiles. I want to cache all my ...
1
vote
2answers
227 views

Utilizing OSM Data in a Postgres/PostGIS database in ArcMap

I've been trying for over a week now, and I'm not sure what i'm doing wrong and I haven't found the answer yet. I am trying to display and symbolize the OSM dataset over Jordan in ArcGIS for Desktop ...
1
vote
0answers
23 views

Is it necessary to use hibernate-spatial for postgis?

I'm beginner in GIS. I have a database in PostgreSQL that contains a table location, that table contains a column with type point. I have to get points and display it on google map. Once I did the ...
1
vote
1answer
21 views

Storing GML Polygon in PostGIS 2, ERROR: unknown spatial reference system

I am receiving GML as part of a larger XML message. When I receive the XML it is unmarshalled to Java objects. I have no rights to alter the schemas or the generated Java code. Therefore, I later have ...
1
vote
1answer
185 views

How to update the OSM data in a PGRouting Database built with osm2pgrouting?

I'm using a PGRouting database originally built with osm2pgrouting from a *.osm file downloaded from Mapzen. If I want to update the OSM data in that database, ie. re-build my PGRouting Database, ...
1
vote
2answers
47 views

Calculate area parts of polygon intersections

I have a problem of calculating area sizes of intersected polygons in postgis. I would represent the problem in an example (please see the picture). I have a gridsquare table with some attributes like ...
21
votes
6answers
5k views

PostGIS: Select features that do NOT intersect

This seems to me like such a simple question (and it probably is) yet I cannot seem to find an example that gives me the answer. Using PostGIS, I just want to select points that fall outside of ...
2
votes
4answers
283 views

Transform GeoJSON geometry to WKB

I need transform geometry from JSON like: ...
1
vote
1answer
22 views

Finding locations within a radius of a given path [duplicate]

I am trying to figure out in Postgis the right sql statement for the following: I have in my database a table of merchants with latitudes and longitudes; I have a route from google that lists a lot ...
11
votes
5answers
3k views

Simplifying polygons to linestring

I would like to simplify some polygons that represent rivers into linestrings. I assume that holes in polygons can be omitted. Anybody has some good idea how to simply do it? It would be nice, if it ...
7
votes
2answers
3k views

SQL query to have a complete geojson feature from PostGIS

I would like to get a geojson feature with properties from PostGIS. I have found an example to have a feature collection but I can't make it works for just a feature. so far I tryed to modify the ...
1
vote
1answer
29 views

Area of influence with CartoDB

I am working on a city transport map, and for fun (and practice) I try to make an area of influence of transport station. But, whatever I try, something gets wrong. So two questions. 1 - How can I ...
1
vote
1answer
27 views

Getting node information of a way in OSM2PGSQL data

I have a feeling this is not possible, but I am looking to get information on the nodes which are part of a line in the planet_osm_line table. The issue which I am trying to handle is I am trying to ...
3
votes
1answer
31 views

How to use ORDER BY GROUP BY & LIMIT

How do I use ORDER BY, GROUP BY & LIMIT in the following query through column name KPH? SELECT * FROM data WHERE ST_Within( ST_Transform(geom, 2163), ST_Buffer( ST_Transform( ...
1
vote
1answer
48 views

Database Tiled Aggregation request

We have a table in MariaDB that contains a lot of point of interest. These POI have a list of numerical attribute such has occurrence, weight, etc. We are looking for a way to aggregate these POI by ...
1
vote
1answer
30 views

St_ClosestPoint within St_MakeLine Query problem

I am currently trying to create the closest point (closest_ports_point_test) on the grid (lng_grid_test) from the original points (ports_point), and to create the line connecting the original and the ...
3
votes
1answer
38 views

Decoding POSTGIS dump file

I have a dump from a version of PostGIS that is no longer supported. It dumps the value of a (lat, long) as 01010000003D2CD49AE6A549409AB1683A3B19F1BF How can I decode that number (without using ...
3
votes
1answer
23 views

How to update OSM data using osm2pgsql?

I have already loaded osm data into postgresql earlier. Now I want to update the database. I have downloaded the pbf file from geofabrik. How I can update the database without deleting the existing ...
2
votes
2answers
55 views

Converting shapefile to postgis without giving bounding box

ogr2ogr -progress --config PG_USE_COPY YES -f PostgreSQL PG:"<myconnection>" -lco DIM=2 /path/to/myshapefilename.shp myshapefilename -overwrite -lco GEOMETRY_NAME=geom -lco FID=id -spat ...
2
votes
1answer
26 views

Postgis query to sort geometries by latitude

I am looking for an efficient way to get geometries sorted by their latitude (northmost in case of polygons) when querying a postGis database Something that could work in an order by clause which ...
3
votes
2answers
142 views

Transform geometry to coordinates

I need transform with postgis a geometry of type ...
0
votes
0answers
24 views

How to replace a part of OSM data in postgres?

i want to replace the apart of osm data in postgrs database. for example ,replace the osm data of china which in planet osm data. i hava used osm2pgsql, but if use osm2pgsql import the china data ...
1
vote
1answer
172 views

How to transform isolines to isopolygons with postgis?

I have a table a postgis table of isolines that's defined like this: CREATE TABLE myisolines ( gid serial NOT NULL, isotime timestamp without timezone, val numeric(10,4), geom ...
1
vote
0answers
13 views

like finding errors overlap on the same layer in postgis?

After meeting the overlay erroneous polygons in the same layer, I used the following query: select gid from limite_localidad where not ST_Overlaps(the_geom,the_geom) I have to leave 108 records ...
0
votes
1answer
197 views

WFS with authentication to PostGis (or to shape)

Is there a way to import data from a WFS layer to a Postgis table (or to a shape)? there are blogs explaining how to do it in 3 steps (http://anitagraser.com/2012/09/26/wfs-to-postgis-in-3-steps/) or ...
2
votes
0answers
73 views

Large (ish) tables in PostgreSQL - Am I properly leveraging the capabilities of PostGIS? [closed]

I am using PostgreSQL and PostGIS to do some exploratory analysis and eventually spatial analysis. I have a table with 40M+ points (geolocated tweets) in the United States that has a spatial index. I ...
2
votes
1answer
521 views

How to obtain closest point of point over polylines layer in PostGIS 1.4 (without st_ClosestPoint)?

I´ve got a polylines layer (pipes) and a points layer (valves) and In Postgis 1.4 I would like to obtain the closest points but exactly on the closest polyline. In other words, i need to locate each ...
-1
votes
0answers
29 views

Calculating shortest path between multiple nodes using PostGIS?

I recently started to work with postgresql, postgis and qgis and I am trying to figure out a way to calculate, for each node (shapefile), which is the cheapest path (depending of the implied "cost" of ...
4
votes
3answers
68 views

QGIS reduce density of points displayed

I'm working with a considerable amount of points and I would like to be able to display only part of them since they overlap a lot and are cumbersome to display. Most of them form a trajectory so ...
1
vote
2answers
551 views

can't geocode with PostGIS 2.1.1

I don't know where's the mistake... I am using the process from the PostGIS documentation (http://postgis.net/docs/manual-2.1/postgis_installation.html#loading_extras_tiger_geocoder) . I created a ...
0
votes
0answers
13 views

Error on ST_UNION: SSL SYSCALL error: EOF detected

I'm using Postgres 9.4 and PostGIS 2.1. I have a table that looks like this: wkb_geometry | geometry(Polygon,4326) | id | integer | county | character varying | ...
1
vote
2answers
18 views

ST_MAKEVALID: ERROR: Geometry type (MultiPolygon) does not match column type (Polygon)

I'm using Postgres 9.4 and PostGIS 2.1. I have a table that looks like this: wkb_geometry | geometry(Polygon,4326) | id | integer | county | character varying | ...
0
votes
1answer
23 views

How to deal with “ERROR: GEOSUnaryUnion: TopologyException: Self-intersection”?

I'm using Postgres 9.4 and PostGIS 2.1. My table looks like this: ------------------------------------------------------------------ ogc_fid | integer | not null default ...
3
votes
1answer
642 views

Uploading raster format(*.tif) to postgis through raster2pgsql

I'm new to postgis and raster file format. i currently working on netcdf files and i want to import it into postgis through curl command line tool but its failed for me.so i jump on to GDAL v1.9.2 ...
3
votes
1answer
36 views

PostGIS: floating point representation problem with ST_AsText

I have a table with geometries, all with about 13 digits of accuracy. While trying to represent them with ST_AsText though, most vertices come out in decimal notation, but some come out in scientific ...
7
votes
1answer
196 views

PostGIS Recursive Query Based on Line Connectivity

I'm having difficulty with a query. I have a network of linestrings, each with a value in the n_type column. This can be one of a handful of options. I'd like to generate a new table that groups any ...
3
votes
2answers
173 views

Update area column after changes in QGIS

I'am using QGIS and POSTGIS, for example to automatically calculate the area of a new created polygon. I do that with following code: CREATE OR REPLACE FUNCTION calc_area() RETURNS trigger AS $BODY$ ...
2
votes
1answer
21 views

PostGIS - default spatial reference and Z value on insert or geometry update?

I have a spatial table with a geometry column geometry(MultiPolygonZ,4326). We are trying to handle inserts and updates of geometries as GeoJSON from other systems of varying vintage. Everything is ...
2
votes
1answer
24 views

QGis postgis sequence is ignored

I have a problem adding new features to a Postgis database. My table has a primary key defined as gid integer NOT NULL DEFAULT nextval('bo_gid_seq'::regclass) When I try to add a new polygon in ...
18
votes
6answers
7k views

Working with PostGIS data in R?

I work with R almost all the time, and now I am using it for doing spatial data mining. I have a PostGIS database with (obviously) GIS data. If I want to make statistical spatial analysis and plot ...
2
votes
1answer
19 views

Extracting the geometry of the parts not intersecting from 2 shapes overlapping each other in postgresql?

This seems simple enough, yet i do not find a clear awnser on that peculiar matter. What i am trying to do is to extract the parts of a shape that doesn't intersect with another when the 2 of them are ...
-3
votes
0answers
35 views

Custom queries with WFS [closed]

I am working with ERDAS APOLLO 2015 with PostGIS. I Heard that there are some limitations to add custom vector analysis in WFS layers. Is it possible to do add custom queries (Spatial Filters) with ...