Comments (2)
Yes. Should be a straight swap to shapely!
from book.
One fewer dependency for the book would be great. Here is a proposed update for this.
Original
For the minimum rotated rectangle, we will use the minimum_rotated_rectangle
function from the pygeos
module, which constructs the minimum rotated rectangle for an input multi-point object. This means that we will need to collect our points together into a single multi-point object and then compute the rotated rectangle for that object.
from pygeos import minimum_rotated_rectangle, from_shapely, to_shapely
point_array = geopandas.points_from_xy(x=user.x, y=user.y)
min_rot_rect = minimum_rotated_rectangle(
from_shapely(
point_array.unary_union()
)
)
min_rot_rect = to_shapely(min_rot_rect)
Update
For the minimum rotated rectangle, we will use the minimum_rotated_rectangle
property from GeoPandas, which constructs the minimum rotated rectangle for an input multi-point object. This means that we will need to collect our points together into a single multi-point object and then compute the rotated rectangle for that object.
point_array = geopandas.points_from_xy(x=user.x, y=user.y)
min_rot_rect = point_array.unary_union().minimum_rotated_rectangle
from book.
Related Issues (20)
- Centrography commented out
- Translations
- Six keywords or phrases for the book HOT 1
- Results from running the book in Jan 2023
- csv link for Brexit results is broken HOT 1
- Ch4: How spatial weights are referenced
- CH 4: Illustrations for weights
- Global and local spatial autocorrelation chapters - standardization? HOT 3
- Final Typesetting Edits HOT 1
- New version of `xarray` does not contain `open_rasterio` HOT 2
- EPSG warning
- seaborn.kdeplot is not suitable for point patterns HOT 1
- Write a blog post on 1.0
- Chapters not rendered HOT 1
- Replace Stamen tiles
- Ch. 9 (inequality) bug HOT 1
- Ch. 10 (clustering) bug HOT 1
- Ch 12: merge
- book
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from book.