Questions tagged [within]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
15 views

Unable to join data from another layer

I have two polygon layers, I want to join the data based on the location from one layer to another layer. But only field is joining not the data. In image green is one layer and red is another layer. ...
user avatar
  • 259
5 votes
3 answers
146 views

Selecting all electoral division within local electoral area in QGIS

I have two vector layers: electoral divisions (blue)(similar to counties) local electoral areas (green outline) (similar to states). I'd like to select all EDs 'within' a state using 'Select by ...
user avatar
0 votes
2 answers
64 views

Equivalent or workaround for .within() method for arcpy.Point class that tests if point is within feature class

I am using ArcGIS Pro 2.6. I am looking for a quick and dirty test that returns a Boolean to see if any ArcPy Point that I create is within a feature class. Unfortunately, it seems that feature ...
user avatar
2 votes
0 answers
41 views

Merging two layers and assign ID of bigger polygons to smaller polygons within bigger

I am basically new to QGIS and want to use spatial data to get the state identifiers for small polygons (say counties/zip areas) which are geographically inside the bigger polygons (states/cities). ...
user avatar
  • 21
1 vote
1 answer
48 views

ST_Within to find containing polygon (but same table?)

I have nested polygons and would like to set a parent_zone field to describe the polygon it is within. There will only ever be one to choose from (ensured by the 'type' filter). I am trying: UPDATE ...
user avatar
  • 57
2 votes
0 answers
34 views

Checking if one point from sf object falls within a specific polygon from different sf object in R [closed]

I have one sf object in R that consists of millions of GPS points of different persons (each point includes ID for each user). I have another sf object that consists of polygons that correspond to 100-...
user avatar
  • 21
4 votes
1 answer
335 views

How does GeoPandas' representative_point() work?

I need to compute points that, unlike centroids, are assured to be within a geometry. GeoPandas offers the method geopandas.GeoDataFrame.representative_point(), but I cannot find how it works. ...
user avatar
3 votes
1 answer
115 views

NULL values when using overlay_within function in Field Calculator

I have two layers, a point layer and a polygon layer ('Sektorplan'). The polygon layer attribute table has a "Sektor" column ('1','2', ...). The Goal I want to add a new column ("Sector&...
user avatar
2 votes
1 answer
115 views

Rule-based symbol for point within polygon in QGIS

I would like to use a set of rules to draw features from a point_layer that are within a polygon_layer. Points that answer true to ("VAL_PROTECTION_EP3" = '1' AND "TYPE" = 1) ...
user avatar
  • 41
2 votes
1 answer
64 views

GeoPandas within() not returning any records

I'm trying to create a layer of all cities with 100km of the coast of Australia. The following is returning coastCities as an empty DataFrame. I have performed the same operations in ArcGIS and it ...
user avatar
  • 117
2 votes
0 answers
151 views

Select lines in within a polygon (buffer) with PostGIS

I have one polygon layer "polygons" and one line layer "lines". I would like to create a layer with all line parts that are inside the polygon layer. First I cut the lines in the ...
user avatar
  • 63
1 vote
1 answer
85 views

MariaDB St_Within

Recently I noticed that ST_Within stopped working properly on some features. The geometry that breaks st_within has 1337 vertices (ESRI arc - many segments 1cm distance). If I reduce the vertices ...
user avatar
2 votes
1 answer
72 views

PostGIS: problem with point count result when they are over the polygon edge

I have a PostgreSQL 12 database with PostGIS (using EPSG 4326). There are some tables with millions of points, and others with polygons. In general , I had no problems with the queries. However, I ...
user avatar
  • 21
1 vote
2 answers
112 views

Creating field that attributes what boundary set of points reside in

I want to be able to assign a point layer a new attribute field with the polyline that the points are within. What method would work best in this scenario?
user avatar
  • 175
3 votes
1 answer
593 views

Identify if the point lies inside the polygon in QGIS

I created a polygon using Iso-Area as polygons algorithm in QGIS. I have a point's coordinates and added it as a vector layer into QGIS. It is shown on the map that the point lies within the polygon. ...
user avatar
  • 379
2 votes
1 answer
80 views

Spatial Query for centroid of one feature falls within another

I am looking at doing a spatial query where I can find when the center of one feature falls within another. Both geometries are on different layers. For example, when the center (centroid) of an area (...
user avatar
3 votes
3 answers
80 views

Calculating value of unique points in polygon in PostGIS

I'm working with a spatial PostgreSQL database that contains species records, there is a point layer 'spp_points', each point has a "spp_ID" and "spp_score" field. I also have a ...
user avatar
  • 304
5 votes
2 answers
103 views

Expression to show specific attribute of feature within (aggregate?)

I simply want to get a specific attribute (f.e. as label or default value in form) of a feature within another feature. Aggregate could do the job but it don't. Hard for me to write it down, so let ...
user avatar
  • 7,653
1 vote
1 answer
192 views

OGR/Python- Check whether or not points are in a polygon

I have two shapefiles, one points file and one polygon. They are in the same projection (Lat/Long). I would like to run a quick command-line command or a Python script with the OGR module that creates ...
user avatar
  • 339
2 votes
1 answer
225 views

Points within Polygons given certain conditions

I am trying to locate all the points within a set of polygons given a certain condition on the polygon in MongoDB using Python 3x. This question differs from the other ones because i) it requires ...
user avatar
2 votes
0 answers
457 views

More stable spatial sort using Shapely's within?

I was trying to use a modified version of the spatial sorting method illustrated in shapely's documentation, using only polygons exteriors (so that I can detect if a polygon lies inside another ...
user avatar
1 vote
2 answers
1k views

Find points within polygon with PostGIS really slow

From some millions of points I am trying to select those points that are within a polygon and save them into a new table. Both datasets with spatial index and both on projected coordinates. The query ...
user avatar
2 votes
1 answer
58 views

Taking attribute from multiple points within fixed distance

I have a list of point features each with a unique "ID". I need to run a fixed distance buffer on all 70,000 points to establish which points are within a fixed distance of each other than return the ...
user avatar
8 votes
4 answers
799 views

Labeling lines that are not within polygons using field calculator [duplicate]

I have two features. One line feature and another polygon feature. I want the line feature label not to appear when it is within a polygon similar to the one in the figure. That is, I want the label ...
user avatar
1 vote
1 answer
139 views

ST_Within with wrong results [closed]

I have a set of points and a polygon and want to select the points that are within the area. Both layers are in the same projection (WGS84 - EPSG: 4326) and are valid. To determine which points are ...
user avatar
1 vote
0 answers
90 views

What could cause a Spatial Join (Completely Within) to return false positives?

Im using ArcMap 10.3 I have a large feature class of Archaeological surveys that I need to Spatial Join to a target feature class of buffered work locations to find locations that are Completely ...
user avatar
0 votes
0 answers
87 views

Locating observations that lies within a collection of Polygons (Python)

I'm trying to locate the observations that lie within a collection of Polygons but my current implementation takes forever, and I suspect that it is because the 'within' method needs to check all ...
user avatar
1 vote
1 answer
456 views

What algorithm is used by the $geowithin operator of Mongodb

MongoDB can perform geospatial query such as finding restaurants inside region with the operator $geowithin. For example: db.places.find( { loc: { $geoWithin: { $geometry: { ...
user avatar
0 votes
1 answer
1k views

MSSQL performance with Geography (point within polygon)

I have a query, below, that works - however its very slow, looping through roughly 24,000 points per second. This is a rather high end production DB server with MSSQL and SDE, and in other instances a ...
user avatar
  • 240
0 votes
1 answer
225 views

Polyline length within corresponding polygon

ArcGIS Pro 2.3: I have a feature class of polylines and for each polyline I want to analyze against its corresponding polygon. The link is the FLIGHTID field and it is a 1-to-1 relationship. I am ...
user avatar
  • 427
0 votes
1 answer
503 views

With Spatialite, how do I run PtDistWithin with meters?

So the problem is that I have a set of multipolygons and points and I need to be able to query the data with a given point to check which ones are within 'x' km. Initially my SRID was 4283 but I ...
user avatar
2 votes
1 answer
743 views

How to select features which overlap one geometry but are disjoint from another?

Given a point layer and a polygon layer (P1) in GeoServer, the following CQL Filter selects points which intersect the polygon P1: CQL_FILTER = "Within(geom,POLYGON((P1_coordinates)))"; The ...
user avatar
  • 20.5k
0 votes
0 answers
323 views

geopandas geometry.within problem ValueError: Geometry column cannot contain mutiple geometry types

I'm trying to do an overlap of some lines with polygons with geopandas. For a reason I don't understand, gpd.overlay(grid, hel, how='intersection') is not made for lines and polygons, so I'm trying ...
user avatar
  • 1,033
5 votes
1 answer
2k views

r - sf::st_within output is sparse geometry binary predicament format. How to convert to character or logical vector

The same question is asked here: https://stackoverflow.com/questions/49294933/r-convert-output-from-sfst-within-to-vector but I thought this might be a more suitable place for GIS related questions. ...
user avatar
  • 500
1 vote
1 answer
2k views

geopandas + shapely. Point within a shape

I am using geopandas to import a shapefile and then check if a point is within that shape. I am using the shapefile found in http://opendata.atlantaregional.com/datasets/cities-georgia?geometry=-87....
user avatar
  • 113
1 vote
2 answers
650 views

Counting number of points differing in specific attribute within polygon in ArcGIS Desktop?

I have a grid of polygons and a shapefile with several types of points (POIs). Now I would like to count the number of POI classes lying within each polygon? With spatial join I only managed to get ...
user avatar
0 votes
1 answer
151 views

Identifying multiple polygon features that contain point features and adding attributes to table in ArcGIS Desktop?

I have a point layer and a polygon layer, both containing hundreds of records. Each point feature can be within multiple polygon features (max. 4), and each polygon feature can contain multiple point ...
user avatar
  • 133
-1 votes
2 answers
2k views

Determining if polygon falls within another polygon using QGIS?

How can I determine if a certain polygon falls within another separate polygon using QGIS?
user avatar
  • 619
1 vote
2 answers
1k views

Count the length of all polylines from one shapefile within the segments of polygon of another shapefile

I have polylines with counted lengths. And i have the polygon shapefile (fishnet). I want to calculate the sum af lengh of polylines and amount of lines that are within the border of each segment of ...
user avatar
2 votes
1 answer
2k views

Searching for a point within a multipolygon

I'm performing a mySQL query to check if a point is within a multipolygon field. I've got a database field storing a multipolygon and I want to check if a point is within any of those polygons. ...
user avatar
2 votes
0 answers
240 views

How to find shortest line from a point on a polygon boundary to a multilinestring, but the line is inside polygon (PostGIS)

I have 3 geometries 1 polygon 1 point on boundary 1 multilinestring In this image you can see the problem. I need to find shortest line from point (green square) to line (red), but the line must be ...
user avatar
1 vote
1 answer
1k views

Select all points that fall within any polygon from multiple layers

I'm using MapInfo and would like to achieve the following: Find out all the points that fall within any of the polygons on screen, and which polygons they are contained within. The data I am working ...
user avatar
2 votes
1 answer
7k views

Getting intersection of circles using shapely?

I have a List of Points which I transform to circles. Code from here circles = [Point(random.random(), random.random()).buffer(random.random() * 0.1) for i in range(3)] I want to know which circles ...
user avatar
  • 3,017
0 votes
1 answer
36 views

Documentation on spatial queries [duplicate]

Is there any documentation / definition of the operations within, crosses, intersects etc that can be found on the spatial query just like ArcGIS provide?
user avatar
3 votes
2 answers
1k views

Optimisation of MySQL JOIN based on a Within match

I have a table of points and boundaries, and am trying to add the boundary ID which a point is within. However, using a LEFT JOIN ON Within(location, boundary) it is taking about 3.5 hours match 450,...
user avatar
  • 165
35 votes
3 answers
20k views

Refering to another layer with Field Calculator in QGIS

Is there a way to select an attribute from a polygon layer and insert the value into a Virtual field of a point layer using "within" in the Field Calculator? CASE WHEN within($geometry, ...
user avatar
  • 1,866
3 votes
1 answer
472 views

Using arcpy to find geometry within another feature

In Arcpy, I would like to start with a point and then using its geometry method to find out if it is inside my polygon feature (Urban Areas) deeper than the buffer distance. This is a follow up to ...
user avatar
2 votes
1 answer
1k views

Invalid join selectivity error in postgis 2.1.3

I have 2 tables, one for points and one for polygons. I want to find points falling within theese polygons, so I quered: select p.id, l.id from points p inner join polys l on st_contains(l.geom, p....
user avatar
  • 21
3 votes
1 answer
340 views

Finding point within box using MongoDB?

Suppose the point has coordinates for a search within the box: (long:-155, lat:19) If we have the box: SW - (-170, 10), NE (29,69) that everything is fine and we can find this point because it's ...
user avatar
  • 131
4 votes
1 answer
5k views

WFS filter for point in polygon (PIP) query

I am trying to construct a WFS request. I want to determine if a certain point is within a polygon. The point coordinates I want to send via the WFS request. The polygon is saved as a layer on my ...
user avatar
  • 7,624