Timeline for Generating random coordinates in multipolygon in Python?
Current License: CC BY-SA 4.0
15 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
S Jun 26, 2020 at 3:21 | history | suggested | Mike S | CC BY-SA 4.0 |
removed redundant counter
|
Jun 26, 2020 at 0:23 | review | Suggested edits | |||
S Jun 26, 2020 at 3:21 | |||||
Aug 27, 2019 at 14:44 | comment | added | vpipkt |
@dain i believe the underlying implementation of representative_point will always return the same point, and it may often be just the first coordinate of the exterior ring of the first Polyon, in this case of Multi Polygon
|
|
Jul 4, 2019 at 15:31 | comment | added | dain |
I just came across the representative_point method which should give you a point without looping: shapely.readthedocs.io/en/latest/…
|
|
S May 23, 2019 at 14:07 | history | suggested | dain | CC BY-SA 4.0 |
Update docs URL
|
May 23, 2019 at 13:58 | review | Suggested edits | |||
S May 23, 2019 at 14:07 | |||||
Nov 21, 2018 at 14:32 | comment | added | bugmenot123 | We agree on the problem but I just want to stress the point. Shapely considers whatever coordinates to throw at it to be in 2D euclidean space. If you feed it coordinates that you know are geographic, it will be a plate carrée projection. Shapely will do all its calculation like that and it is correct because Shapely does not care about coordinate systems. If you need geodesic calculations (like distributing points uniformly on a sphere/ellipsoid, you need to use something else (geographiclib?) or implement the calculations yourself. | |
Nov 21, 2018 at 13:16 | comment | added | Cramer | @bugmenot123 The data is coming from geojson, which uses coordinates. The space of coordinates is two dimensional but it's not Euclidean, even if shapely believes it is. The data I've used shapely for was in lon/lat, the edges were relatively short so treating it as Euclidean was a good approximation. BUT, if you're generating random points you need to consider the shape of the space. If the points are all within a few hundred km, the Euclidean approximation is fine, if you're generating points in the shape of Africa, you're going to have some weird effects. | |
Nov 20, 2018 at 12:03 | comment | added | bugmenot123 | @Cramer: They ARE randomly distributed in a uniform matter on the surface of the polygon. Shapely operates on a 2D euclidean coordinate system. If you need geodesic uniformity, you need to use something else. | |
Nov 20, 2018 at 12:02 | history | edited | bugmenot123 | CC BY-SA 4.0 |
missing import
|
Aug 29, 2018 at 23:12 | history | edited | Kadir Şahbaz | CC BY-SA 4.0 |
edited "from shapely" to "from shapely.geometry"
|
Aug 6, 2018 at 23:54 | comment | added | Cramer | Note: These will not be randomly distributed! More points will be clustered towards the poles with the effect worse the closer you are to the poles. | |
Aug 25, 2016 at 7:11 | comment | added | Sadeq Sepehrnoush |
i think it must be like this from shapely import geometry then use it like geometry.Point
|
|
Aug 21, 2016 at 10:18 | history | edited | dmh126 | CC BY-SA 3.0 |
added 31 characters in body
|
Aug 21, 2016 at 9:59 | history | answered | dmh126 | CC BY-SA 3.0 |