Subscribe to this thread
Home - General / All posts - Spline in 9
joebocop
514 post(s)
#19-Oct-21 20:18

Hey guys, do we have this functionality in 9?

https://georeference.org/doc/transform_spline.htm

I searched and landed on GeomSmooth which seems to do the opposite, and also GeomSegmentize, which doesn't seem to apply any algorithm when adding coords.

Thanks for any pointers.

Dimitri


7,413 post(s)
#20-Oct-21 05:36

No. "Smooth" is really a "simplify", as noted in the topic covering the reshape: smooth transform.

The spline transform is pretty, but splines are not a good fit to how the GIS industry has evolved. So you see less and less of them in GIS. In some cases, even processes that at the root use curvilinear segments, like Esri style traverses, don't even support them. Therefore, using splines tends to be a one-way move away from general purpose GIS and more into Illustrator land, in the sense that you permanently alter the original starting data into a form that is pinned to a particular coordinate system, and also without easy editing in downstream workflow (interactive spline editing is much more demanding of user skills).

9 tends to follow that industry trend, so while it supports splines it doesn't particularly encourage use of them like 8 did. I have mixed feelings about that. I like the visual look of splines and I think it would be nice for people who understand the upsides and downsides to be able to use them more widely if they wanted. But I also understand the chaos their use can cause in downstream workflow and interoperability, especially if you make it easy for an inexperienced operator to throw a million splines into a data set with a single click. Some GIS managers really hate software that provides such one-click functionality, like the 8 spline transform, for that reason.

A better way than the 8 spline transform could be something analogous, but which produced a similar visual effect by utilizing a sequence of small linear segments. You'd then have both the visual appeal as well as compatibility with mainstream GIS practice.

I'd also probably drop the ellipse arc construction, since that's very rarely encountered, and just leave it to circle arcs and spline arcs.

danb

2,064 post(s)
#20-Oct-21 06:57

I agree with everything you say Dimitri, but it is a shame in some ways as used carefully, splines were very useful for final cartographic presentation work. I don't think I ever used this functionality other than in a cartographic context, but I used it quite a bit over the years.


Landsystems Ltd ... Know your land | www.landsystems.co.nz

Dimitri


7,413 post(s)
#20-Oct-21 07:18

That's one of the things I like about 8, that it has a lot of features which are taken from the Photoshop/Illustrator world (love the gaussian blur for drop shadows...) that are great for visuals even if they depart from typical GIS practice. But hey, people do post-processing in Illustrator and tools like Avenza, so why not have that in the GIS as well? All those are in the future for 9, as it is better for raster effects and has more muscle for vector effects than 8.

danb

2,064 post(s)
#20-Oct-21 21:23

Good to hear. It might be useful to have something in the manual about the difference between 'Data' and (cartographic) 'Representation'.

Personally, I am very happy that Manifold is so data focused, but I also believe that both are part of the greater whole.

Such a topic might be a way to reinforce a concept for newer users and allow for such tools side by side in M9.

Support for multiple geoms in a table neatly provides a mechanism allowing both data and a cartographic representations to be maintained in the same table.

I guess within reason, your 'Representation' could be a dynamic computed geom depending upon what it entails.


Landsystems Ltd ... Know your land | www.landsystems.co.nz

Dimitri


7,413 post(s)
#21-Oct-21 09:34

Geoms can handle objects built using any of the allowed segment types, including arcs (curvilinear segments like circle, ellipse, or spline arcs). The reason arcs aren't so good for GIS users isn't that they can't be attached to data just like linear segments, because they can. The main reasons are:

1. Interoperability - Most GIS programs and vector formats can't handle, or have various limitations, on using arcs. Create a drawing that uses arcs and you limit your ability to interchange that drawing with other packages. There are no splines in shapefiles, for example.

2. Projections - A spline is defined by a mathematical formula based on the anchor points it uses. Those anchor points are just XY locations in whatever coordinate system is being used. But a spline that looks like you want in one coordinate system isn't going to look the same way if you simply transform the coordinates for the anchor points into the new coordinate system. Yes, you expect the spline to be visually different in the new coordinate system, but just transforming the anchor points using the formulae that are used to define coordinate system transformations doesn't get it right. There's a very big world of coordinate system transformations (NTv2, EPSG, etc) that are not a good fit to reshaping things like splines.

There are smaller reasons such as various epsilon considerations to decide when, for example, two splines or other curvilinear arcs intersect, etc.

But the upshot is that when you start using curvilinear segments, you tend to get away from the interoperability and re-projectability that people expect in GIS, and you also tend to get away from being able to use the algorithms that work with classic GIS linear segments for things like topology overlays and other spatial manipulations. There are ways of getting around that, for example, rewriting code to always interpolate splines and such into a sequence of very many linear segments, but then you're not really using or preserving splines.

lionel

995 post(s)
#20-Oct-21 22:58

I understand that a mapping software does not need tools like bezier curves ( geometry cad) but it allows to use Manifold in many areas. IT like Adobe Fireworks that support raster and Vector . People could buy manifold to only use the SQL editor ( should be enhance) or have a swiss knife tool to have acces to many vector/ raster / database file/Server !

All the transformations use until PAnel Transform ( SQL Frontend ) rather than menu find in photoshop or Illlustrator but i like the both way and programming is more easy with manifold !


Book about Science , cosmological model , Interstellar travels

Boyle surface fr ,en

Sloots

678 post(s)
#21-Oct-21 14:30

For those who want to use a kind of spline function (like I do) see the attached map file.

With a little bit of C# lines and areas can be splined easily. The level parameter tells the function how deep the recursion proces should go. 3 is more than enough.

Have fun,

Chris

Attachments:
Spline.mxb


http://www.mppng.nl/manifold/pointlabeler

Mike Pelletier

2,122 post(s)
#21-Oct-21 15:25

Chris is the solution guy! Thanks for sharing that :-)

Splining is useful for maps, greeting cards, etc. Agree with Lionel about hoping Mfd can eventually become a Swiss Army knife like software.

danb

2,064 post(s)
#21-Oct-21 21:14

+1 to that. Great script Chris and thanks for sharing.

You have posted some neat examples for M9 and I am always pleasantly surprised how straightforward the code is once I see the examples. I wish I had the smarts to do this sort of stuff, but your examples are a great start


Landsystems Ltd ... Know your land | www.landsystems.co.nz

Dimitri


7,413 post(s)
#21-Oct-21 16:15

A very nice script, especially so since it gives spline-like effects but using a sequence of linear segments. Super!

danb

2,064 post(s)
#21-Oct-21 21:16

Is this spoked representation more palatable as something that could be added? I know ... suggestions are your friend


Landsystems Ltd ... Know your land | www.landsystems.co.nz

Dimitri


7,413 post(s)
#22-Oct-21 04:49

It's something I'd like to see added. In the meantime, Sloots' script could be made into an add-in.

joebocop
514 post(s)
#10-Nov-21 19:59

Can't believe how well this works, thank you so much.

lionel

995 post(s)
#07-Dec-21 10:28

I Really like the code. Even that i could study it myself , what the purpose of 0,25 and level ( that go to 3 to 0) in the result drawing ( number of points and lines) ? sometime we see bezier curve in realtime but ask how location of point is place on each line even i understand that more we go to the end ( time for draw each point on the line) more the location of the point on the line is place near the end of the line .

What is shure is that curve don't really exist, all is a matter of precision, all is in final list of lines.

It is really strange that C# default library don't have Point in double like manifold Point. Microsoft use float ( in System.Drawing PointF.X=32.012f f mean float litteral ! and must be use explicitly , cast don't work with 32.012) and and int ( Point.X=32 no letter in the end so if by default int).In away shapefile for point coordinnate (refer to specification ) use double or integer and for web svg commonly use 3 numbers after the point ( x,yyy ).

it is also strange that decimal ( with m in the end to use more bytes than f=float) never use for Point in gis !! has many context :

- angle mesure 1(decimal) rad = ( + north east) 180°/π

- int num = 12 ( decimal) = 0xC ( hexadecimal) = 0b1100 ( binary) ;

- Sytem.Decimal compare System.double and System.Single ( float) and System.Int32 (alias int )

so var has different type in

var a = 1m;

Console.WriteLine($"a.type= : {a.GetType()}");

var b = 1f;

Console.WriteLine($"b.type= : {b.GetType()}");

var c = 1;

Console.WriteLine($"c.type= : {c.GetType()}");

Attachments:
spline.png


Book about Science , cosmological model , Interstellar travels

Boyle surface fr ,en

lionel

995 post(s)
#07-Dec-21 10:50

1) i think use 3 mean add 6 points each time ( Pn and Pn+1).

2) I don't know wich logic is use in spline code to trace the point and so the line beetween the point (ender by manifold) . Since i need to update my SVG2WKT C#code .....i need to convert all svg Bezier line and need to understand better spline logic script !

I know that svg use 4 : Cuvre ( C) , Smooth Curve ( S) , Quadratic (Q) and Smooth Quadratic ( T)

3)Is there a gis library for compute gis data for free ?

Thank's

The spline.map contain from the main drawing many drawings that show points and lines before and after the spline is apply.

Bézier Curve. Understand the mathematics of Bézier… | by Omar Aflak | Towards Data Science

Attachments:
Spline.map


Book about Science , cosmological model , Interstellar travels

Boyle surface fr ,en

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.