public GeoJsonTo toTransferObject ( Geometry geometry ) { if ( geometry instanceof Point ) { return toTransferObject ( ( Point ) geometry ) ; } else if ( geometry instanceof LineString ) { return toTransferObject ( ( LineString ) geometry ) ; } else if ( geometry instanceof MultiPoint ) { return toTransferObject ( ( MultiPoint ) geometry ) ; } else if ( geometry instanceof MultiLineString ) { return toTransferObject ( ( MultiLineString ) geometry ) ; } else if ( geometry instanceof Polygon ) { return toTransferObject ( ( Polygon ) geometry ) ; } else if ( geometry instanceof MultiPolygon ) { return toTransferObject ( ( MultiPolygon ) geometry ) ; } else if ( geometry instanceof GeometryCollection ) { return toTransferObject ( ( GeometryCollection ) geometry ) ; } return null ; }
Creates the correct TO starting from any geolatte geometry .