[Community] PrimaGIS 0.6 new features: more wishes

Ludwig Max Brinckmann ludwigbrinckmann at gmail.com
Tue Aug 8 10:27:26 EEST 2006


I will try to give it a test and report back later today.

On 8/8/06, Kai Hänninen <kai.hanninen at mbconcert.fi> wrote:
> Hi everyone
>
> [...]
>
> >
> > I agree that a maximum extent would be much more useful and that it
> > would also make the zoom_out limit redundant. I'll implement a maximum
> > extent and remove the zoom_out limit.
>
>
> I've implemented the maximum extent feature in r781
>
>    http://trac.gispython.org/projects/zope/changeset/781
>
> that also removes the now redundant zoom out limit.
>
> In addition I've replaced the StringField/StringWidget combinations that
> were used to store the extents with a custom
> BoundingBoxField/BoundingBoxWidget implementation. This should make it
> easier to set and get the bbox values from both code and the UI.
>
> The BoundingBoxField stores the bounds as tuples internally, but the
> accessor method returns cartography.spatial.geometry.BoundingBox instances.
>
> The mutator method (setter) for BoundingBoxField allows the bounds to be
> set in a variety of formats:
>    - BoundingBox instance
>    - 'minx,miny,maxx,maxy' string
>    - 'minx miny maxx maxy' string
>    - (minx, miny, maxx, maxy) tuple/list
>    - record object with minx, miny, maxx and maxy attributes
>
> For example (assuming 'obj' has a BoundingBoxField called 'bbox')
>
>   >>> from cartography.spatial.geometry import BoundingBox
>   >>> from cartography.spatial.interfaces import IBoundingBox
>   >>> bbox = obj.getField('bbox')
>
>   >>> bbox.set(obj, BoundingBox(-10, -10, 10, 10))
>   >>> IBoundingBox.providedBy(bbox.get(obj))
>   True
>   >>> bbox.get(obj).totuple()
>   (-10, -10, 10, 10)
>
>   >>> bbox.set(obj, '-20,-20,20,20')
>   >>> IBoundingBox.providedBy(bbox.get(obj))
>   True
>   >>> bbox.get(obj).totuple()
>   (-20, -20, 20, 20)
>
>   >>> bbox.set(obj, '-30 -30 30 30')
>   >>> IBoundingBox.providedBy(bbox.get(obj))
>   True
>   >>> bbox.totuple()
>   (-30, -30, 30, 30)
>
>   >>> bbox.set(obj, (-40,-40,40,40))
>   >>> IBoundingBox.providedBy(bbox.get(obj))
>   True
>   >>> bbox.get(obj).totuple()
>   (-40, -40, 40, 40)
>
>   >>> class dummyrecord:
>   ...   minx=-50; miny=-50; maxx=50; maxy=50
>   ...
>   >>> bbox.set(obj, dummyrecord())
>   >>> IBoundingBox.providedBy(bbox.get(obj))
>   True
>   >>> bbox.get(obj).totuple()
>   (-50, -50, 50, 50)
>
>
> The PrimaGISMap.getDefaultView() method was removed as the dynamically
> generated (by Archetypes) method getDefaultExtent() returns BoundingBox
> instances directly.
>
> I still need to work a bit on i18n but otherwise it should be ready for
> testing.
>
> cheers,
> Kai
> --
> Kai Hänninen                  +358-50-558-7935
> Software engineer             www.mbconcert.fi
> MB Concert Ky                 kai.hanninen at mbconcert.fi
> _______________________________________________
> Community mailing list
> Community at lists.gispython.org
> http://lists.gispython.org/mailman/listinfo/community
>



More information about the Community mailing list