local_proto.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef V_EXTERNAL_LOCAL_PROTO_H
  2. #define V_EXTERNAL_LOCAL_PROTO_H
  3. #include <gdal.h>
  4. #include <gdal_version.h>
  5. #include <ogr_api.h>
  6. /* define type of input datasource
  7. * as of GDAL 2.2, all functions having as argument a GDAL/OGR dataset
  8. * must use the GDAL version, not the OGR version */
  9. #if GDAL_VERSION_NUM >= 2020000
  10. typedef GDALDatasetH ds_t;
  11. #define ds_getlayerbyindex(ds, i) GDALDatasetGetLayer((ds), (i))
  12. #define ds_close(ds) GDALClose(ds)
  13. #else
  14. typedef OGRDataSourceH ds_t;
  15. #define ds_getlayerbyindex(ds, i) OGR_DS_GetLayer((ds), (i))
  16. #define ds_close(ds) OGR_DS_Destroy(ds)
  17. #endif
  18. struct _options {
  19. struct Option *dsn, *output, *layer, *where;
  20. };
  21. struct _flags {
  22. struct Flag *format, *layer, *tlist, *topo, *list, *override, *proj;
  23. };
  24. /* args.c */
  25. void parse_args(int, char **,
  26. struct _options *, struct _flags*);
  27. /* dsn.c */
  28. char *get_datasource_name(const char *, int);
  29. /* list.c */
  30. void list_formats();
  31. int list_layers(FILE *, const char *, char **, int, int);
  32. void get_table_name(const char *, char **, char **);
  33. /* proj.c */
  34. void check_projection(struct Cell_head *, ds_t, int, char *,
  35. char *, int, int, int);
  36. #endif