Coder Social home page Coder Social logo

Comments (6)

adrien-berchet avatar adrien-berchet commented on July 28, 2024

Hi @lucaslcode
Thanks for the report and sorry for the inconvenience.
Could you tell me what is the type of your Polygon object please? And if you can provide a Minimal Working Example to reproduce this error it would be nice.

from geoalchemy2.

adrien-berchet avatar adrien-berchet commented on July 28, 2024

Isn't it a Shapely object? If it is you should create your WKTElement by passing the wkt form of the geometry object, not the raw object. For example:

obj = shapely.wkt.loads("POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))")
elem = WKTElement(obj.wkt)

from geoalchemy2.

lucaslcode avatar lucaslcode commented on July 28, 2024

Thank you, it is indeed a shapely polygon. Odd that this line was working before!

from geoalchemy2.

adrien-berchet avatar adrien-berchet commented on July 28, 2024

Yeah previously it could accept anything that can be cast to a str object while now it must be a str object. Nevertheless, we could explicitly try to cast it to str in the WKTElement constructor to keep the same behavior as before, which I never considered but can be convenient.

from geoalchemy2.

shuttle1987 avatar shuttle1987 commented on July 28, 2024

I ran into this as well due to some buggy code that finally broke with this release, an issue that I think would have been easily spotted in the CI pipeline if this package had type annotations. Is there any interest in adding type annotations into this project?

from geoalchemy2.

adrien-berchet avatar adrien-berchet commented on July 28, 2024

Sure, that would be nice!
Does anyone have some time to add it? It will be hard for me to find time for this before several weeks. For now I'm just going to open an issue.

from geoalchemy2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.