ThinkGeo.com    |     Documentation    |     Premium Support

Connect different points with curved line

Hi

I am working on an application which displays Weather Jetstream.
In that I am connecting a group of points together and displaying winds on top it.

Here my requirement is I wanted to show connected points as a Curved line. But I am able to draw only straight lines.

Please look at following image for ref.

Right now i am getting like this

But, I need like this… .

I think it is called as cubic spline.

Please provide me is there any code available. Or guide me how to do it.

Thanks
Ashok

Hi Ashok,

I think this topic as below should be helpful.

Regards,

Don

Hi Don,

Thanks for your reply… It looks like the above given post is just for drawing an arc or curve based on some angle/radius. But I want to connect the points just like how they are directing to…

I didn’t mean exactly curved. I mean to say i wanted to join the points but it should not be straight lines. it should have some smoothning as I shown in above pencil diagram.

Thank you…
Ashok

Hi Ashok,

Currently, we have no sample for that.

I find a sample for Cubic Spline Interpolation, please refer to https://www.codeproject.com/articles/560163/csharp-cubic-spline-interpolation . it seems to be what we want.

  1. we learn this sample to create a interpolation logic to make the line more smooth.

  2. Then we will create a customstyle inherit from LineStyle, and use the logic from 1 to get smooth line then draw it. here is a sample shows create a customstyle: http://wiki.thinkgeo.com/wiki/source_code_wpfdesktopeditionsample_multilinelabeling_cs_110316.zip

I guess a point we need to pay attention to here: the projection.
here is a sample shows that
http://wiki.thinkgeo.com/wiki/map_suite_wpf_desktop_edition_all_samples#great_circle_with_google_map
I think we need draw the line as above sample. because the position of any point on the line is match the position on the earth, at the same time i think the line is the shortest path between two point on the earth.I don’t know what projection you use, above is for reference only.

Thanks,
Emil

Hi Emil,

Thanks for your great post. I have tried Cubic Spline Interpolation example which you posted above…

Its working out well… Thank you once again


Ashok

Hi Ashok,

I am glad to hear that works.

Any question please let us know.

Thanks
Emil