[Geoserver-users] Wind Vectors & Barbs / Rotation

Simone,

As you might can tell from some of my recent posts, I am a meteorologist focused primarily on meteorological data systems, so I am glad to see your ongoing focus in that area. Particularly, I was excited to see details about wind barbs on your blog:

http://www.geo-solutions.it/blog/developers-corner-supporting-wind-barbs-geoserver-geotools/

and I have been working with the RasterAsPointCollection transformation for some time as shown here:

http://geoserver.geo-solutions.it/edu/en/wps/rendering_tx.html#point-extraction

I do want to raise one concern and/or question about the “Rotation” angle for the Mark used to symbolize the vector.

From a scientific perspective, we want the arrow or vector to point TOWARD the direction wind is blowing, right, and conversely the barb to point in the direction FROM which the wind is blowing.

However, doesn’t the ROTATION parameter for the mark (arrow, barb, etc.) only impact rotation of the mark within screen coordinates? In other words, doesn’t it just rotate a mark by a certain angle on the screen, without respect to the underlying map projection?

If so, then the arrows or barbs displayed would only be valid for maps with a Mercator projection, where true north aligns with “up” on the screen/map/grid.

For many other projections, though, “up” on the screen/map/grid does not align with true north. In fact, depending on the projection and location, “up” may be toward the south!

So, again as a question and comment … is ROTATION relative to the screen or to the underlying map rotation? To get the vector to be properly rotated with respect to true north and underlying land masses (and not screen “up”), it would need to be relative to the underlying projection, not the screen.

I am currently working on this aspect myself … and am finding myself needing to calculate the Grid Convergence Angle at each point … where I will be able to know how far off the “up” axis at that point is from true north. I will then have to account for that angle and add it to / subtract it from the screen ROTATION angle so that my vectors truly show actual direction when I am using a non-mercator basemap. I had a separate GeoTools post asking the best way to calculate Grid Convergence Angle … and I am still working on that.

Does this make sense or are you already compensating for any underlying map projection which might rotate “up” away from true north? If so, do you mind sharing how you are accomplishing that?

Thanks again!

  • Mike Grogan

Dear Mike,
please, read below....

Regards,
Simone Giannecchini

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.

Ing. Simone Giannecchini
@simogeo
Founder/Director

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 333 8128928

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

On Mon, Apr 28, 2014 at 10:25 PM, Mike Grogan
<d.michael.grogan@anonymised.com> wrote:

Simone,

As you might can tell from some of my recent posts, I am a meteorologist
focused primarily on meteorological data systems, so I am glad to see your
ongoing focus in that area. Particularly, I was excited to see details
about wind barbs on your blog:

http://www.geo-solutions.it/blog/developers-corner-supporting-wind-barbs-geoserver-geotools/

and I have been working with the RasterAsPointCollection transformation for
some time as shown here:

http://geoserver.geo-solutions.it/edu/en/wps/rendering_tx.html#point-extraction

I do want to raise one concern and/or question about the "Rotation" angle
for the Mark used to symbolize the vector.

From a scientific perspective, we want the arrow or vector to point TOWARD
the direction wind is blowing, right, and conversely the barb to point in
the direction FROM which the wind is blowing.

This is something we are going to take into account for the work we are doing.
It is going to be available tomorrow, but let's say before the end of
May it should be available at least on Master.

However, doesn't the ROTATION parameter for the mark (arrow, barb, etc.)
only impact rotation of the mark within screen coordinates? In other words,
doesn't it just rotate a mark by a certain angle on the screen, without
respect to the underlying map projection?

If so, then the arrows or barbs displayed would only be valid for maps with
a Mercator projection, where true north aligns with "up" on the
screen/map/grid.

For many other projections, though, "up" on the screen/map/grid does not
align with true north. In fact, depending on the projection and location,
"up" may be toward the south!

So, again as a question and comment ... is ROTATION relative to the screen
or to the underlying map rotation? To get the vector to be properly rotated
with respect to true north and underlying land masses (and not screen "up"),
it would need to be relative to the underlying projection, not the screen.

I am currently working on this aspect myself ... and am finding myself
needing to calculate the Grid Convergence Angle at each point ... where I
will be able to know how far off the "up" axis at that point is from true
north. I will then have to account for that angle and add it to / subtract
it from the screen ROTATION angle so that my vectors truly show actual
direction when I am using a non-mercator basemap. I had a separate GeoTools
post asking the best way to calculate Grid Convergence Angle ... and I am
still working on that.

Does this make sense or are you already compensating for any underlying map
projection which might rotate "up" away from true north? If so, do you mind
sharing how you are accomplishing that?

The idea is to create a specific filter function to complement the
rotation depending on the target project.
It is not super easy but if you are interested in helping out we can
share some additional details with you, let us know...

Thanks again!

- Mike Grogan

Simone,

I made some progress on my own early / rough version of a Filter Function to accomplish this. My test was to dynamically label all U.S. states with an arrow pointing to true north. The underlying SLD placed the arrow and had it aligned to grid / screen “north” (0 degrees), then subtracted off the grid convergence angle at each state centroid with a call to my Filter Function, yielding arrows that appear to point to true north no matter the projection.

The projection below was Arctic Polar Stereographic… / EPSG:3995.

Again, I will be interested to compare with your approach … you can e-mail me separately if you want to discuss that further (per previous e-mail). I have an ongoing project for which I need this pretty soon, so I am trying to forge ahead on my own version.

Thanks,

Mike Grogan

pointing_north.png

···

Inline image 1

On Wed, Apr 30, 2014 at 12:07 PM, Mike Grogan <d.michael.grogan@anonymised.com> wrote:

I am interested to the point that I can help out, but don’t want to make promises beyond my capacity to help you guys … that might just slow you down. Let me know how you think I might be able to help. At the very least, perhaps running some of my own test data through a nightly build or something and providing some feedback.

In the interim, I am working a mod to the RasterAsPointCollection rendering transformation that might provide me with similar functionality to see where that takes me for my immediate need.

Thanks again,

Mike

On Tue, Apr 29, 2014 at 1:35 PM, Simone Giannecchini <simone.giannecchini@anonymised.com> wrote:

Dear Mike,
please, read below…

Regards,
Simone Giannecchini

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.

Ing. Simone Giannecchini
@simogeo
Founder/Director

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 333 8128928

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On Mon, Apr 28, 2014 at 10:25 PM, Mike Grogan
<d.michael.grogan@anonymised.com> wrote:

Simone,

As you might can tell from some of my recent posts, I am a meteorologist
focused primarily on meteorological data systems, so I am glad to see your
ongoing focus in that area. Particularly, I was excited to see details
about wind barbs on your blog:

http://www.geo-solutions.it/blog/developers-corner-supporting-wind-barbs-geoserver-geotools/

and I have been working with the RasterAsPointCollection transformation for
some time as shown here:

http://geoserver.geo-solutions.it/edu/en/wps/rendering_tx.html#point-extraction

I do want to raise one concern and/or question about the “Rotation” angle
for the Mark used to symbolize the vector.

From a scientific perspective, we want the arrow or vector to point TOWARD
the direction wind is blowing, right, and conversely the barb to point in
the direction FROM which the wind is blowing.

This is something we are going to take into account for the work we are doing.
It is going to be available tomorrow, but let’s say before the end of
May it should be available at least on Master.

However, doesn’t the ROTATION parameter for the mark (arrow, barb, etc.)
only impact rotation of the mark within screen coordinates? In other words,
doesn’t it just rotate a mark by a certain angle on the screen, without
respect to the underlying map projection?

If so, then the arrows or barbs displayed would only be valid for maps with
a Mercator projection, where true north aligns with “up” on the
screen/map/grid.

For many other projections, though, “up” on the screen/map/grid does not
align with true north. In fact, depending on the projection and location,
“up” may be toward the south!

So, again as a question and comment … is ROTATION relative to the screen
or to the underlying map rotation? To get the vector to be properly rotated
with respect to true north and underlying land masses (and not screen “up”),
it would need to be relative to the underlying projection, not the screen.

I am currently working on this aspect myself … and am finding myself
needing to calculate the Grid Convergence Angle at each point … where I
will be able to know how far off the “up” axis at that point is from true
north. I will then have to account for that angle and add it to / subtract
it from the screen ROTATION angle so that my vectors truly show actual
direction when I am using a non-mercator basemap. I had a separate GeoTools
post asking the best way to calculate Grid Convergence Angle … and I am
still working on that.

Does this make sense or are you already compensating for any underlying map
projection which might rotate “up” away from true north? If so, do you mind
sharing how you are accomplishing that?

The idea is to create a specific filter function to complement the
rotation depending on the target project.
It is not super easy but if you are interested in helping out we can
share some additional details with you, let us know…

Thanks again!

  • Mike Grogan

Hi Mike,
this one looks good, do you mind sharing the code? Would it be ok to contribute it to GeoTools, or do you
have copyright restrictions of sort?

Cheers
Andrea

pointing_north.png

···

On Thu, May 1, 2014 at 3:30 AM, Mike Grogan <d.michael.grogan@anonymised.com> wrote:

Simone,

I made some progress on my own early / rough version of a Filter Function to accomplish this. My test was to dynamically label all U.S. states with an arrow pointing to true north. The underlying SLD placed the arrow and had it aligned to grid / screen “north” (0 degrees), then subtracted off the grid convergence angle at each state centroid with a call to my Filter Function, yielding arrows that appear to point to true north no matter the projection.

The projection below was Arctic Polar Stereographic… / EPSG:3995.

Again, I will be interested to compare with your approach … you can e-mail me separately if you want to discuss that further (per previous e-mail). I have an ongoing project for which I need this pretty soon, so I am trying to forge ahead on my own version.

Thanks,

Mike Grogan


“Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos. Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free.”
http://p.sf.net/sfu/SauceLabs


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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


Inline image 1

On Wed, Apr 30, 2014 at 12:07 PM, Mike Grogan <d.michael.grogan@anonymised.com> wrote:

I am interested to the point that I can help out, but don’t want to make promises beyond my capacity to help you guys … that might just slow you down. Let me know how you think I might be able to help. At the very least, perhaps running some of my own test data through a nightly build or something and providing some feedback.

In the interim, I am working a mod to the RasterAsPointCollection rendering transformation that might provide me with similar functionality to see where that takes me for my immediate need.

Thanks again,

Mike

On Tue, Apr 29, 2014 at 1:35 PM, Simone Giannecchini <simone.giannecchini@anonymised.com> wrote:

Dear Mike,
please, read below…

Regards,
Simone Giannecchini

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.

Ing. Simone Giannecchini
@simogeo
Founder/Director

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 333 8128928

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On Mon, Apr 28, 2014 at 10:25 PM, Mike Grogan
<d.michael.grogan@anonymised.com> wrote:

Simone,

As you might can tell from some of my recent posts, I am a meteorologist
focused primarily on meteorological data systems, so I am glad to see your
ongoing focus in that area. Particularly, I was excited to see details
about wind barbs on your blog:

http://www.geo-solutions.it/blog/developers-corner-supporting-wind-barbs-geoserver-geotools/

and I have been working with the RasterAsPointCollection transformation for
some time as shown here:

http://geoserver.geo-solutions.it/edu/en/wps/rendering_tx.html#point-extraction

I do want to raise one concern and/or question about the “Rotation” angle
for the Mark used to symbolize the vector.

From a scientific perspective, we want the arrow or vector to point TOWARD
the direction wind is blowing, right, and conversely the barb to point in
the direction FROM which the wind is blowing.

This is something we are going to take into account for the work we are doing.
It is going to be available tomorrow, but let’s say before the end of
May it should be available at least on Master.

However, doesn’t the ROTATION parameter for the mark (arrow, barb, etc.)
only impact rotation of the mark within screen coordinates? In other words,
doesn’t it just rotate a mark by a certain angle on the screen, without
respect to the underlying map projection?

If so, then the arrows or barbs displayed would only be valid for maps with
a Mercator projection, where true north aligns with “up” on the
screen/map/grid.

For many other projections, though, “up” on the screen/map/grid does not
align with true north. In fact, depending on the projection and location,
“up” may be toward the south!

So, again as a question and comment … is ROTATION relative to the screen
or to the underlying map rotation? To get the vector to be properly rotated
with respect to true north and underlying land masses (and not screen “up”),
it would need to be relative to the underlying projection, not the screen.

I am currently working on this aspect myself … and am finding myself
needing to calculate the Grid Convergence Angle at each point … where I
will be able to know how far off the “up” axis at that point is from true
north. I will then have to account for that angle and add it to / subtract
it from the screen ROTATION angle so that my vectors truly show actual
direction when I am using a non-mercator basemap. I had a separate GeoTools
post asking the best way to calculate Grid Convergence Angle … and I am
still working on that.

Does this make sense or are you already compensating for any underlying map
projection which might rotate “up” away from true north? If so, do you mind
sharing how you are accomplishing that?

The idea is to create a specific filter function to complement the
rotation depending on the target project.
It is not super easy but if you are interested in helping out we can
share some additional details with you, let us know…

Thanks again!

  • Mike Grogan

I can probably share hopefully soon … but have run into one snag though and maybe could get a pointer? …

How do you figure out the Coordinate Reference System for a geometry that is passed to a Filter Function? They all look like JTS geometries which don’t seem to have CRS info readily available.

For the map I showed in my example, where the source layer was already existing, the Geometry (the_geom) that got passed to my Filter Function seemed to be in screen coordinates … so I went with that and transformed to the same coordinate system as the bounding box given a request width and height.

The geometry from a RasterAsPointCollection geometry, though, doesn’t seem to be working like it does for a “regular” geometry layer. I’m not sure what my coordinates are for those points … what are they based on? Should they be in screen coordinates as well? The same CRS as the underlying raster?

Thanks,

Mike

pointing_north.png

···

On Thu, May 1, 2014 at 3:04 AM, Andrea Aime <andrea.aime@anonymised.com> wrote:

Hi Mike,
this one looks good, do you mind sharing the code? Would it be ok to contribute it to GeoTools, or do you
have copyright restrictions of sort?

Cheers
Andrea

On Thu, May 1, 2014 at 3:30 AM, Mike Grogan <d.michael.grogan@anonymised.com> wrote:

Simone,

I made some progress on my own early / rough version of a Filter Function to accomplish this. My test was to dynamically label all U.S. states with an arrow pointing to true north. The underlying SLD placed the arrow and had it aligned to grid / screen “north” (0 degrees), then subtracted off the grid convergence angle at each state centroid with a call to my Filter Function, yielding arrows that appear to point to true north no matter the projection.

The projection below was Arctic Polar Stereographic… / EPSG:3995.

Again, I will be interested to compare with your approach … you can e-mail me separately if you want to discuss that further (per previous e-mail). I have an ongoing project for which I need this pretty soon, so I am trying to forge ahead on my own version.

Thanks,

Mike Grogan


“Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos. Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free.”
http://p.sf.net/sfu/SauceLabs


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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


Inline image 1

On Wed, Apr 30, 2014 at 12:07 PM, Mike Grogan <d.michael.grogan@anonymised.com> wrote:

I am interested to the point that I can help out, but don’t want to make promises beyond my capacity to help you guys … that might just slow you down. Let me know how you think I might be able to help. At the very least, perhaps running some of my own test data through a nightly build or something and providing some feedback.

In the interim, I am working a mod to the RasterAsPointCollection rendering transformation that might provide me with similar functionality to see where that takes me for my immediate need.

Thanks again,

Mike

On Tue, Apr 29, 2014 at 1:35 PM, Simone Giannecchini <simone.giannecchini@anonymised.com> wrote:

Dear Mike,
please, read below…

Regards,
Simone Giannecchini

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.

Ing. Simone Giannecchini
@simogeo
Founder/Director

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 333 8128928

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On Mon, Apr 28, 2014 at 10:25 PM, Mike Grogan
<d.michael.grogan@anonymised.com> wrote:

Simone,

As you might can tell from some of my recent posts, I am a meteorologist
focused primarily on meteorological data systems, so I am glad to see your
ongoing focus in that area. Particularly, I was excited to see details
about wind barbs on your blog:

http://www.geo-solutions.it/blog/developers-corner-supporting-wind-barbs-geoserver-geotools/

and I have been working with the RasterAsPointCollection transformation for
some time as shown here:

http://geoserver.geo-solutions.it/edu/en/wps/rendering_tx.html#point-extraction

I do want to raise one concern and/or question about the “Rotation” angle
for the Mark used to symbolize the vector.

From a scientific perspective, we want the arrow or vector to point TOWARD
the direction wind is blowing, right, and conversely the barb to point in
the direction FROM which the wind is blowing.

This is something we are going to take into account for the work we are doing.
It is going to be available tomorrow, but let’s say before the end of
May it should be available at least on Master.

However, doesn’t the ROTATION parameter for the mark (arrow, barb, etc.)
only impact rotation of the mark within screen coordinates? In other words,
doesn’t it just rotate a mark by a certain angle on the screen, without
respect to the underlying map projection?

If so, then the arrows or barbs displayed would only be valid for maps with
a Mercator projection, where true north aligns with “up” on the
screen/map/grid.

For many other projections, though, “up” on the screen/map/grid does not
align with true north. In fact, depending on the projection and location,
“up” may be toward the south!

So, again as a question and comment … is ROTATION relative to the screen
or to the underlying map rotation? To get the vector to be properly rotated
with respect to true north and underlying land masses (and not screen “up”),
it would need to be relative to the underlying projection, not the screen.

I am currently working on this aspect myself … and am finding myself
needing to calculate the Grid Convergence Angle at each point … where I
will be able to know how far off the “up” axis at that point is from true
north. I will then have to account for that angle and add it to / subtract
it from the screen ROTATION angle so that my vectors truly show actual
direction when I am using a non-mercator basemap. I had a separate GeoTools
post asking the best way to calculate Grid Convergence Angle … and I am
still working on that.

Does this make sense or are you already compensating for any underlying map
projection which might rotate “up” away from true north? If so, do you mind
sharing how you are accomplishing that?

The idea is to create a specific filter function to complement the
rotation depending on the target project.
It is not super easy but if you are interested in helping out we can
share some additional details with you, let us know…

Thanks again!

  • Mike Grogan

I have solved this another way as well … I have modified the RasterAsFeatureCollection function to return me the difference (grid convergence angle) in rotation angle from true north as an additional Property (PropertyName) for each returned point.

Actually, I went a good bit further and extended the function to allow me to specify a “u” band, a “v” band, and an x/y skip value. The rendering transformation function then adds properties to the points to give me magnitude, direction to/from, and then “corrected” direction to/from to align my arrows / barbs back relative to true north depending on the projection. It just feels cleaner to have this info coming back directly from the transformation function rather than trying to then apply yet another filter function to get the rotation angle.

So, I have this solved in a prototype in 2 different ways … as a Transformation Function based off of RasterAsFeatureCollection and as a Filter Function as Simone suggested.

If what I have sounds helpful, let me know. I might can work to clean up the code next week where I’m not embarrassed to share it.

I’m not presuming that I have or can do this better than you guys. It’s just a coincidence that I am needing to solve this at the same time Simone’s group is working to solve this … and I might not be able to wait for Simone’s final implementation.

Here are wind barbs shown properly rotated relative to true north (you’ll just have to take my word that they are aligned correctly) that were a result of my custom Rendering Transformation. I am displaying this in a Arctic Polar Stereo projection just to make sure all of my barbs were still aligned properly in relation to true north.

Inline image 1

Have a great weekend!

  • Mike Grogan

pointing_north.png

···

On Thu, May 1, 2014 at 4:47 PM, Mike Grogan <d.michael.grogan@anonymised.com> wrote:

I can probably share hopefully soon … but have run into one snag though and maybe could get a pointer? …

How do you figure out the Coordinate Reference System for a geometry that is passed to a Filter Function? They all look like JTS geometries which don’t seem to have CRS info readily available.

For the map I showed in my example, where the source layer was already existing, the Geometry (the_geom) that got passed to my Filter Function seemed to be in screen coordinates … so I went with that and transformed to the same coordinate system as the bounding box given a request width and height.

The geometry from a RasterAsPointCollection geometry, though, doesn’t seem to be working like it does for a “regular” geometry layer. I’m not sure what my coordinates are for those points … what are they based on? Should they be in screen coordinates as well? The same CRS as the underlying raster?

Thanks,

Mike

On Thu, May 1, 2014 at 3:04 AM, Andrea Aime <andrea.aime@anonymised.com107…> wrote:

Hi Mike,
this one looks good, do you mind sharing the code? Would it be ok to contribute it to GeoTools, or do you
have copyright restrictions of sort?

Cheers
Andrea

On Thu, May 1, 2014 at 3:30 AM, Mike Grogan <d.michael.grogan@anonymised.com> wrote:

Simone,

I made some progress on my own early / rough version of a Filter Function to accomplish this. My test was to dynamically label all U.S. states with an arrow pointing to true north. The underlying SLD placed the arrow and had it aligned to grid / screen “north” (0 degrees), then subtracted off the grid convergence angle at each state centroid with a call to my Filter Function, yielding arrows that appear to point to true north no matter the projection.

The projection below was Arctic Polar Stereographic… / EPSG:3995.

Again, I will be interested to compare with your approach … you can e-mail me separately if you want to discuss that further (per previous e-mail). I have an ongoing project for which I need this pretty soon, so I am trying to forge ahead on my own version.

Thanks,

Mike Grogan


“Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos. Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free.”
http://p.sf.net/sfu/SauceLabs


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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


Inline image 1

On Wed, Apr 30, 2014 at 12:07 PM, Mike Grogan <d.michael.grogan@anonymised.com> wrote:

I am interested to the point that I can help out, but don’t want to make promises beyond my capacity to help you guys … that might just slow you down. Let me know how you think I might be able to help. At the very least, perhaps running some of my own test data through a nightly build or something and providing some feedback.

In the interim, I am working a mod to the RasterAsPointCollection rendering transformation that might provide me with similar functionality to see where that takes me for my immediate need.

Thanks again,

Mike

On Tue, Apr 29, 2014 at 1:35 PM, Simone Giannecchini <simone.giannecchini@anonymised.com> wrote:

Dear Mike,
please, read below…

Regards,
Simone Giannecchini

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.

Ing. Simone Giannecchini
@simogeo
Founder/Director

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 333 8128928

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On Mon, Apr 28, 2014 at 10:25 PM, Mike Grogan
<d.michael.grogan@anonymised.com> wrote:

Simone,

As you might can tell from some of my recent posts, I am a meteorologist
focused primarily on meteorological data systems, so I am glad to see your
ongoing focus in that area. Particularly, I was excited to see details
about wind barbs on your blog:

http://www.geo-solutions.it/blog/developers-corner-supporting-wind-barbs-geoserver-geotools/

and I have been working with the RasterAsPointCollection transformation for
some time as shown here:

http://geoserver.geo-solutions.it/edu/en/wps/rendering_tx.html#point-extraction

I do want to raise one concern and/or question about the “Rotation” angle
for the Mark used to symbolize the vector.

From a scientific perspective, we want the arrow or vector to point TOWARD
the direction wind is blowing, right, and conversely the barb to point in
the direction FROM which the wind is blowing.

This is something we are going to take into account for the work we are doing.
It is going to be available tomorrow, but let’s say before the end of
May it should be available at least on Master.

However, doesn’t the ROTATION parameter for the mark (arrow, barb, etc.)
only impact rotation of the mark within screen coordinates? In other words,
doesn’t it just rotate a mark by a certain angle on the screen, without
respect to the underlying map projection?

If so, then the arrows or barbs displayed would only be valid for maps with
a Mercator projection, where true north aligns with “up” on the
screen/map/grid.

For many other projections, though, “up” on the screen/map/grid does not
align with true north. In fact, depending on the projection and location,
“up” may be toward the south!

So, again as a question and comment … is ROTATION relative to the screen
or to the underlying map rotation? To get the vector to be properly rotated
with respect to true north and underlying land masses (and not screen “up”),
it would need to be relative to the underlying projection, not the screen.

I am currently working on this aspect myself … and am finding myself
needing to calculate the Grid Convergence Angle at each point … where I
will be able to know how far off the “up” axis at that point is from true
north. I will then have to account for that angle and add it to / subtract
it from the screen ROTATION angle so that my vectors truly show actual
direction when I am using a non-mercator basemap. I had a separate GeoTools
post asking the best way to calculate Grid Convergence Angle … and I am
still working on that.

Does this make sense or are you already compensating for any underlying map
projection which might rotate “up” away from true north? If so, do you mind
sharing how you are accomplishing that?

The idea is to create a specific filter function to complement the
rotation depending on the target project.
It is not super easy but if you are interested in helping out we can
share some additional details with you, let us know…

Thanks again!

  • Mike Grogan

Dear Mike,
long story short, can you share the code you are talking about as I would like to incorporate the grid convergence angle fix into what we are doing?

Looking forward to reading your answer.

Regards,
Simone Giannecchini

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK for more information.

Ing. Simone Giannecchini
@simogeo
Founder/Director

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 333 8128928

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


Sure. I’m not in the office today … so I’ll get it to you at the first of next week. I would welcome your review of it … there may be better ways to do this … but I’ll be happy to submit this to you.

Thanks,

Mike

pointing_north.png

barbs_polar.png

···

On Thu, May 15, 2014 at 2:13 PM, Simone Giannecchini <simone.giannecchini@anonymised.com> wrote:

Dear Mike,
long story short, can you share the code you are talking about as I would like to incorporate the grid convergence angle fix into what we are doing?

Looking forward to reading your answer.

Regards,
Simone Giannecchini

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK for more information.

Ing. Simone Giannecchini
@simogeo
Founder/Director

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 333 8128928

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On Sat, May 3, 2014 at 12:21 AM, Mike Grogan <d.michael.grogan@anonymised.com> wrote:

I have solved this another way as well … I have modified the RasterAsFeatureCollection function to return me the difference (grid convergence angle) in rotation angle from true north as an additional Property (PropertyName) for each returned point.

Actually, I went a good bit further and extended the function to allow me to specify a “u” band, a “v” band, and an x/y skip value. The rendering transformation function then adds properties to the points to give me magnitude, direction to/from, and then “corrected” direction to/from to align my arrows / barbs back relative to true north depending on the projection. It just feels cleaner to have this info coming back directly from the transformation function rather than trying to then apply yet another filter function to get the rotation angle.

So, I have this solved in a prototype in 2 different ways … as a Transformation Function based off of RasterAsFeatureCollection and as a Filter Function as Simone suggested.

If what I have sounds helpful, let me know. I might can work to clean up the code next week where I’m not embarrassed to share it.

I’m not presuming that I have or can do this better than you guys. It’s just a coincidence that I am needing to solve this at the same time Simone’s group is working to solve this … and I might not be able to wait for Simone’s final implementation.

Here are wind barbs shown properly rotated relative to true north (you’ll just have to take my word that they are aligned correctly) that were a result of my custom Rendering Transformation. I am displaying this in a Arctic Polar Stereo projection just to make sure all of my barbs were still aligned properly in relation to true north.

Inline image 1

Have a great weekend!

  • Mike Grogan

On Thu, May 1, 2014 at 4:47 PM, Mike Grogan <d.michael.grogan@anonymised.com> wrote:

I can probably share hopefully soon … but have run into one snag though and maybe could get a pointer? …

How do you figure out the Coordinate Reference System for a geometry that is passed to a Filter Function? They all look like JTS geometries which don’t seem to have CRS info readily available.

For the map I showed in my example, where the source layer was already existing, the Geometry (the_geom) that got passed to my Filter Function seemed to be in screen coordinates … so I went with that and transformed to the same coordinate system as the bounding box given a request width and height.

The geometry from a RasterAsPointCollection geometry, though, doesn’t seem to be working like it does for a “regular” geometry layer. I’m not sure what my coordinates are for those points … what are they based on? Should they be in screen coordinates as well? The same CRS as the underlying raster?

Thanks,

Mike

On Thu, May 1, 2014 at 3:04 AM, Andrea Aime <andrea.aime@anonymised.com> wrote:

Hi Mike,
this one looks good, do you mind sharing the code? Would it be ok to contribute it to GeoTools, or do you
have copyright restrictions of sort?

Cheers
Andrea

On Thu, May 1, 2014 at 3:30 AM, Mike Grogan <d.michael.grogan@anonymised.com> wrote:

Simone,

I made some progress on my own early / rough version of a Filter Function to accomplish this. My test was to dynamically label all U.S. states with an arrow pointing to true north. The underlying SLD placed the arrow and had it aligned to grid / screen “north” (0 degrees), then subtracted off the grid convergence angle at each state centroid with a call to my Filter Function, yielding arrows that appear to point to true north no matter the projection.

The projection below was Arctic Polar Stereographic… / EPSG:3995.

Again, I will be interested to compare with your approach … you can e-mail me separately if you want to discuss that further (per previous e-mail). I have an ongoing project for which I need this pretty soon, so I am trying to forge ahead on my own version.

Thanks,

Mike Grogan


“Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos. Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free.”
http://p.sf.net/sfu/SauceLabs


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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


Inline image 1

On Wed, Apr 30, 2014 at 12:07 PM, Mike Grogan <d.michael.grogan@anonymised.com> wrote:

I am interested to the point that I can help out, but don’t want to make promises beyond my capacity to help you guys … that might just slow you down. Let me know how you think I might be able to help. At the very least, perhaps running some of my own test data through a nightly build or something and providing some feedback.

In the interim, I am working a mod to the RasterAsPointCollection rendering transformation that might provide me with similar functionality to see where that takes me for my immediate need.

Thanks again,

Mike

On Tue, Apr 29, 2014 at 1:35 PM, Simone Giannecchini <simone.giannecchini@anonymised.com> wrote:

Dear Mike,
please, read below…

Regards,
Simone Giannecchini

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.

Ing. Simone Giannecchini
@simogeo
Founder/Director

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 333 8128928

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On Mon, Apr 28, 2014 at 10:25 PM, Mike Grogan
<d.michael.grogan@anonymised.com> wrote:

Simone,

As you might can tell from some of my recent posts, I am a meteorologist
focused primarily on meteorological data systems, so I am glad to see your
ongoing focus in that area. Particularly, I was excited to see details
about wind barbs on your blog:

http://www.geo-solutions.it/blog/developers-corner-supporting-wind-barbs-geoserver-geotools/

and I have been working with the RasterAsPointCollection transformation for
some time as shown here:

http://geoserver.geo-solutions.it/edu/en/wps/rendering_tx.html#point-extraction

I do want to raise one concern and/or question about the “Rotation” angle
for the Mark used to symbolize the vector.

From a scientific perspective, we want the arrow or vector to point TOWARD
the direction wind is blowing, right, and conversely the barb to point in
the direction FROM which the wind is blowing.

This is something we are going to take into account for the work we are doing.
It is going to be available tomorrow, but let’s say before the end of
May it should be available at least on Master.

However, doesn’t the ROTATION parameter for the mark (arrow, barb, etc.)
only impact rotation of the mark within screen coordinates? In other words,
doesn’t it just rotate a mark by a certain angle on the screen, without
respect to the underlying map projection?

If so, then the arrows or barbs displayed would only be valid for maps with
a Mercator projection, where true north aligns with “up” on the
screen/map/grid.

For many other projections, though, “up” on the screen/map/grid does not
align with true north. In fact, depending on the projection and location,
“up” may be toward the south!

So, again as a question and comment … is ROTATION relative to the screen
or to the underlying map rotation? To get the vector to be properly rotated
with respect to true north and underlying land masses (and not screen “up”),
it would need to be relative to the underlying projection, not the screen.

I am currently working on this aspect myself … and am finding myself
needing to calculate the Grid Convergence Angle at each point … where I
will be able to know how far off the “up” axis at that point is from true
north. I will then have to account for that angle and add it to / subtract
it from the screen ROTATION angle so that my vectors truly show actual
direction when I am using a non-mercator basemap. I had a separate GeoTools
post asking the best way to calculate Grid Convergence Angle … and I am
still working on that.

Does this make sense or are you already compensating for any underlying map
projection which might rotate “up” away from true north? If so, do you mind
sharing how you are accomplishing that?

The idea is to create a specific filter function to complement the
rotation depending on the target project.
It is not super easy but if you are interested in helping out we can
share some additional details with you, let us know…

Thanks again!

  • Mike Grogan

On Fri, May 16, 2014 at 11:09 AM, Mike Grogan <d.michael.grogan@anonymised.com>wrote:

Sure. I'm not in the office today ... so I'll get it to you at the first
of next week. I would welcome your review of it .... there may be better
ways to do this ... but I'll be happy to submit this to you.

Thanks,

Mike

On Thu, May 15, 2014 at 2:13 PM, Simone Giannecchini <
simone.giannecchini@anonymised.com> wrote:

Dear Mike,
long story short, can you share the code you are talking about as I would
like to incorporate the grid convergence angle fix into what we are
doing?

Looking forward to reading your answer.

Regards,
Simone Giannecchini

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK for
more information.

Ing. Simone Giannecchini
@simogeo
Founder/Director

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 333 8128928

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Ciao Mike,
don’t overestimate my skills :slight_smile:

Thanks for sharing, I’ll wait for your ping.

pointing_north.png

barbs_polar.png

···

Regards,
Simone Giannecchini

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK for more information.

Ing. Simone Giannecchini
@simogeo
Founder/Director

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 333 8128928

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On Fri, May 16, 2014 at 5:09 PM, Mike Grogan <d.michael.grogan@anonymised.com> wrote:

Sure. I’m not in the office today … so I’ll get it to you at the first of next week. I would welcome your review of it … there may be better ways to do this … but I’ll be happy to submit this to you.

Thanks,

Mike

On Thu, May 15, 2014 at 2:13 PM, Simone Giannecchini <simone.giannecchini@anonymised.com> wrote:

Dear Mike,
long story short, can you share the code you are talking about as I would like to incorporate the grid convergence angle fix into what we are doing?

Looking forward to reading your answer.

Regards,
Simone Giannecchini

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK for more information.

Ing. Simone Giannecchini
@simogeo
Founder/Director

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 333 8128928

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On Sat, May 3, 2014 at 12:21 AM, Mike Grogan <d.michael.grogan@anonymised.com> wrote:

I have solved this another way as well … I have modified the RasterAsFeatureCollection function to return me the difference (grid convergence angle) in rotation angle from true north as an additional Property (PropertyName) for each returned point.

Actually, I went a good bit further and extended the function to allow me to specify a “u” band, a “v” band, and an x/y skip value. The rendering transformation function then adds properties to the points to give me magnitude, direction to/from, and then “corrected” direction to/from to align my arrows / barbs back relative to true north depending on the projection. It just feels cleaner to have this info coming back directly from the transformation function rather than trying to then apply yet another filter function to get the rotation angle.

So, I have this solved in a prototype in 2 different ways … as a Transformation Function based off of RasterAsFeatureCollection and as a Filter Function as Simone suggested.

If what I have sounds helpful, let me know. I might can work to clean up the code next week where I’m not embarrassed to share it.

I’m not presuming that I have or can do this better than you guys. It’s just a coincidence that I am needing to solve this at the same time Simone’s group is working to solve this … and I might not be able to wait for Simone’s final implementation.

Here are wind barbs shown properly rotated relative to true north (you’ll just have to take my word that they are aligned correctly) that were a result of my custom Rendering Transformation. I am displaying this in a Arctic Polar Stereo projection just to make sure all of my barbs were still aligned properly in relation to true north.

Inline image 1

Have a great weekend!

  • Mike Grogan

On Thu, May 1, 2014 at 4:47 PM, Mike Grogan <d.michael.grogan@anonymised.com> wrote:

I can probably share hopefully soon … but have run into one snag though and maybe could get a pointer? …

How do you figure out the Coordinate Reference System for a geometry that is passed to a Filter Function? They all look like JTS geometries which don’t seem to have CRS info readily available.

For the map I showed in my example, where the source layer was already existing, the Geometry (the_geom) that got passed to my Filter Function seemed to be in screen coordinates … so I went with that and transformed to the same coordinate system as the bounding box given a request width and height.

The geometry from a RasterAsPointCollection geometry, though, doesn’t seem to be working like it does for a “regular” geometry layer. I’m not sure what my coordinates are for those points … what are they based on? Should they be in screen coordinates as well? The same CRS as the underlying raster?

Thanks,

Mike

On Thu, May 1, 2014 at 3:04 AM, Andrea Aime <andrea.aime@anonymised.com> wrote:

Hi Mike,
this one looks good, do you mind sharing the code? Would it be ok to contribute it to GeoTools, or do you
have copyright restrictions of sort?

Cheers
Andrea

On Thu, May 1, 2014 at 3:30 AM, Mike Grogan <d.michael.grogan@anonymised.com> wrote:

Simone,

I made some progress on my own early / rough version of a Filter Function to accomplish this. My test was to dynamically label all U.S. states with an arrow pointing to true north. The underlying SLD placed the arrow and had it aligned to grid / screen “north” (0 degrees), then subtracted off the grid convergence angle at each state centroid with a call to my Filter Function, yielding arrows that appear to point to true north no matter the projection.

The projection below was Arctic Polar Stereographic… / EPSG:3995.

Again, I will be interested to compare with your approach … you can e-mail me separately if you want to discuss that further (per previous e-mail). I have an ongoing project for which I need this pretty soon, so I am trying to forge ahead on my own version.

Thanks,

Mike Grogan


“Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos. Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free.”
http://p.sf.net/sfu/SauceLabs


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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


Inline image 1

On Wed, Apr 30, 2014 at 12:07 PM, Mike Grogan <d.michael.grogan@anonymised.com> wrote:

I am interested to the point that I can help out, but don’t want to make promises beyond my capacity to help you guys … that might just slow you down. Let me know how you think I might be able to help. At the very least, perhaps running some of my own test data through a nightly build or something and providing some feedback.

In the interim, I am working a mod to the RasterAsPointCollection rendering transformation that might provide me with similar functionality to see where that takes me for my immediate need.

Thanks again,

Mike

On Tue, Apr 29, 2014 at 1:35 PM, Simone Giannecchini <simone.giannecchini@anonymised.com> wrote:

Dear Mike,
please, read below…

Regards,
Simone Giannecchini

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.

Ing. Simone Giannecchini
@simogeo
Founder/Director

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 333 8128928

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On Mon, Apr 28, 2014 at 10:25 PM, Mike Grogan
<d.michael.grogan@anonymised.com> wrote:

Simone,

As you might can tell from some of my recent posts, I am a meteorologist
focused primarily on meteorological data systems, so I am glad to see your
ongoing focus in that area. Particularly, I was excited to see details
about wind barbs on your blog:

http://www.geo-solutions.it/blog/developers-corner-supporting-wind-barbs-geoserver-geotools/

and I have been working with the RasterAsPointCollection transformation for
some time as shown here:

http://geoserver.geo-solutions.it/edu/en/wps/rendering_tx.html#point-extraction

I do want to raise one concern and/or question about the “Rotation” angle
for the Mark used to symbolize the vector.

From a scientific perspective, we want the arrow or vector to point TOWARD
the direction wind is blowing, right, and conversely the barb to point in
the direction FROM which the wind is blowing.

This is something we are going to take into account for the work we are doing.
It is going to be available tomorrow, but let’s say before the end of
May it should be available at least on Master.

However, doesn’t the ROTATION parameter for the mark (arrow, barb, etc.)
only impact rotation of the mark within screen coordinates? In other words,
doesn’t it just rotate a mark by a certain angle on the screen, without
respect to the underlying map projection?

If so, then the arrows or barbs displayed would only be valid for maps with
a Mercator projection, where true north aligns with “up” on the
screen/map/grid.

For many other projections, though, “up” on the screen/map/grid does not
align with true north. In fact, depending on the projection and location,
“up” may be toward the south!

So, again as a question and comment … is ROTATION relative to the screen
or to the underlying map rotation? To get the vector to be properly rotated
with respect to true north and underlying land masses (and not screen “up”),
it would need to be relative to the underlying projection, not the screen.

I am currently working on this aspect myself … and am finding myself
needing to calculate the Grid Convergence Angle at each point … where I
will be able to know how far off the “up” axis at that point is from true
north. I will then have to account for that angle and add it to / subtract
it from the screen ROTATION angle so that my vectors truly show actual
direction when I am using a non-mercator basemap. I had a separate GeoTools
post asking the best way to calculate Grid Convergence Angle … and I am
still working on that.

Does this make sense or are you already compensating for any underlying map
projection which might rotate “up” away from true north? If so, do you mind
sharing how you are accomplishing that?

The idea is to create a specific filter function to complement the
rotation depending on the target project.
It is not super easy but if you are interested in helping out we can
share some additional details with you, let us know…

Thanks again!

  • Mike Grogan

Simone,

My code is attached for your use or review in GeoServer ... typical no
warranty expressed or implied kind of thing applies to this ... as I am
submitting this just to show how I have solved the problem so far. So, no
guarantees that this is suitable for your purposes.

At the heart of all of this is the GridConvergenceAngleCalc, which is used
to calculate the grid convergence angle and uses the geodetic calculator
underneath.

The RasterAsUVPointCollection class is my version of
your RasterAsPointCollectionProcess that I modified to determine and return
a lot of the magnitude, direction, and screen angles as precalculated
attributes attached to the return points. Instead of inner classes, I
broke out the feature collection and feature iterator ... but no reason
they couldn't go back in as inner classes, I don't think. My version also
added in the ability to skip a certain # of points in the x and y
directions ... and this helps A LOT with speeding up rendering when the
raster is very high resolution / very dense. I just change the skip based
on scale denominator in my SLD.

Finally, FilterFunction_GridConvAngle was my very rough start at designing
a FilterFunction to do this, but I was having some issues with the CRS for
the incoming points; sometimes they seemed to be in screen coordinates
which could be transformed to the CRS of the WMS request ... but sometimes
they appeared to stay in the CRS of the underlying source data ... and that
CRS info. was being lost in the JTS Geometry. Any pointers on that would
be helpful. In the meantime, I am going with my RasterAsUVPointCollection
class above as it seems to be fitting my purposes better.

Using the geodetic calculator underneath all of this might be a little slow
with having to instantiate a new one for each point ... but the design of
that class makes that necessary as you have to set the start and end point
in the object before you calculate the azimuth; it's not static.

Please let me know if you have any questions ... I'd certainly like to see
how / if you use this to solve this problem ... any feedback on what I have
supplied ... etc.

Thanks!

- Mike Grogan

On Fri, May 16, 2014 at 1:05 PM, Simone Giannecchini <
simone.giannecchini@anonymised.com> wrote:

Ciao Mike,
don't overestimate my skills :slight_smile:

Thanks for sharing, I'll wait for your ping.

Regards,
Simone Giannecchini

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK for
more information.

Ing. Simone Giannecchini
@simogeo
Founder/Director

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 333 8128928

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

On Fri, May 16, 2014 at 5:09 PM, Mike Grogan <d.michael.grogan@anonymised.com>wrote:

Sure. I'm not in the office today ... so I'll get it to you at the first
of next week. I would welcome your review of it .... there may be better
ways to do this ... but I'll be happy to submit this to you.

Thanks,

Mike

On Thu, May 15, 2014 at 2:13 PM, Simone Giannecchini <
simone.giannecchini@anonymised.com> wrote:

Dear Mike,
long story short, can you share the code you are talking about as I
would like to incorporate the grid convergence angle fix into what we
are doing?

Looking forward to reading your answer.

Regards,
Simone Giannecchini

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK for
more information.

Ing. Simone Giannecchini
@simogeo
Founder/Director

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 333 8128928

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

On Sat, May 3, 2014 at 12:21 AM, Mike Grogan <d.michael.grogan@anonymised.com
> wrote:

I have solved this another way as well .... I have modified the
RasterAsFeatureCollection function to return me the difference (grid
convergence angle) in rotation angle from true north as an additional
Property (PropertyName) for each returned point.

Actually, I went a good bit further and extended the function to allow
me to specify a "u" band, a "v" band, and an x/y skip value. The rendering
transformation function then adds properties to the points to give me
magnitude, direction to/from, and then "corrected" direction to/from to
align my arrows / barbs back relative to true north depending on the
projection. It just feels cleaner to have this info coming back directly
from the transformation function rather than trying to then apply yet
another filter function to get the rotation angle.

So, I have this solved in a prototype in 2 different ways ... as a
Transformation Function based off of RasterAsFeatureCollection and as a
Filter Function as Simone suggested.

If what I have sounds helpful, let me know. I might can work to clean
up the code next week where I'm not embarrassed to share it.

I'm not presuming that I have or can do this better than you guys.
It's just a coincidence that I am needing to solve this at the same time
Simone's group is working to solve this ... and I might not be able to wait
for Simone's final implementation.

Here are wind barbs shown properly rotated relative to true north
(you'll just have to take my word that they are aligned correctly) that
were a result of my custom Rendering Transformation. I am displaying this
in a Arctic Polar Stereo projection just to make sure all of my barbs were
still aligned properly in relation to true north.

...

grid_convergence.zip (16.3 KB)