Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't Serialize Custom Geometries #44

Open
Nath5 opened this issue Apr 8, 2016 · 2 comments
Open

Can't Serialize Custom Geometries #44

Nath5 opened this issue Apr 8, 2016 · 2 comments

Comments

@Nath5
Copy link

Nath5 commented Apr 8, 2016

Hello,

I am trying to serialize my RTree of type <CustomObject, Polygon> using the following code:

OutputStream os = new FileOutputStream(new File("test.tree")); Serializer<Fence, Polygon> serializer = Serializers.flatBuffers().javaIo(); serializer.write(tree, os);

I keep getting the following error:

java.lang.RuntimeException: unexpected at com.github.davidmoten.rtree.fbs.FlatBuffersHelper.addEntries(FlatBuffersHelper.java:60) at com.github.davidmoten.rtree.fbs.SerializerFlatBuffers.addNode(SerializerFlatBuffers.java:96) at com.github.davidmoten.rtree.fbs.SerializerFlatBuffers.write(SerializerFlatBuffers.java:73) at CreateDataTests.main(CreateDataTests.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)

It looks like the addEntries method of FlatBuffersHelper can only process the built in geometries. Is there a way around this?

Thanks

@davidmoten
Copy link
Owner

Not at the moment, but I'll think about it. Do you have any suggestions?

On Sat, 9 Apr 2016 01:45 Nath5 notifications@github.com wrote:

Hello,

I am trying to serialize my RTree of type using the following code:

OutputStream os = new FileOutputStream(new File("test.tree"));
Serializer<Fence, Polygon> serializer = Serializers.flatBuffers().javaIo();
serializer.write(tree, os);

I keep getting the following error:

java.lang.RuntimeException: unexpected
at
com.github.davidmoten.rtree.fbs.FlatBuffersHelper.addEntries(FlatBuffersHelper.java:60)
at
com.github.davidmoten.rtree.fbs.SerializerFlatBuffers.addNode(SerializerFlatBuffers.java:96)
at
com.github.davidmoten.rtree.fbs.SerializerFlatBuffers.write(SerializerFlatBuffers.java:73)
at CreateDataTests.main(CreateDataTests.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)

It looks like the addEntries method of FlatBuffersHelper can only process
the built in geometries. Is there a way around this?

Thanks


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#44

@Nath5
Copy link
Author

Nath5 commented Apr 11, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants