notes.R

# Development notes ------------------------------------------------------------

# Use function requireNamespace to test if package is installed.

# Functions --------------------------------------------------------------------

# The EPSG family of functions.
#   - epsg_db()
#       generate a dataset of EPSG codes with boundaries and PROJ.4 info.
#       Returns a data.table.
#   - crs_to_epsg()
#       find the associated EPSG codes matching parameters of a CRS object.
#       Returns a data.table.
#
# The epsg.io family of functions.
#   - epsg.io(x)
#       open the epsg.io main page of the EPSG codes.
#
# The GET family of functions.
#   - get_epsg_bbox(x, api).
#       fetch epsg bounds from an API. Returns a spInfo object.
#       clean implementation of function get_bounds.
#
# The score family of functions.
#   - Exact vocabulary to be determined.
#   - score().

# Classes ----------------------------------------------------------------------

# The spBox class.
#   - abstract class from which other classes are derived as supercasses.
#   - should never be used by typical user.
#   - should always be constructed in low-level functions.
#   - slots.
#       - all slots should be virtual classes NullExtent.
#       - proj  : an Extent object, projected bounds, if any. Else, NULL.
#       - wgs84 : an Extent object, WGS84 bounds, as lon/lat. Could be NULL,
#                 but never will be in practice.
#   - methods.
#       - show().
#       - plot().
#       - proj().
#       - wgs84().
#       - is.spBox().
#       * manipulation of the slots themselves is already implemented through
#         the raster package.
#
# The spInfo class.
#   - superclass of the spBox class.
#   - contains a CRS and all relevent information on it.
#   - should have a low-level constructor and a very user-friendly constructor.
#   - slots.
#       - crs : a CRS object.
#       - epsg : a virtual class Nullchar. EPSG code, if any, or NULL.
#       - inherits slots from the spBox class.
#   - methods.
#       - show().
#       - plot(), through the spBox class.
#       - crs().
#       - epsg().
#       - is.spInfo().
#       * no methods are needed for slot epsg, since it's just an integer.
#       * manipulation of the slot crs is already implemented through sp and gdal.
#
# The Geocodes class.
#   - main class of the package.
#   - should have a low-level constructor and a very user-friendly constructor.
#   - superclass of the spInfo class.
#   - contains coordinates, keys and all information on the coordinates.
#   - slots.
#       - coords : a data.table object with two fields 'x' and 'y'.
#       - keys   : a data.table with ncol() = 1 ? A virtual class NullNumChar?
#       - inherits all slots of a spInfo class.
#   - methods.
#       - show().
#       - plot(), harmonizing with the spBox class: BOX + COORDS on map.
#       - coords().
#       - keys().
#       - getters and setters.
#       - subsetters.
#       - all table functions.
#           - dim (gets you nrow and ncol),
#           - t,
#           - dimnames (gets you rownames and colnames),
#           - dimnames<- (gets you colnames<-, rownames<-),
#           - cbind, rbind.
#           - check data.table package also.
#           - format? Check behavior with show().
#       - merge functions.
#       - combines functions.
#       - quick access to x and y fields.
#       - make sure all data.table operations are working properly.
#       - is.Geocodes().
#       - coercion methods: as.SpatialPoints. as.SimpleFeatures, maybe?
#
# The spIndex class.
#   - to be determined, see points below for spSet class.
#   - should probably be a superclass of spInfo.
#
# The spFile, spSet and spDB classes.
#   - structures to be determined.
#   - spFile.
#       - contain all information on one spatial file (shp, tif, etc.).
#       - should probably be a superclass of spInfo.
#   - spSet.
#       - list of many linked spFile objects.
#       - should represent something such a DEM splitted into tiles.
#       - should possess an underlying index.
#       - spIndex formal class for the above point, maybe?
#   - spDB.
#       - list of all available spFile and spSet objects in a location.
#       - should represents a (easy-to-use) spatial data warehouse.
#       - should organize information on existing files to use in algorithms.
#
# * We will probably need a spFiles class to link classes spFile and spSet / spDB.
#
# Notes on methods -------------------------------------------------------------

# Scoring algorithms should be implemented by methods having signatures like
#   - c(x = "Geocodes", y = "spFile"),
#   - c(x = "Geocodes", y = "spSet"),
#   - c(x = "Geocodes", y = "spDB").
#
# Any other methods for objects of packages sp and raster should be implemented
# later if users request it.
jeanmathieupotvin/scr documentation built on Dec. 3, 2019, 8:53 p.m.