You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Let GMT honor/check the geometries passed via GMT/OGR or shapefiles #5629
See this PyGMT post for details.
Having thought about this some more, it seems reasonable that a dataset that has proper metadata that says the coordinates are points should not default to plotting lines. There is a differences between a plain text file with coordinates (which can mean points, lines or polygons) and a shapefile that says "I am a polygon".
Currently plot and plot3d do not care, but my proposal is that we do a check on geometry and
Change the default from line to point if given points
Give error if user tries to plot points as polygon or line explicitly.
This may affect a few more modules that read table data and expects points.
If we want users to have the ability to override the dataset's geometry, then we would have to have a way for them to say so. Maybe something like -S/ could mean "line symbol" (i.e., no symbol, draw lines).
Does other software allow points to be plotted as lines, e.g., if arcGIS or QGIS reads a points file, is it even possible to draw a polygon? I just wonder if the expectation here is to completely honor the geometry if one is given. If the user wants those points to be plotted as polygons then perhaps gmt convert points.ogr | gmt plot -Gred is the way to do it?
I think Points/MultiPoints are always plotted as points in most GIS software. One would usually need to convert a Point layer explicitly into a Line or Polygon type to plot them as such.
It normally should not make much sense to plot Points as lines, but it's not up to GMT to censor it. Datasets may have inherited the Points/multiPoints geometry from a lost ancestrality.
... and this goes far beyond shapefies. I've called before to the need that datasets all have a geometry, even if unknown.
Does other software allow points to be plotted as lines, e.g., if arcGIS or QGIS reads a points file, is it even possible to draw a polygon?
In Qgis it automatically opens the file as the specified geometry, without the option to specify other geometry. if no geometry is specified it plotting points. I believe the same is for arcGIS.
That is what I would expect; otherwise what is the point of keeping geometry as an attribute. So the question then is should GMT start to enforce this behavior when the geometry is known (i.e., via the shapefile, OGR files)? Or is a warning for now adequate?
Activity
seisman commentedon Aug 11, 2021
For dataset that has a POINT geometry, if the default is points, how can users explicitly plot the data as lines or polygons?
PaulWessel commentedon Aug 11, 2021
If we want users to have the ability to override the dataset's geometry, then we would have to have a way for them to say so. Maybe something like -S/ could mean "line symbol" (i.e., no symbol, draw lines).
Does other software allow points to be plotted as lines, e.g., if arcGIS or QGIS reads a points file, is it even possible to draw a polygon? I just wonder if the expectation here is to completely honor the geometry if one is given. If the user wants those points to be plotted as polygons then perhaps g
mt convert points.ogr | gmt plot -Gredis the way to do it?seisman commentedon Aug 11, 2021
I have no idea about this. Ping @weiji14 and @yohaimagen for comments.
weiji14 commentedon Aug 11, 2021
I think Points/MultiPoints are always plotted as points in most GIS software. One would usually need to convert a Point layer explicitly into a Line or Polygon type to plot them as such.
joa-quim commentedon Aug 12, 2021
It normally should not make much sense to plot Points as lines, but it's not up to GMT to censor it. Datasets may have inherited the Points/multiPoints geometry from a lost ancestrality.
... and this goes far beyond shapefies. I've called before to the need that datasets all have a geometry, even if unknown.
yohaimagen commentedon Aug 12, 2021
In Qgis it automatically opens the file as the specified geometry, without the option to specify other geometry. if no geometry is specified it plotting points. I believe the same is for arcGIS.
PaulWessel commentedon Aug 12, 2021
That is what I would expect; otherwise what is the point of keeping geometry as an attribute. So the question then is should GMT start to enforce this behavior when the geometry is known (i.e., via the shapefile, OGR files)? Or is a warning for now adequate?