-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Proposal: gdal vector geom_op #11826
Comments
I would read I like the "geom_op" syntax for the most needed operations, but is is clear what they are, and which operations will be available only with SQL? The geom_ops would probably work similarly for all datasources and that would help with documenting them. For example geometries can be made valid now with Spatialite by using SQL functions |
they will have to be documented in our gdal.org doc of course. They correspond to OGR_G_xxxxx() functions and for most of them map to GEOS operations.
we do have a METHOD=LINEWORK/STRUCTURE and KEEP_COLLAPSED=YES/NO as options of OGRGeometry::MakeValid(). That can be added as switches to "gdal vector geom_op make_valid" |
LGTM I prefer The SQL alternative looks too complicated to me, probably mostly useful for experienced users. |
Maybe |
transform might potentially be confused with ST_Transform() which is "gdal vector reproject"
distance/area/length sub operations wouldn't, but they might belong to something else, or users just have to use Spatialite SQL. For completness I did look at fiona map but I'm not convinced by the Snuggs syntax which is I believe something totally custom, in-between this proposal and full SQL. |
to extend our set of tools for the new "gdal" (https://gdal.org/en/latest/programs/index.html#gdal-application), there are a number of operations that are supported by ogr2ogr and aren't ported yet
I'm considering a "geom_op" subcommand of "gdal vector", that could also be used as a stage of "gdal vector pipeline". geom_op itself would just be the frontend for several different subsubcommands
All above would support a [--fields=...] to restrict the operation to be applied to one or several geometry fields if there are multiple ones (others would be let unmodifiied)
Does that look good ?
I was wondering about the use of underscore: do we want
geomop
,geom_op
,geom-op
? (knowing that we use dash in option names like--input-format
, etc.)One totally different alternative would be to go through SQL, using Spatialite functions, but that's perhaps less obvious to use (although we'll definitely need a
gdal vector pipeline read ... | sql [--dialect=<name>] <statement> | write ....
for advanced use cases) . The advantage with the above solution is that it can be more easily documented and can benefit from the auto-completion logicCC @dbaston @sgillies @jratike80 @elpaso
The text was updated successfully, but these errors were encountered: