1
vote
1answer
78 views

Counting self intersections of linestring using PostGIS?

Is there a way of using PostgreSQL + PostGIS for finding the number of self intersections in a linestring? I have a linestring that goes forward but in circles, and I need to find the number of times ...
0
votes
1answer
52 views

Intersecting great circle arcs and polygons

I am trying to find the point of intersection between a great cirle arc and a polygon. I am working in long/lat, where I am given the endpoints of the great circle arc, A and B, and the vertices, C, ...
1
vote
2answers
79 views

Is it best to use multipolygon or polygon features for large intersect operations?

I have two large layers that I want to do intersect operations. One is municipalities and the other is landuse. Right now, the landuse layer is of MultiPolygon type that is, for the entire state, I ...
0
votes
1answer
58 views

postgis finding lines that touch and update

I am not much of a postgis guy so please bear with me. I have a subset of lines representing exits and roads around those exists. Main roads and exists can be distinguished by their class attribute ...
1
vote
1answer
111 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 ...
1
vote
1answer
41 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 ...
2
votes
1answer
92 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
3answers
117 views

How to count points once with overlappying polygons?

All, We're using parcel data (polygon) to count student locations (point) based on parcel type. We're doing this using SQL and the ST_Intersects function. It works great, except the City and County ...
1
vote
3answers
96 views

Geometry vs geography for line-to-polygon intersection

I have two WGS84 NAD83 shapefiles, one polygonal, the other containing lines: Geometry: Polygon Feature Count: 1294 Extent: (-79.761059, 44.991143) - (-57.105486, 62.582865) Layer SRS WKT: ...
1
vote
0answers
106 views

PostGIS: How to distinguish overlapping routes (i.e., LineStrings) based on their direction?

I have a set of routes which are represented by LineStrings in my PostGIS database. These routes represent journeys that people make. I want to come up with routes that (a) overlap, and (b) have the ...
3
votes
1answer
363 views

PostGIS intersection function

I have a problem with intersection function. I built my query following http://manual.linfiniti.com/en/postgis/geometry.html, 5.7 section. I made my clip object, a red linestring frame: But after ...
1
vote
0answers
49 views

How to get intersected points between polygon and line in desired order

I have polygon for example "POLYGON((5 1, 6 1, 6 5, 5 5, 5 1))" that I want to intersect with line "LINESTRING(0 2, 10 2, 10 3, 0 3, 0 4, 10 4)" and get intersection points in the order that they ...
4
votes
2answers
168 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 ...
1
vote
1answer
108 views

ST_Intersects incorrectly returning false in PostGIS

I have a shapefile created from ArcMap that contains about 400 geometry's. I've added this shapefile into PostGIS using the shp2pgsql tool. I am trying to use the ST_Intersects function to determine ...
0
votes
2answers
109 views

Intersect and MBR in POSTGIS and Mysql

I would like to know if POSTGIS and MySql with Spatial Extension use true geometry to find intersections/overlaps between geospatial objects. But i don't find it precisely in the documentation. I know ...
1
vote
1answer
110 views

creating a st_contains query with geographies not geometries

I'm trying to find all the geography points that are contained in a geography polygon, let say all the traffic lights within a given city or neighborhoods, how can i convert this working st_intersect ...
1
vote
1answer
89 views

determining what polygons intersect another layer

I am attempting to establish what spatial relationship exists (if any) between two layers. I have two layers - one is a road network with a buffer of 500m, and the other is a collection of polygons ...
1
vote
1answer
75 views

Separating distinct lines in PostGIS

I have a table of linestring segments in Postgis. These segments make up distinct non-intersecting lines as shown by the diagram. To add confusion the direction of the linestrings are not uniform. I ...
0
votes
1answer
214 views

Maximum size on the bounding box with ST_MakeEnvelope and && and geography column in PostGIS?

I've done quite a few google searches, but haven't managed to find anything that has helped me directly. I've got a few features in a PostGIS table with a geography column. The features are focused ...
2
votes
1answer
128 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 ...
1
vote
3answers
195 views

ST_Intersection point of two 3D linestrings - how is the Z value calculated?

I have two 3D linestrings (geometry type LINESTRING Z) in a PostGIS database that intersect in 2D space, but not in 3D space. Given that there is technically no 'shared portion' of geometry in 3D, how ...
3
votes
2answers
170 views

geospatial libraries like postgis

I'm pretty comfortable with postgis, but I realized that for part of my application, having a database is pretty heavy. I'd like to be able to take a stream of Point objects and check against an in ...
5
votes
1answer
301 views

Performance in calculating raster statistics in PostGIS

I'm trying to calculate raster statistics (min, max, mean) for each polygon in a vector layer using PostgreSQL/PostGIS. This GIS.SE answer describes how to do this, by calculating the intersection ...
1
vote
1answer
218 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. ...
1
vote
2answers
77 views

Using st_intersects caused mismatch when a marking (tagging) shape marked a polygon overlapping only on the edge

I have accidentally marked a landshape as being tagged "CU GO-M" because it seems to share an edge with a tagshape for "CU GO-M" but nothing else. I used the st_intersects method to join these shapes ...
1
vote
3answers
116 views

PostGIS intersect on insert?

I have a large amount of point data that I have in CSV form. I am able to insert it all into a PostGIS table no problem. What I want to do though, is split the data up on insert into multiple separate ...
1
vote
1answer
63 views

st_intersects on postgis

I'm trying to write a command to see whether a given point lies within a multipolygon boundary (in this case, a watershed). I have a table of watershed boundaries and another table with the point I'm ...
2
votes
1answer
64 views

Intersecting Layers Returns Empty Collection Despite Visible Intersection

When I perform an intersection of a polygon I draw in OpenLayers and a postgis database layer, it seems that I am getting incorrect results. Intersection works correctly on some layers. For ...
2
votes
0answers
211 views

3D features (Polyline, Polygon) intersection library

For my research I am looking for a (python) library to get the intersection of some 3D features. The features can be Polygons or Polylines. Mostly I need to intersect a plane with my features and get ...
0
votes
1answer
151 views

Circles created by points inside bounding box query - PostGIS

The table that i want to perform this query has 3 columns: id, the_geom and seen_count. The query i've been using to get points inside a bounding box is as follows: SELECT id, ST_AsGeoJSON(the_geom) ...
2
votes
1answer
304 views

Help building SQL query to get a list of streets of a city

From two layers in PostGIS (osm_places and osm_roads), I would need to have the roads belonging to a certain city. It would be fair enough to get the street names of all streets in a radius of X ...
3
votes
2answers
308 views

Postgis: aggregate function for intersection

I have a PostGIS Table with LINESTRINGS. I like to a query that returns all Roads that are connected. So I get a set of unconnected trees (in german 'Wald (Graphentheorie)') pseudo code: select ...
3
votes
1answer
271 views

PostGIS: Using a polygon to 'mask' linestrings returns both multi and linestrings

I have a table of linestrings (OSM roads, in fact) that I'm displaying on a map. I want to filter them so that only those within a certain area are displayed- I've already done this with the coastline ...
5
votes
3answers
330 views

Trying to combine nearby points into a polygon

We have collected millions of cell phone strength readings. I am trying to group points of the same strenght that are within a distance of each other in to a polygon. I asked on the postgis mailing ...
5
votes
1answer
406 views

adding multiple points to a linestring in PostGIS

Though a newbie to PostGIS, I'm having trouble solving something that I think should be farily straightforward. I have two linestring tables, both consisting of simple, 2-node line objects: one has ...
-2
votes
1answer
478 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( ...
5
votes
2answers
443 views

Best strategy for polygon search?

I have a fairly simple question. What is the best strategy to do the following scenario? I think this is a very common scenario: I have a several thousands of dataset with polygon/points. Each ...
3
votes
1answer
199 views

Intersect multilinestring (A) with multilinestring (B) retaining linear sequencing in resultset? [closed]

I have a PostGIS table testtin2 which is a sort of pseudo TIN consisting of a single multilinestring geometry, which I am intersecting with another table align, also a multilinestring, to generate a ...
2
votes
1answer
217 views

Query for segments at same place and time in PostGIS

A newbie-question: I've imported the segments of several GPX-Tracks in a PostGIS-Table. Now I'm looking for a query that returns all segments that: are spatially overlapping (within a specific ...
4
votes
1answer
562 views

Spatial Join in PostGIS according to Line Attribute

I am in the process of building a data warehouse in PostGIS, that will store the length of the road network of a country (Lines) per Administrative Area (i.e. Province or State, referred to as AA ...
4
votes
1answer
1k views

PostGIS geometry intersection test results different for Point and Linestring

Can anyone please tell me what I'm doing wrong, and how do I avoid the problem? I'll attempt to clarify what I'm doing as things go along. The geom column is a multipolygon column, all values are ...
14
votes
2answers
2k views

Identifying road intersections using PostGIS

I'm trying to identify where roads intersect each other, and to make a point at this intersection, with the number of roads that form the intersection listed. I was wondering if there was some way ...
1
vote
1answer
225 views

How to get all intersecting points to a given area and vice-versa in PostGIS?

I'm developing a project using PostGIS to hold spatial data where I have records that hold geometry point data and records that hold geometry area data. To solve my problem I'm looking for two queries ...
13
votes
6answers
6k views

How to use ST_Intersection?

Here's a quick summary about what I'm trying to do: I have 3 tables in Postgres, 'a' and 'b', each have a Polygon column, and 'c' has a Point column. What I'm trying to do here is to get the ...
6
votes
1answer
767 views

Intersection of multiple layers in PostGIS

I need to write PL/pgSQL stored procedure for calculation of intersection of multiple layers. For example, for three layers A, B, C this function should return ABC geometry: Function takes as input ...
14
votes
4answers
2k 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 ...
17
votes
4answers
5k views

Separate polygons based on intersection using PostGIS

I have a PostGIS table of polygons where some intersect with one another. This is what I'm trying to do: For a given polygon selected by id, give me all of the polygons that intersect. Basically, ...