Questions tagged [point-in-polygon]

Algorithm for determining whether a point is inside a polygon. Normally calculated by counting the number of polygon line segments that a ray from the point intersects.

275 questions
0
votes
1 answer

SQLintersects query not working properly

I am trying to select the points which lies in a specific polygon from my table. Here my Table test1 have data4 column of geometry type and it contains: 2,3 5,6 7,10 When I am trying the following query its returning empty row. Please help…
PhantomM
  • 825
  • 6
  • 17
  • 34
-1
votes
1 answer

Most efficient way to randomly select point within polygon?

I'm extremely new to Python and trying to figure out the most efficient way to randomly select a point within a polygon. The image I attached is representative of the scenario - my first attempt took nearly 30 seconds to generate a list of all pixel…
jivky
  • 3
  • 1
-1
votes
1 answer

Georelation between 2 sets og geojson

I have 2 sets of geojson polygons: one for lands and one for buildings. All buildings are built on lands so all building polygons belong to a land polygon but I don’t have the relationship between the 2 sets and I need to build it on the fly in…
Samuel
  • 29
  • 1
  • 2
-1
votes
1 answer

How to check that geographical coordinates (latitude, longitude) exists inside a polygon?

I want to check whether an address (long, lat) exists inside or outside of a polygon. I have an address with latitude and longitude values. Address(,long =16269479, lat =58606014) and polygon(lat, long) with its vertices POLYGON((16270489, 58824802)…
learner
  • 37
  • 7
-1
votes
1 answer

How to find a polygon which a single point lies on

I have a list of polygons and a single point with its latitude and longitude. I want to find a polygon which the single point lies on. Currently, I'm iterating over the whole list to find the answer, which seems a bit inefficient. Is there a better…
santony
  • 54
  • 5
-1
votes
1 answer

Point belonging to a polygon : program in C and python

I have to write an algorithm in C and Python to know if a point belongs to a polygon or not (all entered by the user). My algorithm works in python but the C one doesn't work and I can't find my errors since my debugger code blocks refuse to…
Bnj_euw
  • 3
  • 2
-1
votes
1 answer

How can I get the Polygon data for a location name?

I'm looking for a valid source, from where I can get the polygon coordinates for a location. Is there any API for this? Does Google maps API provide this polygon coordinates? What are the other options for this process? For example, I want to get…
-1
votes
1 answer

finding point in polyline - python

I have a shape file for road names - which is actually polyline geometry. And I also have address points, I am trying to find the road name of each address point using the polyline shape file. Is there a way to work out this? I used spatial join,…
ds_user
  • 2,139
  • 4
  • 36
  • 71
-1
votes
1 answer

How to track a marker location is within a polygon area on drag-drop event

var marker = new google.maps.Marker({ position: location, map: map, draggable: true }); google.maps.event.addListener(marker, 'dragend', function (event) { var result = google.maps.geometry.poly.containsLocation(event.latLng,…
-1
votes
1 answer

C: Edge cases for finding point within rectangle (Prime meridian, equator, etc)?

Finding a point-in-a-polygon is a common problem, however, I don't understand why many have made edge cases for the prime meridian, equator and international date line. Don't the negative values for points west of the prime meridian and positive…
MrPickles
  • 1,255
  • 1
  • 16
  • 31
-1
votes
1 answer

Getting coordinates for regular polygon

I have an indefinite amount of points on a map based around a center. They should be arranged in a polygon, so their angle is 360/amount of points (http://prntscr.com/8z2w3z). I have a center point, a length and directions so it should be possible…
Martin
  • 453
  • 3
  • 5
  • 14
-1
votes
1 answer

Efficient method to check which polygon a certain located inside

In my JavaScript application I have more than 30+ polygons. They are defined like this: polygons:[ {name:'xx',bounds:[20,20,60,20,50,40,30,10...],minzoom:0,maxzoom:5}, {name:'yy',bounds:[.....],minzoom:6,maxzoom:8}, ........ ] Now given a certain…
hguser
  • 35,079
  • 54
  • 159
  • 293
-2
votes
1 answer

Python how many points are inside a municipality

I have two spatial datasets: municipality municipality geometry 1000 POLYGON ((4.04305 47.56271, 4.04345 47.56303, ... 1001 POLYGON ((-0.24733 45.88792, -0.24715 45.88820... 1002 POLYGON ((-0.30449 45.91087, -0.30446…
MG Fern
  • 75
  • 9
-2
votes
1 answer

Point in Polygon algorithm giving wrong results for negative points

I am trying to check if the lat,lon is in the polygon or not. Here is my array : $vertices_x : Array ( [0] => -32.581189 [1] => -38.785885 [2] => -39.26384 [3] => -34.919383 [4] => -32.284464 ) $vertices_y: Array ( [0] =>…
user3997016
-2
votes
1 answer

Generate random number of points inside polygon extent in python

I need to generate fixed random points inside a polygons. For that, I need to generate random points inside the extent of polygons and then select the ones that are inside the polygon boundary later. how can i generate points inside the given extent…
1 2 3
18
19