Re: [OpenMap Users] getExtents() method returns rounded up/down coordinates?

From: GMLチェックツール <gml.check.tool_at_gmail.com>
Date: Mon, 24 Jan 2011 10:50:51 +0900

Thanks.
But... almost the whole package will be affected.

Anyone had already the updated code? or svn url?

(2011/01/22 5:56), Don Dietrick wrote:
> You're right, that's a bug, left over from when
> OMGraphics/EsriGraphics were float-based. That code needs to be
> updated to simply use the doubles.
>
> - Don
>
> 2011/1/21 GMLチェックツール<gml.check.tool_at_gmail.com>:
>> Hi,
>>
>> I am converting shp to gml3.2.1 then I'm having a problem during
>> getExtents because the float[] values are rounded up.
>>
>> sample coordinates:
>>
>> gml (successfully converted to shp):
>> <gml:Point gml:id="pt_1">
>> <gml:pos>35.682417 139.75306</gml:pos>
>> </gml:Point>
>>
>> getExtents() value:
>> [35.68242, 139.75307, 35.68242, 139.75307]
>>
>> After some investigation, the problem is converting double to float.
>> Please see the below code.
>> EsriGraphicFactory.java
>>
>> protected EsriGraphic createPointGraphic(double x, double y,
>> Object representation,
>> DrawingAttributes drawingAttributes) {
>>
>> if (dataTransformation != null) {
>> LatLonPoint llp = dataTransformation.inverse(x, y);
>> x = llp.getLongitude();
>> y = llp.getLatitude();
>> }
>>
>> EsriGraphic ret = null;
>>
>> if (representation == null) {
>> ret = new EsriPoint((float) y, (float) x);
>> } else if (representation instanceof ImageIcon) {
>> ret = new EsriIconPoint((float) y, (float) x, (ImageIcon) representation);
>> } else if (representation instanceof String) {
>> ret = new EsriTextPoint((float) y, (float) x, (String) representation,
>> OMText.JUSTIFY_CENTER);
>> }
>>
>> if (drawingAttributes != null&& ret != null) {
>> drawingAttributes.setTo((OMGraphic) ret);
>> }
>> return ret;
>> }
>>
>> I think it is better to maintain the original value.
>> Please share your thoughts.
>>
>> Regards
>>
>> --
>> [To unsubscribe to this list send an email to "majdart_at_bbn.com"
>> with the following text in the BODY of the message "unsubscribe openmap-users"]
>>

--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Sun Jan 23 2011 - 20:51:40 EST

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:10 EDT