1
vote
2answers
24 views

How to extract a new linestring vector from a existing multipolygon in QGIS?

What I want to do: create a new line (named linestring in Postgis?) from existing multipolygon layer in Postgis. Purpose: once these lines are created, I'll run some distance calcs from specific ...
1
vote
0answers
22 views

Merge overlapping GeoJSON GeometryCollections

I need to merge three overlapping GeoJSON GeometryCollections of Polygon. Ultimately, the end result needs to be a geom type for PostGIS (e.g. MULTIPOLYGON) so I can easily check if particular points ...
-1
votes
0answers
39 views

how to determine the direction in point-in-polygon

I am very new to GIS and I am wondering if the following problem could be solved or not. Given that there are three pairs of points(A<-B, C->D, E<-F) Each pair of points has a direction and ...
1
vote
1answer
49 views

PostGIS: Update child geometries based on parent

I'm using Leaflet and postgis in a case where using Leaflet draw plugin I draw a polygon first like this Now, I draw a line which cuts the polygon and using line and polygon geometry, based on ...
6
votes
1answer
60 views

Suitable algorithms for simplifying isochrone polygons

I'm looking for an algorithm for simplifying isochrones which were generated using OSM data. These are generally characterised as having lots of small "holes" mostly due to missing OSM data but also ...
2
votes
1answer
42 views

Spike finder in PostGIS

I tried to modify spikeRemover from Schmidt & Kr├╝ger. My goal it's to obtain, for each polygon, the position of the spikes. I don't need to remove it. For some reason, that I can't figure out, my ...
0
votes
1answer
35 views

Extract address data / Query point in administrative boundary

I try to create a DB in postgreSQL with all the postal adress data for a specific country. Actually I have this table full of data: id integer NOT NULL DEFAULT nextval('plz_id_seq'::regclass), ...
3
votes
1answer
47 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
119 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 ...
3
votes
1answer
97 views

PostGIS - when I add a polygon, delete overlapping areas in other layers

I'm starting to work with PostGIS and I'd like to solve the following problem: In my database, I have multiple land use class layers, for example: "residential", "industrial", "commercial". The ...
2
votes
1answer
81 views

Area of polygon split by a line

I need a query that return the area of two polygons that have been split by a line. This is what I did so far: SELECT ST_Area(ST_Split(surface.geom, limite_a.geom)) from surface, limite_a where ...
0
votes
1answer
42 views

Query to create polygone from lines that touches in POSTGIS

I am trying to create polygons from a line layer with a spatial query in postgis the probleme is i dont have a lot of information on the lines only id of each line and geometry thanks for your help
2
votes
1answer
52 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
91 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 ...
1
vote
2answers
110 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 ...
0
votes
2answers
54 views

Select area which is at least x meters away from other geometries

In my table I have the build-up area from a region as a big number of polygons. urban_area: id | name | geometry(polygon) I was wondering if and how I would be able to find the area within a ...
1
vote
0answers
95 views

Need to enhance a function for creating quadrants within polygons

I wrote a function that creates arbitrary quadrants within a polygon SELECT (quadrant(20,0.0,90)).* The first parameter is the polygon ID, the second one is the start angle and with the third one ...
1
vote
1answer
236 views

How to improve speed of rendering polygons from Postgis in Leaflet?

I want to improve speed of rendering polygons in my Leaflet map. Polygons are stored in Postgis, and are rendered with select query with bbox. I wonder can I cache somehow those polygons? I read ...
2
votes
0answers
57 views

Using ST_Affine() and trans_param() functions on vector layer

After reading this post How to georeference a vector layer with control points? I decided to give it a try to move/rotation/scale a polygon using Postgis. I have two polygons, polygon_from and ...
2
votes
1answer
117 views

Separate a polygon in different polygons depending of the distance to another polygon

I have a reference polygon "R", and others polygons (in grey). I want to separate each grey polygon in multiple polygons, depending on the distance to R with different Buffers : - The red line is R ...
3
votes
1answer
168 views

Postgis identify points on the polygon border

I have points geom in gid,pt_geom and polygon geom in gid,pl_geom. Some of the points are inside polygon and some are outside polygon, others are on the polygon boundary. Is there any way to ...
3
votes
1answer
83 views

Postgis 2.0 geographic polygon has max longitudinal range

My problem is that I have a load of geographic point data (srid 4326) in a table. A user may do a bounding box search - essentially create a polygon as follows: l_poly geography(Polygon,4326):= ...
1
vote
1answer
210 views

Intersection of multi-polygons in postgis

How can I get the intersection of 3 multi-polygons in postgis? I have three geometry collection and I want a fourth with the result of intersection of the other three. ...
2
votes
0answers
101 views

Find and destroy duplicate OSM multipolygon/polygons in TileMill/PostGIS

In OpenStreetMap there are sometimes multipolygons where attributes are present on both the polygon and the multipolygon relation, such as the Grampians National Park: ...
2
votes
2answers
241 views

Finding points along a path

I am unsure of the best approach to this problem. I can think of some ways of doing it which I will list below but I am looking for the best and most efficient way of doing this. Problem Given a ...
2
votes
2answers
324 views

Iterating polygons on a SpatialPolygonsDataFrame in R with readWKT

I have fetched some data (39 objects) from my PostGIS database and converted this data into a matrix: rs <- dbSendQuery(con, "SELECT ST_AsText(polygon_accumulation) AS ShapeWKT from ...
3
votes
1answer
251 views

Merging partially overlapping polygons into a table in PostGIS

I have a couple of tables (three) with polygons (landuse coverage in this case). Within each table, there is no overlap, but between tables there might be a lot of overlap. I would like to combine ...
0
votes
0answers
80 views

Polygon dynamic grid creation for a shape file

I have used QGIS Vector->ResearchTools-> Vector Grid to create a 1lat x 1 long grid for the landpolygon shape file (from osm). Now, I am interested in creating dynamic grid for the original ...
0
votes
1answer
151 views

Polygon grid shape file for landmass

I am interested in generating a polygon grid shape file for the landmass of the world. What I have presently is two tables in postgreSQL. Table 1: Coastal area shapefile ...
0
votes
0answers
883 views

How to write a point-in-polygon query for Postgis?

I'm trying to write a query in Postgis which will return all rows where a dynamically changing longitude/latitude point resides within the geometric polygon of that row (in the geom column). This is ...
1
vote
4answers
173 views

Web service to see postgis polygons

Is there any website or web service where I throw a polygon postgis and he show me on the map this polygon. Example: I put this POLYGON((0 0, 1 0, 1 1, 0 1, 0 0)) and the service show me the ...
7
votes
3answers
2k views

How to insert a GeoJSON polygon into a PostGIS table?

I need to insert a polygon from GeoJSON to my PostGIS table. This is how the SQL query looks like. INSERT INTO tablename (name, polygon) VALUES ( 'Name', ST_GeomFromGeoJSON ( { ...
1
vote
1answer
221 views

Polygon to fill gap

Using postgis I want to fill a gap between other polygons. Can you help with some directions what functions to use ? Thank you and sorry if the question is rather noobish. Image to explain from ...
3
votes
3answers
945 views

How to add a polygon from PostGIS ST_AsGeoJSON into Leaflet?

I try to use the following function to add polygons to my Leaflet map. function polygon(geojson) { alert(geojson); // alert for testing layer = L.geoJson(geojson); layer.addTo(map); } ...
2
votes
1answer
530 views

How to get polygons from PostGIS table to PHP array best?

Currently I fetch polygons from a database table using ST_AsText(). The results are in text format, like the following. POLYGON((84 104,212 48,321 122,243 179,275 238,131 240,84 104)) I am not ...
0
votes
2answers
863 views

Cannot insert simple geometry data

I installed PostgreSQL 9.2.4 and PostGIS 2.0.3 on my Windows 8 machine. Then I created a table using phpPgAdmin and added a geometry column using the following statement. SELECT ...
3
votes
1answer
125 views

How can I check if a multipolygon can be represented as a simple polygon?

I have a large (30m+ records) spatial data set I have imported into a PostGIS database. I did not expect to find multipolygons in the data set, but it does have a few of them. I'd like to take a ...
1
vote
1answer
286 views

Aggregate points with same values to polygons

I have a shapefile with 2M measurement points (each measurement point has a resolution of a 1/10). How can I aggregate points around each other if and create polygons out of it? They do not have to ...
10
votes
5answers
4k views

How best to fix a non-noded intersection problem in PostGIS?

I'm using a PL/R function and PostGIS to generate voronoi polygons around a set of points. The function that I am using is defined here. When I use this function on a particular dataset I get the ...
2
votes
1answer
96 views

What is the PostGIS function for retrieving buildings by road side?

I want to get information of buildings by the road side only. Assuming that the building table has multi-polygon geometry and the road table has multi-linestring geometry, what would be a pgSQL Query ...
3
votes
1answer
830 views

Merging multipolygon data into a polygon

I have a MultiPolygon representation of some shapes in POSTGIS, I am trying to convert them to Polygon data. I tried, st_geometryn(r.geom, 1) but that didnt work because the way polygons are ...
1
vote
0answers
516 views

How to handle postgresql/postgis geometry type errors in a function?

I have created the following function in PL/SQL to make a polygon from a set of linestrings: CREATE OR REPLACE FUNCTION _myfunction( _fid integer, _rid integer ) RETURNS VOID AS $$ ...
2
votes
1answer
181 views

how to create an outline polygon (footprint) from raster data with postgis?

how can I create a polygon, containing the actual outlines (aka footprint) of a raster file with postgis? I just need the outlines of the data containing parts of the raster. ST_PixelAsPolygon ...
3
votes
1answer
1k views

How to take polygon centroid in Postgis

I have table with column name,Latitude and Longitude.I want to update this with polygon name and its centroid latitude longitude.I know there is a function in postgis st_centroid(geometry). But I want ...
-2
votes
1answer
457 views

Postgis error on select all intersetcs of a polygon [closed]

i can get all polygon on intersects this:-7.9245860488441 -37.122384500713,-7.9245860488441 -37.11904223938,-7.9233955716106 -37.1187601948 SELECT * FROM propriedades WHERE ST_Intersects( ...
3
votes
0answers
184 views

How to estimate the average width of a sidewalk? [duplicate]

I have a table with two polygons representing urban block with and without the sidewalk: geomBlock and geomBlockWithSidewalk. On my city we can approximate the polygons of geomBlockWithSidewalk to a ...
2
votes
1answer
484 views

How can I get the corners of a polygon in latitude and longitude?

How can I get the corners of a polygon -a square/rectangle, to be precise- in latitude-longitude format by using its geom value -or some other way, perhaps-? Thanks.
0
votes
1answer
348 views

To get attribute data of polygon layer by giving Lat/Lon

Is anyone having an idea about how to get attribute data of a polygon layer by giving Coordinates with in that polygon. Here i have tried with these codes.. SELECT * FROM kar_bbmp_198 WHERE ...
0
votes
2answers
291 views

How to retrieve a single polygon from a multipolygon layer in GeoServer

I have a multipolygon layer in GeoServer. The layer represents states within a country. I want to enable a user to search for a specific state, and then only the selected state to be displayed on the ...
2
votes
1answer
323 views

determine whether a circle intersects a county boundary in postGIS

I'm using PostGIS 2.0.1 and need to determine whether a circle (center + radius) intersects a county boundary (polygon). The query I'm using is this: SELECT DISTINCT(u.id) FROM siteareas_poly sa, ...