Re: [GeoAlchemy] union using geoalchemy and postgis 2

瀏覽次數:92 次
跳到第一則未讀訊息

Eric Lemoine

未讀,
2012年9月3日 凌晨3:04:582012/9/3
收件者:geoal...@googlegroups.com
On Mon, Sep 3, 2012 at 3:44 AM, binadam <ibna...@gmail.com> wrote:
> Looks like my last post didn't make, retry...
>
> If I have:
>
> class MyGeom(Base):
> __tablename__ = 'my_geom'
>
> id = Column(Integer, autoincrement=True, primary_key=True)
> geom = Column(Point)
> extra = Column(String)
>
>
> and I do a union e.g.
>
> a = m.DBSession.query( m.MyGeom ).filter(m.MyGeom.extra==None)
> b = m.DBSession.query( m.MyGeom ).filter(m.MyGeom.extra!=None)
> a.union(b)
>
> I get this error:
>
> sqlalchemy.exc.ProgrammingError: (ProgrammingError) function
> st_asbinary(bytea) is not unique
> LINE 1: SELECT anon_1.my_geom_id AS anon_1_my_geom_id, ST_AsBinary(a...
> ^
> HINT: Could not choose a best candidate function. You might need to add
> explicit type casts.
>
>
> I see there is a ticket about this:
> http://trac.osgeo.org/postgis/ticket/1869
> So my question is there a workaround in geoalchemy using ORM?
> (happens with geoalchemy & geoalchemy2)



Hi

I can indeed reproduce the issue. I don't know how to fix it for now,
but I'll look into it.




--
Eric

Eric Lemoine

未讀,
2012年9月3日 上午11:21:302012/9/3
收件者:geoal...@googlegroups.com
Now fixed in SQLAlchemy:
<http://hg.sqlalchemy.org/sqlalchemy/rev/f1efb20c6d61> (Thank you
Mike). And I added a test in GeoAlchemy 2 for that:
<https://github.com/geoalchemy/geoalchemy2/commit/de3ed867e820f4f864f7f0a07491d37496909c14>.

Tell us if it works for you.

--
Eric
回覆所有人
回覆作者
轉寄
0 則新訊息