Questions tagged [within]

The tag has no usage guidance.

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

Clipping with added "buffer"

i want to Clip my Point data (Bus Stations) through a Polygon (the City area, highlighted in the picture) but if possible include any Point data which is e.g. 500 meters around the city boundary. So ...
MarkusV's user avatar
1 vote
2 answers
69 views

Count of points in shape

I have mapped the population (1km x 1km grid) of my country and I have used travel time to create driving distance polygons (i.e. 15 minutes). I have reprojected all the layers to the same EPSG (3857) ...
Cluedoz's user avatar
  • 11
1 vote
0 answers
53 views

Creating line inside polygon using QGIS

I do have polygons in different shapes, most of them squeezed. How can I create one line inside each polygon, along? I have checked it in QGIS but could not find a way to do it. I have tried to create ...
Orkhan Abdullayev's user avatar
-1 votes
1 answer
80 views

known contained polygons on geopandas return everything False for "contain" and "within" when dissolving one layer

I have two geodataframes: gdf1= 1000 polygons gdf2= 26 polygons that are bounding box of 26 polygons from gdf1. I would like to get the all the polygons from gdf1 that are not within gdf2. I decided ...
ReutKeller's user avatar
  • 2,107
0 votes
1 answer
513 views

Spatial join to append which multi polygon a point is in (GeoPandas)

Currently I have around 40 lists of coordinates I need to run the same operation on: What we will call the the points data, A) With one list of multi polygons (The polygon data, B). I need to take ...
efullenkamp's user avatar
1 vote
3 answers
606 views

QGIS: Extract by location/within distance - add location to output

I have polygons with points inside (see Fig 1). You can find an example here: https://drive.google.com/drive/folders/1VccEmv-EtjZ9tG6J_ozp3E37bBRbtvNn?usp=sharing I want to know the locations of all ...
johomio's user avatar
  • 13
0 votes
2 answers
55 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. ...
Bruno B's user avatar
  • 839
5 votes
3 answers
160 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 ...
user202393's user avatar
0 votes
2 answers
166 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 ...
itsrainingschmen's user avatar
2 votes
0 answers
133 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). ...
Roman's user avatar
  • 21
1 vote
1 answer
194 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 ...
pmwill's user avatar
  • 67
3 votes
0 answers
345 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-...
xda's user avatar
  • 31
7 votes
1 answer
2k 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. ...
baggiponte's user avatar
6 votes
1 answer
583 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&...
viamonster's user avatar
2 votes
1 answer
398 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) ...
CedricJ's user avatar
  • 41
2 votes
1 answer
419 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 ...
GlenS's user avatar
  • 519
2 votes
0 answers
610 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 ...
Paul's user avatar
  • 477
1 vote
1 answer
306 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 ...
Pantelis Livadiotis's user avatar
2 votes
1 answer
202 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 ...
Gustavo's user avatar
  • 21
1 vote
2 answers
207 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?
sudofizz's user avatar
  • 195
3 votes
1 answer
2k 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. ...
Elham's user avatar
  • 419
2 votes
1 answer
322 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 (...
Corninski's user avatar
  • 107
2 votes
3 answers
253 views

Styling polygons of postcode zones that contain a point (address)

I created a Map with Geocoded Addresses from the UK. The Basis for the map is a UK districts shapefile, this constitutes my main layer. After geocoding (via .csv) 3 Addresses I have a new layer with ...
Emil Stobbe's user avatar
3 votes
3 answers
148 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 ...
ferus89's user avatar
  • 329
5 votes
2 answers
203 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 ...
MartinMap's user avatar
  • 8,284
1 vote
1 answer
323 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 ...
Casivio's user avatar
  • 339
2 votes
1 answer
360 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 ...
Vladimir Bogdashkin's user avatar
2 votes
0 answers
890 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 ...
sanzoghenzo's user avatar
2 votes
2 answers
2k 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 ...
Pitrako Junior's user avatar
2 votes
1 answer
96 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 ...
Mathew Bayley's user avatar
8 votes
4 answers
846 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 ...
Rodrigo Ferraz's user avatar
1 vote
1 answer
205 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 ...
georamos's user avatar
1 vote
0 answers
113 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 ...
Dylan Warburg's user avatar
1 vote
1 answer
673 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: { ...
oussREE 's user avatar
0 votes
1 answer
2k 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 ...
anakaine's user avatar
  • 280
0 votes
2 answers
461 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 ...
sinDizzy's user avatar
  • 437
0 votes
1 answer
818 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 ...
user3559247's user avatar
2 votes
1 answer
1k 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 ...
Stephen Lead's user avatar
  • 21.1k
0 votes
0 answers
405 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 ...
ImanolUr's user avatar
  • 1,102
5 votes
1 answer
3k 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. ...
adl's user avatar
  • 510
1 vote
1 answer
3k 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....
vicaba's user avatar
  • 113
1 vote
2 answers
776 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 ...
Sebastian's user avatar
0 votes
1 answer
239 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 ...
Sn0W's user avatar
  • 155
0 votes
2 answers
3k 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?
csft306's user avatar
  • 649
1 vote
2 answers
2k 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 ...
Mikhail Svideniuk's user avatar
2 votes
1 answer
3k 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. ...
moosewiththumbs's user avatar
2 votes
0 answers
296 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 ...
José Manuel Mira Martínez's user avatar
1 vote
1 answer
2k 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 ...
Jonathan West's user avatar
2 votes
1 answer
8k 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 ...
four-eyes's user avatar
  • 3,368
0 votes
1 answer
47 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?
Vasilis Kaloyirou's user avatar