Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let GMT honor/check the geometries passed via GMT/OGR or shapefiles #5629

Open
PaulWessel opened this issue Aug 11, 2021 · 7 comments
Open
Assignees
Labels
feature request Request a new feature

Comments

@PaulWessel
Copy link
Member

Description of the desired feature

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

  1. Change the default from line to point if given points
  2. 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.

@PaulWessel PaulWessel added the feature request Request a new feature label Aug 11, 2021
@PaulWessel PaulWessel self-assigned this Aug 11, 2021
@seisman
Copy link
Member

seisman commented Aug 11, 2021

Currently plot and plot3d do not care, but my proposal is that we do a check on geometry and

  1. Change the default from line to point if given points
  2. Give error if user tries to plot points as polygon or line explicitly.

For dataset that has a POINT geometry, if the default is points, how can users explicitly plot the data as lines or polygons?

@PaulWessel
Copy link
Member Author

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?

@seisman
Copy link
Member

seisman commented Aug 11, 2021

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 have no idea about this. Ping @weiji14 and @yohaimagen for comments.

@weiji14
Copy link
Member

weiji14 commented Aug 11, 2021

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 have no idea about this. Ping @weiji14 and @yohaimagen for comments.

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
Copy link
Member

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
Copy link

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.

@PaulWessel
Copy link
Member Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request a new feature
Projects
None yet
Development

No branches or pull requests

5 participants