[
https://issues.apache.org/jira/browse/LUCENE-7853?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16026264#comment-16026264
]
Ignacio Vera commented on LUCENE-7853:
--------------------------------------
Do you see any isuue with the following proposal:
I would like to add the following four methods to the GeoPolygonFactory which
should only be used when we know the type of polygon we are delaing with, e.g.
polygon has been serialized:
public static GeoConcavePolygon makeGeoConcavePolygon(final PlanetModel
planetModel,
final List<GeoPoint>
pointList) {
return new GeoConcavePolygon(planetModel, pointList);
}
public static GeoConcavePolygon makeGeoConcavePolygon(final PlanetModel
planetModel,
final List<GeoPoint>
pointList,
final List<GeoPolygon>
holes) {
return new GeoConcavePolygon(planetModel,pointList, holes);
}
public static GeoConvexPolygon makeGeoConvexPolygon(final PlanetModel
planetModel,
final List<GeoPoint>
pointList) {
return new GeoConvexPolygon(planetModel, pointList);
}
public static GeoConvexPolygon makeGeoConvexPolygon(final PlanetModel
planetModel,
final List<GeoPoint>
pointList,
final List<GeoPolygon>
holes) {
return new GeoConvexPolygon(planetModel,pointList, holes);
}
> Request to change visibility of classes in geo3d
> ------------------------------------------------
>
> Key: LUCENE-7853
> URL: https://issues.apache.org/jira/browse/LUCENE-7853
> Project: Lucene - Core
> Issue Type: Improvement
> Components: modules/spatial3d
> Reporter: Ignacio Vera
> Assignee: Karl Wright
>
> I am creating my own spatial context by wrapping the objects in lucene geo3d
> library and implement my own query which mixes the recursive and the
> serialized strategy to add precision to searches.
>
> I had the following issue specially with polygons: The factory for creating
> polygons is slow and when serializing shapes, I already know if I am dealing
> with convex or concave polygons (in my case they are always concave). So when
> de-serializing a polygon I do not want to go through the factory to decide
> the type of polygon to create.
>
> Wouldn't make sense to add the possibility to create a type of polygon
> directly? you cannot create the polygons directly as they are protected in
> the package. My suggestion request would be either to add methods in the
> polygon factory to create a type of polygons with no checking (e.g.
> makeConcavePolygon(…)) or change the visibility of the classes so that they
> can be instantiated directly.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]