'If you want to go that way yes... otherwise you just extend the feature
type with a "color" attribute and use
it directly in the style.
A rendering transformation can do worse things (change raster into vector
and vice versa), adding an
attribute is kind of light lifting for it ;-)'
It seems simple to you but not for me...I am on the same poblem for weeks
now And I am still not able to get some results, I hope you will be able to
help me ;)
Thank you
2015-02-09 13:03 GMT+01:00 Bonventi Matthieu <[email protected]>:
> I think I don't understand how the whole thing is functionning . I try to
> code , the first part is :
>
> @DescribeProcess(title = "DynamicColorCompute", description = "xxxx")
> public class DynamicColorCompute implements GSProcess {
>
> @DescribeResult(name = "result", description = "xxx")
> public SimpleFeatureCollection execute(
>
> // process data
> @DescribeParameter(name = "data", description = "Features
> containing the data points") SimpleFeatureCollection obsFeatures,
> ProgressListener progressListener)
>
> throws ProcessException {
>
> FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
>
>
>
> Expression = ff.property(obsFeatures);
> MaxVisitor maxVisitor = new MaxVisitor(expression);
> collection.accepts(maxVisitor, null);
> CalcResult resultmax = maxVisitor.getResult();
>
> Object max = resultmax.getValue();
>
> MinVisitor minVisitor = new MinVisitor(expression);
> collection.accepts(minVisitor, null);
> CalcResult resultmin = minVisitor.getResult();
>
> Object min = resultmin.getValue();
>
>
> }
>
> }
>
> Is it the right way to get the min value and max value ? But how can I
> connect it with that part of code (which need to have a value as input with
> the min and max) :
>
> private Color getRGBcolor(float value,float minValue,float maxValue,float
> saturation,float brightness) {
> float hue = (value - minValue) / (maxValue - minValue);
> if (hue < 0.0f || hue > 1.0f) {
> return null;
> }
>
> int rgb = Color.HSBtoRGB(adjustedGradient(hue), saturation,
> brightness);
> return new Color(rgb);
> }
>
> private float adjustedGradient(float hue) {
>
> return hue * 0.32f;
> }
>
> 2015-02-09 12:10 GMT+01:00 Bonventi Matthieu <[email protected]>
> :
>
>> Plus, how can I access the current feature to code the color ? I mean
>> what I need to contribute the new attribute is the current value,the min
>> and the max.
>>
>> 2015-02-09 11:33 GMT+01:00 Bonventi Matthieu <[email protected]
>> >:
>>
>>> Hello Andrea,Jody,
>>>
>>> I am back to work and I just want to check something.
>>> First, let's back to the problem, The process will be :
>>>
>>> 1/ get dataset through the 'data' paramter of the tranformation function
>>> 2/ access the all data collection to get be able to get the min and the
>>> max
>>> 3/ compute the hue color code
>>> 4/ return it to the sld where I call the function I made 2 weeks ago to
>>> color it
>>>
>>> Basically If I understood, The tranformation process get the data set,
>>> compute something and send it back to the symbolizer.
>>>
>>> Secondly, You told me I should use the tranformation process one. So you
>>> mean I have to use the heatmap ? I read the code and find
>>>
>>> @DescribeProcess(title = "Heatmap", description = "Computes a heatmap
>>> surface over a set of irregular data points as a GridCoverage.")
>>> public class HeatmapProcess implements GSProcess {
>>>
>>> @DescribeResult(name = "result", description = "The heat map surface as
>>> a raster")
>>> public GridCoverage2D execute(
>>>
>>> // process data
>>> @DescribeParameter(name = "data", description = "Features
>>> containing the data points") SimpleFeatureCollection obsFeatures
>>>
>>>
>>> So I should be able to get the min and max from obsFeatures right ? My
>>> question is what I have to put instead of GridCoverage2D Because Actually I
>>> don't want any tranformation, just compute a value using the min and max of
>>> the collection and return that value to the sld to proceed with the
>>> coloration ?
>>>
>>> I hope I don't bother your with all these questions but at the end maybe
>>> we will have a dynamic Choropleth map, interesting isn't it ?
>>>
>>> Best regards ;)
>>>
>>> 2015-01-30 21:44 GMT+01:00 Andrea Aime <[email protected]>:
>>>
>>>> On Fri, Jan 30, 2015 at 8:53 PM, Jody Garnett <[email protected]>
>>>> wrote:
>>>>
>>>>> That is a good idea ... although this is probably the whole collection
>>>>> for the current bounding box. All we would have to do is be able to assign
>>>>> the result to an environment variable to complete the workflow.
>>>>>
>>>>>
>>>> If you want to go that way yes... otherwise you just extend the feature
>>>> type with a "color" attribute and use
>>>> it directly in the style.
>>>> A rendering transformation can do worse things (change raster into
>>>> vector and vice versa), adding an
>>>> attribute is kind of light lifting for it ;-)
>>>>
>>>> Cheers
>>>> Andrea
>>>>
>>>> --
>>>> ==
>>>> GeoServer Professional Services from the experts! Visit
>>>> http://goo.gl/NWWaa2 for more information.
>>>> ==
>>>>
>>>> Ing. Andrea Aime
>>>> @geowolf
>>>> Technical Lead
>>>>
>>>> GeoSolutions S.A.S.
>>>> Via Poggio alle Viti 1187
>>>> 55054 Massarosa (LU)
>>>> Italy
>>>> phone: +39 0584 962313
>>>> fax: +39 0584 1660272
>>>> mob: +39 339 8844549
>>>>
>>>> http://www.geo-solutions.it
>>>> http://twitter.com/geosolutions_it
>>>>
>>>> *AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*
>>>>
>>>> Le informazioni contenute in questo messaggio di posta elettronica e/o
>>>> nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
>>>> loro utilizzo è consentito esclusivamente al destinatario del messaggio,
>>>> per le finalità indicate nel messaggio stesso. Qualora riceviate questo
>>>> messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
>>>> darcene notizia via e-mail e di procedere alla distruzione del messaggio
>>>> stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
>>>> divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
>>>> utilizzarlo per finalità diverse, costituisce comportamento contrario ai
>>>> principi dettati dal D.Lgs. 196/2003.
>>>>
>>>>
>>>>
>>>> The information in this message and/or attachments, is intended solely
>>>> for the attention and use of the named addressee(s) and may be confidential
>>>> or proprietary in nature or covered by the provisions of privacy act
>>>> (Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
>>>> Code).Any use not in accord with its purpose, any disclosure, reproduction,
>>>> copying, distribution, or either dissemination, either whole or partial, is
>>>> strictly forbidden except previous formal approval of the named
>>>> addressee(s). If you are not the intended recipient, please contact
>>>> immediately the sender by telephone, fax or e-mail and delete the
>>>> information in this message that has been received in error. The sender
>>>> does not give any warranty or accept liability as the content, accuracy or
>>>> completeness of sent messages and accepts no responsibility for changes
>>>> made after they were sent or for other risks which arise as a result of
>>>> e-mail transmission, viruses, etc.
>>>>
>>>> -------------------------------------------------------
>>>>
>>>
>>>
>>>
>>> --
>>> Matthieu BONVENTI
>>>
>>
>>
>>
>> --
>> Matthieu BONVENTI
>>
>
>
>
> --
> Matthieu BONVENTI
>
--
Matthieu BONVENTI
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel