-
Notifications
You must be signed in to change notification settings - Fork 168
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
WKTReader returns Envelope instead of Polygon #166
Comments
This choice is made here: |
This only happens when parsing polygons. |
What do you think about adding a configuration boolean to parseIfSupported() and parse()? This would then be supplied to parseShapeByType(). Or do you think the configuration should be done via the context factory that creates the parsers in the first place? |
I think the proposed boolean, e.g. parsePolyAsRect, isn't so fundamental to parsing that it belongs in the method call to parse(). So yes I think it goes in the configuration of the context factory passed to the parser. |
This sounds like the default case should be to parse wkt strings without the transform to envelope functionality (as this it what a user expects: provide a polygon, get a polygon). I could create a pull request that removes the default transformation, but I do not want to add the configuration option that adds the transform functionality via the factory. What do you think?
… Am 31.08.2018 um 19:26 schrieb David Smiley ***@***.***>:
What do you think about adding a configuration boolean to parseIfSupported() and parse()? This would then be supplied to parseShapeByType()
I think the proposed boolean, e.g. parsePolyAsRect, isn't so fundamental to parsing that it belongs in the method call to parse(). So yes I think it goes in the configuration of the context factory passed to the parser.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I sympathize the default behavior is not correct and ought to be changed (and thanks for reporting it). But the main consumer/user of this API (Apache Lucene-spatial-extras / Solr) prefers an optimized representation of the shape for performance reasons. Are you objecting to this being a config toggle or just saying you don't want to do it? |
I meant the latter (I think adding a configuration option is a good idea), but if just changing the default is not an option because of Solr, I will for now rather overwrite the reader :). |
It’s ok to change a default. I just think it should be configurable. |
When supplying a rectangle wktstring (POLYGON ((14 53, 13 53, 13 52, 14 52, 14 53))) to the WKTReader, the WKTReader returns an Envelope (ENVELOPE (13, 14, 53, 52)).
I find this non intuitive, as I would expect it to not change the "shape form". Is there a possibility to
I guess this would also happen with other shapes, e.g., a circle, right?
The text was updated successfully, but these errors were encountered: