Questions tagged [polygon]

For issues relating to the creation, manipulation and rendering of polygons in graphical user interfaces.

A polygon is a two-dimensional figure that is bounded by a closed path composed of a finite sequence of straight line segments. Polygons are drawn and rendered in graphical user interfaces.

4546 questions
1
vote
0 answers

Generate random vertex of regular polygon

I need help with programming random vertices of regular polygon. I want to get a function, where for n regular polygon get vertices of random coordinates. I tried like this but I have to have coordinates of poly. Any help? import random def…
1
vote
0 answers

Create polygon shapefile from point shapefile in python

I am a beginner (very little experience) in Python. I am trying to use it with QGIS. I have a points shapefile (pt.shp), and I would like to create a polygon shapefile (pol.shp) using Python. Could anyone suggest code to build a polygon shapefile…
Carlos
  • 11
  • 2
1
vote
1 answer

Convert mesh to polygon in python

I have a mesh and want to convert it into a polygon. I did some google search and found most answer on converting polygon to mesh. I want to do the opposite.Is there any library or any idea on how to achieve it
Purple_Ad
  • 65
  • 6
1
vote
1 answer

Block time calculation by block number in Polygon Mumbai Testnet

I'm looking for a reliable way to determine when the block was produced by given any block number in Polygon Mumbai Testnet. I can't use Api for this task . I'm just looking for a convenient way of computing. Do you have any suggestion for this?
1
vote
1 answer

SqlGeography.STGeomFromText throw exception when creating Polygon

During creating Polygon it throws execution. I am using library Microsoft.SqlServer.Types latest version 160. polyText = "POLYGON (( 45.3972179 8.8406638000000157, 45.4215054 8.9151509000000715, 45.4001544 8.9361126999999669, 45.4016369…
1
vote
1 answer

Native coin MATIC has a Contract Address on the Polygon Network?

I am currently developing a donation smart contract for the Polygon blockchain. The donation contract should receive many types of coins like (MATIC, USDT, USDC, etc.). I first made the donate function like the below: function donate(address donor,…
azvast
  • 337
  • 4
  • 10
1
vote
2 answers

How can I straight cut a polygon into several pieces?

I want to develop a game "Cut the Shape" in JavaScript. Several components with convex polygons that will need to be clipped depending on the number of convex freedom faces. Lines and polygons are displayed on the Canvas. The Paper.js graphics load…
DYM
  • 11
  • 1
1
vote
1 answer

Determining landcover %'s (polygon layer) that is not within burned areas (raster layer)

I am trying to extract information on the % of different vegetation cover types within areas that have not been burned. However, the data I was given for the park includes areas that have been burned as a raster file in NAD_83 projection, and the…
Zoe
  • 11
  • 1
1
vote
2 answers

Take the difference between two polygons using Shapely?

This code finds the intersection of two polygons and create a polygon out of the intersection. My aim is to do the exact opposite. I would like to create a polygone which has a hole in it in others words it excludes the intersection from the big…
bravopapa
  • 309
  • 1
  • 10
1
vote
2 answers

How to get the best polygon point pattern data in spatstat analysis in R

I have a dataset of spatial locations data. I want to do a point pattern analysis using the spatstat package in R using this data. I want the best polygon area for the analysis instead of the rectangle area. The code I have is original_data =…
MK Huda
  • 605
  • 1
  • 6
  • 16
1
vote
2 answers

Removing the outlines of polygon islands within holes when using smoothr's fill_holes

I am joining multiple adjoining polygons together and removing any holes from the now single polygon using fill_holes in smoothr. However, if a hole has another polygon (or island) within it, the outline of that polygon remains. Is there a way…
Chris
  • 1,197
  • 9
  • 28
1
vote
1 answer

Cutting a matrix for a certain complex shape - Python

I ran into a problem that I don't know how to address, if anyone has any ideas I would be very grateful. So I have a NxM matrix and number of points (minimum 4) that represent a shape resting on the matrix as show in the figure (Each point is…
Doron bs
  • 11
  • 1
1
vote
2 answers

Why would create2 revert?

I'm debugging a reverted transaction on Polygon and this is all the information I have: https://mumbai.polygonscan.com/tx/0xfa86dc4957e3a3da9298b7672b11a20ebe921854fa494dc073920c067c1e693f#internal If I'm reading it correctly, it seems to be saying…
Derek Chiang
  • 3,330
  • 6
  • 27
  • 34
1
vote
1 answer

Remove rows with invalid polygon values in a PySpark data frame?

We are using a PySpark function on a data frame which throws us an error. The error is most likely due to a faulty row in the data frame. Schema of data frame looks like: root |-- geo_name: string (nullable = true) |-- geo_latitude: double (nullable…
1
vote
1 answer

Grouping polygons and neighbours based on distance criteria

I would like to group polygons together based on a distance criteria: Any polygon within a certain distance (1200 metres or less) of an origin polygon are grouped together If other polygons are within the same distance (1200 metres or less) of…
Chris
  • 1,197
  • 9
  • 28