[
https://issues.apache.org/jira/browse/LUCENE-7936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ignacio Vera updated LUCENE-7936:
---------------------------------
Attachment: LUECENE-7936-test.patch
Thanks [~daddywri],
I attached a patch with a test for serialization. It showed few issues:
1) Holes can be null and need to be dealt with.
2) Java does not allow to cast one type of array to another type of array.
Regarding the current implementation, I think we should not serialize GeoPoint
as an object and make it more compact. Objects should just serialize GeoPoints
as two doubles. For example for a polygon with 6 points would save 6 GeoPoint
strings. And in fact I think points should not be serializable at all, only
classes that implement PlanetObject. what do you think?
Cheers,
I.
By the way, should not writeObject and readObject be public?
> Extend Geoshape interfaces so objects can be copied/serialized
> --------------------------------------------------------------
>
> Key: LUCENE-7936
> URL: https://issues.apache.org/jira/browse/LUCENE-7936
> Project: Lucene - Core
> Issue Type: Improvement
> Components: modules/spatial3d
> Reporter: Ignacio Vera
> Assignee: Karl Wright
> Attachments: GeoBinaryCodec.patch, LUCENE-7936.patch,
> LUCENE-7936.patch, LUCENE-7936.patch, LUECENE-7936-test.patch, Spatial4j.patch
>
>
> Hi [[email protected]],
> I would like to propose to extends the GeoShape interfaces to be able to
> copy/serialized the objects. The current status and propose change is as
> following:
> GeoPoint: It can be serialized by using x, y, z
> GeoCircle: It can be serialized by using getCenter() and getRadius() and
> getPlanetModel()
> GeoCompositeShape: It can be serialized by accesing shapes using size() and
> GetShape(int index)
> GeoPath: add methods to the interface getPoints() and getCutoffAngle()
> GeoPolygon: This is the most complicated one as we have different types:
> 1.- GeoCompositePolygon is just a composite
> 2.- GeoConcavePolygon and GeoConvexPolygon: Create a new interface for
> those polygons which exposes the points, holes, internaledges and
> concavity/convexity
> 3.- GeoComplexPolygons: Do nothing, they are too complex to be serialize??
> I am intersested in accesing the discreatization of the polygons into convex
> and concave ones for other reasons as well. I think this should be expose as
> they end result can be used for other use cases.
> Cheers,
> I.
>
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]