Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Thomas Statham
    @tastatham
    @martinfleis and @jorisvandenbossche, I have also completed my draft in Google Docs and would also appreciate some suggestions. Apologies for submitting this so close to the deadline.
    Joris Van den Bossche
    @jorisvandenbossche
    Thanks, taking a quick look at both now
    Martin Fleischmann
    @martinfleis
    @tastatham Thanks! I just checked your proposal and left few (very) minor comments. It looks great! We may end up doing less but it is fine being ambitious :).
    Martin Fleischmann
    @martinfleis
    @rajuthegr8 one comment from my side in the doc, @jorisvandenbossche covered the rest.
    Martin Fleischmann
    @martinfleis
    @abhinav9414 I didn't realise you are planning to combine two projects into a single proposal. I have left a comment regarding that in the document (and didn't review the rest in detail as a result) but I would recommend focusing on a single project.
    Thomas Statham
    @tastatham
    @martinfleis @jorisvandenbossche , thanks for taking a look at the proposal. It's much appreciated.
    Brendan Ward
    @brendan-ward
    @abhinav9414 Is your proposal shared somewhere we can provide feedback? (not seeing it here). If you are thinking of including gpkg I/O, I'd like to help provide comments too, but definitely don't let that hold you up since today is the due date.
    Just FYI, I will be (mostly) off for the rest of the day and won't be able to check any further drafts or changes before the deadline.
    Brendan Ward
    @brendan-ward
    @tastatham just provided a few minor suggestions as well; overall looks good (appreciate the level of detail!) and I'm excited to see how spatial partitioning will fit into chunking data for use in Dask.
    Brendan Ward
    @brendan-ward
    Looks like the GSoC submission deadline is coming up soon. Good luck @rajuthegr8 @abhinav9414 @tastatham and thank you for your interest in helping push GeoPandas forward!
    froast
    @abhinav9414
    thank you @brendan-ward.
    arredond
    @arredond
    Hey folks! I'd like to start contributing by tackling some open issue but not sure where to start. There are a handful of open issues tagged "good first issue" but some go as far back as 2014 and I can imagine some already being tackled. Can anybody give me any pointers?
    Martin Fleischmann
    @martinfleis
    Hi @arredond, Looking at it the list of issues, it is clear that we should do some spring cleaning. The best would be to check issues labelled bug and find some you're comfortable fixing. They require various level of expertise and some will be easier than other so you should be able to find some you're comfortable with. If you want to work on documentation, #1896 is a nice one to start with.
    arredond
    @arredond
    Sounds good, thanks for the heads up!
    and-viceversa
    @and-viceversa
    Screen Shot 2021-04-20 at 10.45.01 AM.png
    Hello all, the github contact section pointed me here. I'd like to open a feature request to build oriented minimum bounding boxes from polygons, like you can do in QGIS. Having trouble implementing it on my own. This this an appropriate issue to open?
    Martin Fleischmann
    @martinfleis
    Hi, the built-in method will likely come soon, we have just recently implemented it in pygeos. At the moment, you can get it via oriented_box = gdf.geometry.apply(lambda geom: geom.minimum_rotated_rectangle)
    and-viceversa
    @and-viceversa
    Excellent! Much appreciated.
    and-viceversa
    @and-viceversa

    Still got some testing to do, but I ended up using https://github.com/dbworth/minimum-area-bounding-rectangle/blob/master/python/min_bounding_rect.py to make follow on operations easier.

    It looks like geom.minimum_rotated_rectangle doesn't guarantee right angles? They might be trying to accomplish different things.

    Martin Fleischmann
    @martinfleis
    @and-viceversa that doesn't sound right. Can you show an example when it doesn't return right angles?
    and-viceversa
    @and-viceversa

    Short answer everything works as intended - thank you again. FWIW the github link to min_bounding_rect.py returns identical return as geom.minimum_rotated_rectangle.

    Long answer is that the KML writer enforces geographic coordinates, which I did not know. So QGIS' project on the fly visually was not showing a true rectangle versus the underlying (in my case) local UTM. I had done quick tests with min_bounding_rect.py at large scales only, and tests with minimum_rotated_rectangle at small scale only. Obviously at large scale the difference in the projection were not as noticeable so the two calls appeared to have different results. Using the same projections for minimum rectangle and the underlying in a non-KML format works as intended.

    Shirzart Enwer
    @Aniwax
    Hello everyone :) As a completely freshman to pygeos, I just have simple question on data input format when constructing a geometry in pygeos: is there other input data format possible other than string?
    I want to construct polygon, whose boundary points are returned from a list of numbers....it's quite cumbersome to convert it in the desired string format.
    Martin Fleischmann
    @martinfleis
    @Aniwax you can pass arrays of coordinates, see the docs here https://pygeos.readthedocs.io/en/latest/creation.html (for linearrings and polygons)
    Shirzart Enwer
    @Aniwax
    Thanks! @martinfleis , another dummy question: what's the difference between linearrings and polygon? If I don't need any hole in a within the boundary of my geometry, do I just need linearrings and not polygon?
    Martin Fleischmann
    @martinfleis
    Linearring is linear geometry (just that exterior line) while polygon covers an area it encloses.
    Shirzart Enwer
    @Aniwax
    Alright, got it, thanks!
    Alex Yule
    @yuletide
    Hey folks, working on a project and ran into a bunch of "illegalArgumentException: Geometry must be a Point or LineString" when exporting a dataframe to json (or passing it into rasterstats). Any idea what could cause this? The geometry seems valid and plots fine. I'm using Shapely 1.8a1 but unable to reproduce with sample data. This data is a large set of isochrones created using the Mapbox API.
    Happy to create a ticket but didn't want to clutter things up if there's something I should try first
    The project is analyzing internet connectivity in Kazakhstan for Unicef GIGA
    Martin Fleischmann
    @martinfleis
    I think we’ll need more info, code and ideally reproducible example or a some way to reproduce it. Best to file it as a bug or question on GitHub
    Alex Yule
    @yuletide
    Sounds good, I'll try to put together a smaller dataset that produces the same errors!
    Thanks Martin
    Shirzart Enwer
    @Aniwax
    Hey Guys, I have the issue of not the same version of GEOS used, when I try to install Shapely and Pygeos in the same environment on Github Actions to run my automated tests. I could resolved this problem on my machine by replacing the geos_c.dill file inside the Shapely package, but I don't know how to resolve it on the cloud. I am using Windows both on the cloud and local environment.
    Any suggestions? Appreciated :)
    Martin Fleischmann
    @martinfleis
    @Aniwax how are you installing shapely and pygeos? Try to use conda and conda-forge channel, which should resolve this. Check geopandas CI how we do it on GHA if you need an example.
    Shirzart Enwer
    @Aniwax
    I am using pip install @martinfleis but will try conda channel
    Martin Fleischmann
    @martinfleis
    pip install is not recommended for geopandas and its dependencies as it is not able to ensure compatibility of C libraries (like in this case)
    Shirzart Enwer
    @Aniwax
    Damn, alright. I usually prefer pip for my python environment management. But anyway, I will try this on the cloud. Thanks for your lightening-speed reply as always :)
    Shirzart Enwer
    @Aniwax
    Hi Community, I am wondering if there is any general guide on how to exploit the vectorized-operation the best to improve the runtime of code using pygeos?
    Appreciate any suggestions :)
    Martin Fleischmann
    @martinfleis
    I am not aware of a ready-made guide for geopandas (apart from the one on my long to-do list). Generally speaking, avoid for loops, avoid apply and try to rely as much as you can on built-in GeoSeries methods. If needed use the underlying array of pygeos geometries directly with pygeos functions. You can access it as gdf.geometry.values.data. When you can use numpy functions instead of for loops, use them. Look up some vectorization guide for pandas, the rules are fairly similar. And when using spatial index, use query_bulk.
    Shirzart Enwer
    @Aniwax
    Thanks ! As I am only using pygeos, not Geopandas, then it's quite straight forward in my case then I guess: use pygeos directly as much as possible, without breaking the design?
    Brendan Ward
    @brendan-ward
    @Aniwax correct: you can use the pygeos functions directly to leverage the speedups (they are already vectorized in most cases). There are a few cases where the pygeos functions operate on singular geometries where you may need to do a bit more to vectorize them (e.g., get_geometry), but we've been adding more functions to vectorize the most common operations where you would get these back as ragged arrays (e.g., get_parts), where there are varying numbers of geometries within arrays of multi / geometry collections.
    If you run into a case where trying to use pygeos to get what you need isn't obvious, certainly feel free to ask here.
    Shirzart Enwer
    @Aniwax
    @brendan-ward Thanks a lot :)
    Alex Yule
    @yuletide
    @martinfleis Ticket filed! #1943
    I created a minimal test dataset with one feature
    robertbozsik
    @robertbozsik
    Hi there,
    I've seen you have already talked about this warning in January.
    UserWarning: The Shapely GEOS version (3.8.0-CAPI-1.13.1 ) is incompatible with the GEOS version PyGEOS was compiled with (3.9.0-CAPI-1.16.2). Conversions between both will be slow.
    Is there any "pip install" solution to get rid of the warning besides installing geopandas with conda/conda forge?
    I would like to integrate a new geopandas spatial join feature into a package created by poetry and I cannot use a conda.
    Joris Van den Bossche
    @jorisvandenbossche
    I don't think there is an easy way with the current built wheels (except by installing from source). It might be that an older version of PyGEOS' wheels are built with GEOS 3.8.0, but not fully sure.
    (it might also be that you can ignore the warning, depending on your use case)