{"action":"created","issue":{"url":"https://api.github.com/repos/davidmoten/rtree/issues/44","repository_url":"https://api.github.com/repos/davidmoten/rtree","labels_url":"https://api.github.com/repos/davidmoten/rtree/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/davidmoten/rtree/issues/44/comments","events_url":"https://api.github.com/repos/davidmoten/rtree/issues/44/events","html_url":"https://github.com/davidmoten/rtree/issues/44","id":146965201,"number":44,"title":"Can't Serialize Custom Geometries","user":{"login":"Nath5","id":6063053,"avatar_url":"https://avatars.githubusercontent.com/u/6063053?v=3","gravatar_id":"","url":"https://api.github.com/users/Nath5","html_url":"https://github.com/Nath5","followers_url":"https://api.github.com/users/Nath5/followers","following_url":"https://api.github.com/users/Nath5/following{/other_user}","gists_url":"https://api.github.com/users/Nath5/gists{/gist_id}","starred_url":"https://api.github.com/users/Nath5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nath5/subscriptions","organizations_url":"https://api.github.com/users/Nath5/orgs","repos_url":"https://api.github.com/users/Nath5/repos","events_url":"https://api.github.com/users/Nath5/events{/privacy}","received_events_url":"https://api.github.com/users/Nath5/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-08T15:45:14Z","updated_at":"2016-04-11T15:11:38Z","closed_at":null,"body":"Hello,\r\n\r\nI am trying to serialize my RTree of type <CustomObject, Polygon> using the following code:\r\n\r\n`            OutputStream os = new FileOutputStream(new File(\"test.tree\"));\r\n            Serializer<Fence, Polygon> serializer = Serializers.flatBuffers().javaIo();\r\n            serializer.write(tree, os);\r\n`\r\n\r\nI keep getting the following error:\r\n\r\n`\r\njava.lang.RuntimeException: unexpected\r\n\tat com.github.davidmoten.rtree.fbs.FlatBuffersHelper.addEntries(FlatBuffersHelper.java:60)\r\n\tat com.github.davidmoten.rtree.fbs.SerializerFlatBuffers.addNode(SerializerFlatBuffers.java:96)\r\n\tat com.github.davidmoten.rtree.fbs.SerializerFlatBuffers.write(SerializerFlatBuffers.java:73)\r\n\tat CreateDataTests.main(CreateDataTests.java:31)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:498)\r\n\tat com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)\r\n`\r\n\r\nIt looks like the addEntries method of FlatBuffersHelper can only process the built in geometries.  Is there a way around this?\r\n\r\nThanks\r\n"},"comment":{"url":"https://api.github.com/repos/davidmoten/rtree/issues/comments/208394257","html_url":"https://github.com/davidmoten/rtree/issues/44#issuecomment-208394257","issue_url":"https://api.github.com/repos/davidmoten/rtree/issues/44","id":208394257,"user":{"login":"Nath5","id":6063053,"avatar_url":"https://avatars.githubusercontent.com/u/6063053?v=3","gravatar_id":"","url":"https://api.github.com/users/Nath5","html_url":"https://github.com/Nath5","followers_url":"https://api.github.com/users/Nath5/followers","following_url":"https://api.github.com/users/Nath5/following{/other_user}","gists_url":"https://api.github.com/users/Nath5/gists{/gist_id}","starred_url":"https://api.github.com/users/Nath5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nath5/subscriptions","organizations_url":"https://api.github.com/users/Nath5/orgs","repos_url":"https://api.github.com/users/Nath5/repos","events_url":"https://api.github.com/users/Nath5/events{/privacy}","received_events_url":"https://api.github.com/users/Nath5/received_events","type":"User","site_admin":false},"created_at":"2016-04-11T15:11:38Z","updated_at":"2016-04-11T15:11:38Z","body":"I will have to take a deeper look into how you are doing the serialization.  Just wanted to make sure there wasn't something simple I was missing. "}}