Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Differences between polygon and polyline

Tags:

svg

What is the difference between Polygon and Polyline in SVG? I replaced all the dots in those 2 samples and the results were exactly the same (in Google Chrome):

  • http://www.tutorialspoint.com/cgi-bin/practice.cgi?file=html5-17.htm
  • http://www.tutorialspoint.com/cgi-bin/practice.cgi?file=html5-18.htm

Is it just semantic difference without any actual result?

like image 251
Yaakov Shoham Avatar asked Jan 01 '12 19:01

Yaakov Shoham


People also ask

What is the difference between line and Polyline in GIS?

A line is simply a separate line or segment that is not joined to another line. While a Polyline indicates two or more lines have been joined.

What is the difference between line and polygon?

If there are more polygons, each relationship will result in one line. For instance, if two polygons are on the left of a third polygon and share a boundary with it, "polygon to line (with neighbour)" creates two lines.

What is a Polyline shape?

A Polyline object is a shape defined by one or more paths, in which a path is a series of connected segments.

What is a Polyline on a map?

A polyline is a list of points, where line segments are drawn between consecutive points. A polyline has the following properties: Points. The vertices of the line. Line segments are drawn between consecutive points.


1 Answers

Try to add this:

style="fill:yellow;stroke:purple;stroke-width:1"

to both examples , instead of

 fill="red"

and you'll see difference.

Polyline doesn't connect last point to first ! Polygon - always connects last point to the first. Problem was, that line color and fill color were the same.

like image 53
omakoleg Avatar answered Sep 28 '22 02:09

omakoleg