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

Make gdalinfo/ogrinfo --formats -json work #10881

Merged
merged 1 commit into from
Oct 5, 2024

Conversation

rouault
Copy link
Member

@rouault rouault commented Sep 26, 2024

Fixes #10878

Note: only available in utilities-as-binaries, not utilities-as-libraries...

Returns drivers in the order of their registration.

Example

$ gdalinfo --formats -json
[
  {
    "short_name":"VRT",
    "long_name":"Virtual Raster",
    "scopes":[
      "raster",
      "multidimensional_raster"
    ],
    "capabilities":[
      "open",
      "create",
      "create_copy",
      "virtual_io"
    ],
    "file_extensions":[
      "vrt"
    ]
  },
  ...
]
$ ogrinfo --formats -json
[
  {
    "short_name":"FITS",
    "long_name":"Flexible Image Transport System",
    "scopes":[
      "raster",
      "vector"
    ],
    "capabilities":[
      "open",
      "create"
    ],
    "file_extensions":[
      "fits"
    ]
  },
  ...
]

@rouault rouault added this to the 3.10.0 milestone Sep 26, 2024
@rouault rouault force-pushed the gdalinfo_ogrinfo_formats_json branch from 1777d26 to 917479a Compare September 26, 2024 17:29
@rouault
Copy link
Member Author

rouault commented Sep 26, 2024

Note there is no way to get all drivers (raster & vector) at once. Nothing technical here, just that traditionally gdalinfo --formats reports drivers with raster capabilities, and ogrinfo --formats with vector capabilities. I kept the same logic for consistency

@rouault rouault force-pushed the gdalinfo_ogrinfo_formats_json branch from 917479a to 926a24b Compare September 26, 2024 17:32
Fixes OSGeo#10878

Note: only available in utilities-as-binaries, not
utilities-as-libraries...

Returns drivers in the order of their registration.

Example
```shell
$ gdalinfo --formats -json
[
  {
    "short_name":"VRT",
    "long_name":"Virtual Raster",
    "scopes":[
      "raster",
      "multidimensional_raster"
    ],
    "capabilities":[
      "open",
      "create",
      "create_copy",
      "virtual_io"
    ],
    "file_extensions":[
      "vrt"
    ]
  },
  ...
]
```

```shell
$ ogrinfo --formats -json
[
  {
    "short_name":"FITS",
    "long_name":"Flexible Image Transport System",
    "scopes":[
      "raster",
      "vector"
    ],
    "capabilities":[
      "open",
      "create"
    ],
    "file_extensions":[
      "fits"
    ]
  },
  ...
]
```
@rouault rouault force-pushed the gdalinfo_ogrinfo_formats_json branch from 926a24b to f4766b1 Compare September 26, 2024 17:58
@rouault rouault merged commit 9b44a75 into OSGeo:master Oct 5, 2024
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gdalinfo --formats -json
1 participant