Hello,
as it should be clear for all, I am not a java guru... sorry if this is
boring...
But looking at jMapPane code there is a problem since gt273 for my use case.
I have a JMapPane in a swing interface, something like:
private org.geotools.swing.JMapPane jMapPane_1;
jMapPane_1 = new org.geotools.swing.JMapPane();
jMapPane_1.setRenderer(new StreamingRenderer());
[... creating mapcontext here....]
jMapPane_1.setMapContext(myMapC); // throw error here...
Looking at jMapPane code:
setTransforms(final Envelope envelope, final Rectangle paintArea) is called
with a null paintarea rectangle from doSetDisplayArea method and giving, as
expected, a NPE at paintArea.getWidth().
In fact, the currentPaintArea variable is never setted.
The only function able to set it is setForNewSize() called by events
(HierarchyListener and HierarchyBoundsListener).
I can fix this, calling, for example, setForNewSize()
in doSetMapContext(MapContext context) like this:
setFullExtent();
setForNewSize(); // added
doSetDisplayArea(fullExtent);
This is probably not a fix but just to understand, just hopping to help.
I have others strange behavior with my mappane... for now, I will stay with
gt 272 and keep my application running fine.
thx.
On Fri, Jan 27, 2012 at 11:57 AM, Leoze Oze <[email protected]> wrote:
> Well,
> ok.. this just a warning and not the problem:
> WARNING: Failed to use ST_Estimated_Extent, falling back on envelope
> aggregation
> org.postgresql.util.PSQLException: ERROR: LWGEOM_estimated_extent:
> couldn't locate table within current schema
>
> I can update to gt272 witthout problem.... but not with gt273....
> java.lang.NullPointerException
> at org.geotools.swing.JMapPane.setTransforms(JMapPane.java:1107)
> at org.geotools.swing.JMapPane.doSetDisplayArea(JMapPane.java:607)
> at org.geotools.swing.JMapPane.doSetMapContext(JMapPane.java:505)
> at org.geotools.swing.JMapPane.setMapContext(JMapPane.java:472)
>
> Something happened with JMapPane. We have for the gt273 release:
> http://jira.codehaus.org/browse/GEOT-3701
> http://jira.codehaus.org/browse/GEOT-3699
> http://jira.codehaus.org/browse/GEOT-3698
>
> I will try to understand, and inform.
> thx.
> Lee
>
>
>
> On Wed, Jan 25, 2012 at 1:29 PM, Leoze Oze <[email protected]> wrote:
>
>> Dears all,
>>
>> I am trying to update an application using geotools 262 to geotools 274
>> without maven (oops).
>> This application is using database postgresql/postgis. (updating postgres
>> 8.3 to 9.1 and postgis to 1.5 too)
>>
>> I m facing something strange (for me!):
>> java.lang.NullPointerException
>> at org.geotools.swing.JMapPane.setTransforms(JMapPane.java:1114)
>> at org.geotools.swing.JMapPane.doSetDisplayArea(JMapPane.java:607)
>> at org.geotools.swing.JMapPane.doSetMapContext(JMapPane.java:505)
>> at org.geotools.swing.JMapPane.setMapContext(JMapPane.java:472)
>>
>> Trying to understand (a little), it looks like gt have problem to known
>> display area from data.
>> Looking at postgresql log:
>> 2012-01-25 13:18:30 GMT ERROR LWGEOM_estimated_extent: couldn't locate
>> table within current schema
>> 2012-01-25 13:18:30 GMT STATEMENT select
>> AsText(force_2d(Envelope(ST_Estimated_Extent('fgeom', 'sshared',
>> 'the_geom'))))
>> I found related (?) opened tickets:
>> http://trac.osgeo.org/postgis/ticket/877
>> http://trac.osgeo.org/postgis/ticket/510
>>
>> Well... I am stucking (as always :/ ).... I can't understand why I can
>> update to pg9.1/postgis1.5 with gt 262 and have problem with gt274.
>>
>> Any pointers welcome...
>>
>> Thx,
>> Regards,
>> Lee
>>
>>
>
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users