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"]
Received on Fri Jan 21 2011 - 07:17:37 EST