Hi Ian,

I am getting the following exception when using the Geotools MySQLDataStore
getBounds method.

Caused by: java.lang.ClassCastException: com.vividsolutions.jts.geom.Point
cannot be cast to com.vividsolutions.jts.geom.Polygon
at
org.geotools.data.mysql.MySQLDialectBasic.decodeGeometryEnvelope(MySQLDialectBasic.java:214)
at org.geotools.jdbc.JDBCDataStore.getBounds(JDBCDataStore.java:1322)

The following code is causing the exception

Polygon polygon = (Polygon) new WKBReader().read(wkb);

This can be solved by using

 Geometry geometry= new WKBReader().read(wkb);
 return geometry.getEnvelopeInternal();


Please can you help with the fix.


-- 
Thanks and Warm Regards
Debasish Sahu
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to