code: @SuppressWarnings({"unchecked", "rawtypes", "deprecation"})
      public String toJson() {
          StringWriter stringWriter = new StringWriter();
          JsonWriter writer = new JsonWriter(stringWriter, new JsonWriterSettings());
          Codec codec = getRegistry().get(getClass());
          codec.encode(writer, this, EncoderContext.builder().build());
          return stringWriter.toString();
      }
docs: Converts to GeoJSON representation
  
  @return the GeoJSON representation