[Geotools-devel] Question about centroid sampling code

2017-04-12 Thread Justin Deoliveira
Hi folks, I am working on patch that takes some code from the LabelCacheImpl into RendererUtilities. Basically I want to re-use the logic that attempts to find a central point that actually lies within a polygon. The code I have a question about is this, where the size of a sampling “step” is com

Re: [Geotools-devel] Question about centroid sampling code

2017-04-12 Thread Andrea Aime
Hi Justin, are you sure that's a "unit"? I thought it was pixel. Aren't the geometries reprojected and brought to screen space already at that point? Cheers Andrea On Wed, Apr 12, 2017 at 4:36 PM, Justin Deoliveira wrote: > Hi folks, > > I am working on patch that takes some code from the Label

Re: [Geotools-devel] Question about centroid sampling code

2017-04-12 Thread Andrea Aime
Ah wait, it might be that it normally is, during map rendering, but the KML code is not working against a screen, and that's why you are asking this question? Cheers Andrea On Wed, Apr 12, 2017 at 4:44 PM, Andrea Aime wrote: > Hi Justin, > are you sure that's a "unit"? I thought it was pixel.

Re: [Geotools-devel] Question about centroid sampling code

2017-04-12 Thread Justin Deoliveira
Thanks Andrea, I thought that might be the case. And yes, my intention is to try and use this code for KML in order to choose a placemark placement that lies inside the polygon. Any objection to adding multiple arguments (or maybe multiple methods) that would invoke the same code but allowing for

Re: [Geotools-devel] Question about centroid sampling code

2017-04-12 Thread Andrea Aime
On Wed, Apr 12, 2017 at 5:36 PM, Justin Deoliveira wrote: > Thanks Andrea, I thought that might be the case. And yes, my intention is > to try and use this code for KML in order to choose a placemark placement > that lies inside the polygon. > > Any objection to adding multiple arguments (or mayb

Re: [Geotools-devel] Question about centroid sampling code

2017-04-12 Thread Justin Deoliveira
Hmmm… I could explore that but it seems like a kind of round about away to go and more invasive. All I need is a central point to use as the placemark so I prefer to just call that same sampling routine to get it, which as far as I can tell should be a 100% safe refactoring. If we’re not comfortabl

Re: [Geotools-devel] Question about centroid sampling code

2017-04-12 Thread Andrea Aime
Hi Justin, sorry I'm currently in a meeting that will last till the end of day so you're getting 5% of my attention :-p (better that or full attention in the weekend?) Re-read again, yeah, go ahead with what you're proposing, it sounds more than reasonable. Cheers Andrea On Wed, Apr 12, 2017 at

Re: [Geotools-devel] Question about centroid sampling code

2017-04-12 Thread Justin Deoliveira
Haha. 5% of Andrea still equals 200% of any mere mortal ;) so much appreciated! This gives me a couple of things to explore. Thanks again! On Wed, Apr 12, 2017 at 10:22 AM Andrea Aime wrote: > Hi Justin, > sorry I'm currently in a meeting that will last till the end of day so > you're getting

[Geotools-devel] zoom level function

2017-04-12 Thread Jody Garnett
Quick request Kevin, Can I ask if we can move the "zoom level mapper" from YSLD to a more general location? I woudl like to create a zoomLevel( env("wms_scale_denomiator'), "EPSG:3857" ) function to support the mapbox style work - and do not want to duplicate code. -- Jody Garnett