Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
dev:gisapi [2008/08/06 16:06] richard |
dev:gisapi [2009/07/06 20:36] (current) |
||
---|---|---|---|
Line 77: | Line 77: | ||
- | ==== GSoC Interfaces (Under Developement) | + | |
+ | |||
+ | ====== GSoC Interfaces (Under Developement) | ||
The Following is implemented in / | The Following is implemented in / | ||
- | === GIS key values === | + | ===== GIS key values |
Key values to use when passing associative key arrays in ' | Key values to use when passing associative key arrays in ' | ||
Line 101: | Line 103: | ||
|' | |' | ||
|' | |' | ||
+ | |' | ||
+ | |' | ||
+ | |' | ||
- | === Code for key values === | ||
- | | + | ==== Code for key values ==== |
+ | |||
+ | | ||
' | ' | ||
' | ' | ||
Line 118: | Line 124: | ||
' | ' | ||
' | ' | ||
- | ' | + | ' |
+ | ' | ||
+ | ' | ||
+ | ' | ||
); | ); | ||
- | === Database interfaces === | + | Alternately when asking for keys you can just use |
- | **Feature Related** | + | $keys = array(' |
- | * shn_gis_create_feature($keys_) | + | To retrieve all the fields eg: |
- | * Creates GIS feature from array of associative keys see above. | + | |
- | * shn_gis_remove_feature($feature_uuid_) | + | |
- | * Removes a feature, associated metadata data and feature_to_layer refs. | + | |
- | * shn_gis_remove_feature_module_item($f_module_item_) **External modules will use this function Especially** | + | |
- | * Removes a feature, associated metadata data and feature_to_layer refs useing external module item uuid. | + | |
- | * shn_gis_modify_feature($uuid_, | + | |
- | * Modifys a GIS feature from array of associative keys see above. | + | |
- | * shn_gis_modify_feature_module_item($f_module_item_, | + | |
- | * Modifys a GIS feature from array of associative keys see above (uses f_module_item_ as uuid to search for entry). | + | |
- | **Feature Gets** | + | $keys = array(' |
+ | shn_gis_get_features_uuid(' | ||
- | * shn_gis_get_features_uuid($uuid_, | ||
- | * returns features corresponding to the features uuid | ||
- | * shn_gis_get_features_item_ref($item_uuid_, | ||
- | * returns a multidimensional array containing all fields specified by keys of all features with a f_module_item refrerence uuid = $item_uuid. | ||
- | * shn_gis_get_features_all($keys_) | ||
- | * returns a multidimensional array containing all fields specified by keys of all features. | ||
- | * shn_gis_get_features_feature_class($class_uuid_, | ||
- | * returns a multidimensional array containing all fields specified by keys of all features in class specified by $class_uuid_. | ||
- | * shn_gis_get_features_layer($layer_uuid_, | ||
- | * returns a multidimensional array containing all fields specified by keys of all features in layer specified by $layer_uuid_. | ||
- | * shn_gis_get_features_other($keys_, | ||
- | * returns a multidimensional array containing all fields specified by keys of all features using other atts as search values. | ||
- | To ignore any of the attributes in the search enter $att = '' | ||
- | **Feature Class Related** | + | ===== Database interfaces ===== |
- | * shn_gis_create_feature_class($module_ref_, | + | ==== Feature |
- | * Creates a new feature_class. | + | |
- | * shn_gis_remove_feature_class($feature_class_uuid_, | + | |
- | * opt 1 - Fail if features exist with this feature class otherwise remove. | + | |
- | * opt 2 - Remove feature class and set existing features with feature_class_uuid to default class. | + | |
- | * opt 3 - Remove existing feature with this class then remove class. | + | |
- | * default - use opt 1 | + | |
- | * shn_gis_modify_feature_class($uuid_, | + | |
- | * Modifys a Feature | + | |
- | * shn_gis_get_feature_class_all() | + | |
- | * Returns all feature classes in the system. | + | |
- | * shn_gis_get_feature_class_uuid($feature_class_uuid_) | + | |
- | * returns data about a feature class (see code for more details) | + | |
+ | === Creating a Feature === | ||
- | **Layer Related** | + | ... |
+ | shn_gis_create_feature($keys_) | ||
+ | ... | ||
+ | |||
+ | Creates GIS feature from array of associative keys see above. | ||
+ | \\ | ||
+ | |||
+ | === Removing a Feature === | ||
+ | |||
+ | ... | ||
+ | shn_gis_remove_feature($feature_uuid_) | ||
+ | ... | ||
+ | |||
+ | Removes a feature, associated metadata data and feature_to_layer refs. | ||
+ | \\ | ||
+ | |||
+ | === Removing a Feature using an external module item as a refrence [External modules are especially likely to use this function] === | ||
+ | |||
+ | ... | ||
+ | shn_gis_remove_feature_module_item($f_module_item_) | ||
+ | ... | ||
+ | |||
+ | Removes a feature, associated metadata data and feature_to_layer refs useing external module item uuid. | ||
+ | \\ | ||
+ | |||
+ | === Modifying A Feature === | ||
+ | |||
+ | ... | ||
+ | shn_gis_modify_feature($uuid_, | ||
+ | ... | ||
+ | |||
+ | Modifys a GIS feature from array of associative keys see above. | ||
+ | \\ | ||
+ | |||
+ | === Modifying A Feature using an external module item as a refrence [External modules are especially likely to use this function] === | ||
+ | |||
+ | ... | ||
+ | shn_gis_modify_feature_module_item($f_module_item_, | ||
+ | ... | ||
+ | |||
+ | Modifys a GIS feature from array of associative keys see above (uses f_module_item_ as uuid to search for entry). | ||
+ | \\ | ||
+ | |||
+ | |||
+ | ==== Feature Gets ==== | ||
+ | |||
+ | === By Feature UUID === | ||
+ | |||
+ | ... | ||
+ | shn_gis_get_features_uuid($uuid_, | ||
+ | ... | ||
+ | |||
+ | returns features corresponding to the features uuid | ||
+ | \\ | ||
+ | |||
+ | === By External Module Item UUID [External modules are especially likely to use this function] === | ||
+ | |||
+ | ... | ||
+ | shn_gis_get_features_item_ref($item_uuid_, | ||
+ | ... | ||
+ | |||
+ | returns a multidimensional array containing all fields specified by keys of all features with a f_module_item refrerence uuid = $item_uuid. | ||
+ | \\ | ||
+ | |||
+ | === Get All Features === | ||
+ | |||
+ | ... | ||
+ | shn_gis_get_features_all($keys_) | ||
+ | ... | ||
+ | |||
+ | returns a multidimensional array containing all fields specified by keys of all features. | ||
+ | \\ | ||
+ | |||
+ | === Get Features Belonging To A Particular Feature Class === | ||
+ | |||
+ | ... | ||
+ | shn_gis_get_features_feature_class($class_uuid_, | ||
+ | ... | ||
+ | |||
+ | returns a multidimensional array containing all fields specified by keys of all features in class specified by $class_uuid_. | ||
+ | \\ | ||
+ | |||
+ | === Get Features Belonging To A Particular Layer === | ||
+ | |||
+ | ... | ||
+ | shn_gis_get_features_layer($layer_uuid_, | ||
+ | ... | ||
+ | |||
+ | returns a multidimensional array containing all fields specified by keys of all features in layer specified by $layer_uuid_. | ||
+ | \\ | ||
+ | |||
+ | === Get Features Within A Radius Of A Particular Point === | ||
+ | |||
+ | ... | ||
+ | shn_gis_get_features_in_radius($keys_, | ||
+ | ... | ||
+ | |||
+ | Returns an array of all the features within the radius specified by $radius_ of the point specified by $lat_ and $lon_. ($keys for which fields to return) | ||
+ | \\ | ||
+ | |||
+ | === Specific Search useng a number of values === | ||
+ | |||
+ | ... | ||
+ | shn_gis_get_features_other($keys_, | ||
+ | ... | ||
+ | |||
+ | returns a multidimensional array containing all fields specified by keys of all features using other atts as search values. To ignore any of the attributes in the search enter $att = '' | ||
+ | \\ | ||
+ | |||
+ | |||
+ | |||
+ | ==== Feature Class Related ==== | ||
+ | |||
+ | === Create a New Feature Class === | ||
+ | ... | ||
+ | shn_gis_create_feature_class($module_ref_, | ||
+ | ... | ||
+ | |||
+ | Creates a new feature_class. \\ \\ | ||
+ | |||
+ | ** NOTE: This function will be recoded in the near future to take a key entry of values such **:\\ | ||
+ | |||
+ | ... | ||
+ | $keys = array( | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ); | ||
+ | |||
+ | shn_gis_create_feature_class($keys) | ||
+ | ... | ||
+ | |||
+ | |||
+ | \\ | ||
+ | |||
+ | === Remove a Feature Class === | ||
+ | |||
+ | ... | ||
+ | shn_gis_remove_feature_class($feature_class_uuid_, | ||
+ | ... | ||
+ | |||
+ | * opt 1 - Fail if features exist with this feature class otherwise remove. | ||
+ | * opt 2 - Remove feature class and set existing features with feature_class_uuid to default class. | ||
+ | * opt 3 - Remove existing feature with this class then remove class. | ||
+ | * default - use opt 1 | ||
+ | |||
+ | If you are building this into a module be carfull not to remove any feature classes that are registored to another module (they will have $module_ref_ set). | ||
+ | \\ | ||
+ | |||
+ | === Modify A Feature Class === | ||
+ | |||
+ | ... | ||
+ | shn_gis_modify_feature_class($uuid_, | ||
+ | ... | ||
+ | |||
+ | Modifys a Feature Class, Enter new values as key value. | ||
+ | \\ | ||
+ | |||
+ | === Return All The Feature Classes === | ||
+ | |||
+ | ... | ||
+ | shn_gis_get_feature_class_all() | ||
+ | ... | ||
+ | |||
+ | Returns all feature classes in the system. | ||
+ | \\ | ||
+ | |||
+ | === Return A Feature Class by its UUID === | ||
+ | |||
+ | ... | ||
+ | shn_gis_get_feature_class_uuid($feature_class_uuid_) | ||
+ | ... | ||
+ | |||
+ | Returns data about a feature class (see code for more details). | ||
+ | \\ | ||
+ | |||
+ | |||
+ | ==== Layer Related | ||
+ | |||
+ | === Create A New Layer === | ||
+ | ... | ||
+ | shn_gis_create_layer($name_, | ||
+ | ... | ||
+ | |||
+ | Creates a new layer\\ \\ | ||
+ | |||
+ | ** NOTE: This function will be recoded in the near future to take a key entry of values such **:\\ | ||
+ | |||
+ | ... | ||
+ | $keys = array( | ||
+ | ' | ||
+ | ' | ||
+ | ); | ||
+ | |||
+ | shn_gis_create_layer($keys) | ||
+ | ... | ||
+ | |||
+ | \\ | ||
+ | |||
+ | === Remove A Layer === | ||
+ | |||
+ | ... | ||
+ | shn_gis_remove_layer($layer_uuid_, | ||
+ | ... | ||
+ | |||
+ | * opt 1 - Fail if features exist within this layer otherwise remove. | ||
+ | * opt 2 - Remove layer and references only. | ||
+ | * opt 3 - Remove layer, layer references and all features that are in this layer. | ||
+ | * default - use opt 1 | ||
+ | \\ | ||
+ | |||
+ | === Add Features To A Layer === | ||
+ | |||
+ | ... | ||
+ | shn_gis_insert_layer_features($layer_uuid_, | ||
+ | ... | ||
+ | |||
+ | Add tie between a number of features and a layer. | ||
+ | \\ | ||
+ | |||
+ | === Remove Features From A Layer === | ||
+ | |||
+ | ... | ||
+ | shn_gis_remove_layer_features($layer_uuid_, | ||
+ | ... | ||
+ | |||
+ | Removes tie between a number of features and a layer. | ||
+ | \\ | ||
+ | |||
+ | === Add A Feature Class To A Layer === | ||
+ | |||
+ | ... | ||
+ | shn_gis_insert_layer_feature_class($layer_uuid_, | ||
+ | ... | ||
+ | |||
+ | Add tie between a number of feature_classes and a layer. | ||
+ | \\ | ||
+ | |||
+ | === Remove A Feature Class From A Layer === | ||
+ | |||
+ | ... | ||
+ | shn_gis_remove_layer_feature_class($layer_uuid_, | ||
+ | ... | ||
+ | |||
+ | Removes tie between a number of feature classes and a layer | ||
+ | \\ | ||
+ | |||
+ | === Get All Layers === | ||
+ | |||
+ | ... | ||
+ | shn_gis_get_layers_all() | ||
+ | ... | ||
+ | |||
+ | Returns all layers as an array of arrays such: | ||
+ | |||
+ | array( | ||
+ | array( | ||
+ | l_uuid' | ||
+ | ' | ||
+ | ' | ||
+ | ), | ||
+ | array( | ||
+ | l_uuid' | ||
+ | ' | ||
+ | ' | ||
+ | ) | ||
+ | ) | ||
+ | \\ | ||
+ | |||
+ | === Get A Layer By Its UUID === | ||
+ | |||
+ | ... | ||
+ | shn_gis_get_layers_uuid($layer_uuid_) | ||
+ | ... | ||
+ | |||
+ | Returns a specific layer using the layers uuid a search value. | ||
+ | |||
+ | ... | ||
+ | shn_gis_get_layers_feature_class($feature_class_uuid_) | ||
+ | ... | ||
+ | |||
+ | Returns layers that a feature class is registered to. | ||
+ | \\ | ||
+ | |||
+ | === Return All Feature Classes In A Layer === | ||
+ | |||
+ | ... | ||
+ | shn_gis_get_feature_classes_layer($layer_uuid_, | ||
+ | ... | ||
- | * shn_gis_create_layer($name_, | ||
- | * Creates a new layer | ||
- | * shn_gis_remove_layer($layer_uuid_, | ||
- | * opt 1 - Fail if features exist within this layer otherwise remove. | ||
- | * opt 2 - Remove layer and references only. | ||
- | * opt 3 - Remove layer, layer references and all features that are in this layer. | ||
- | * default - use opt 1 | ||
- | * shn_gis_insert_layer_features($layer_uuid_, | ||
- | * Add tie between a number of features and a layer. | ||
- | * shn_gis_remove_layer_features($layer_uuid_, | ||
- | * Removes tie between a number of features and a layer. | ||
- | * given 2 dim array of coords encodes string (see doc in code for more details). | ||
- | * shn_gis_insert_layer_feature_class($layer_uuid_, | ||
- | * Add tie between a number of feature_classes and a layer. | ||
- | * function shn_gis_remove_layer_feature_class($layer_uuid_, | ||
- | * Removes tie between a number of feature classes and a layer | ||
- | * shn_gis_get_layers_all() | ||
- | * Returns all layers as an array of arrays such: | ||
- | array(array(l_uuid' | ||
- | * shn_gis_get_layers_uuid($layer_uuid_) | ||
- | * Returns a specific layer using the layers uuid a search value. | ||
- | * shn_gis_get_layers_feature_class($feature_class_uuid_) | ||
- | * Returns layers that a feature class is registered to. | ||
- | * shn_gis_get_feature_classes_layer($layer_uuid_, | ||
* opt 1 - Returns all class uuids registered to layer | * opt 1 - Returns all class uuids registered to layer | ||
* opt 2 - Returns all classes uuids registered to layer as well as classes of features in that layer. | * opt 2 - Returns all classes uuids registered to layer as well as classes of features in that layer. | ||
+ | \\ | ||
+ | |||
+ | ==== Extras ==== | ||
+ | |||
+ | === Decode A Coordinate String To Array === | ||
+ | |||
+ | ... | ||
+ | shn_gis_coord_decode($coords) | ||
+ | ... | ||
+ | |||
+ | given a coord string decodes values into 2 dim array (see doc in code for more details). | ||
+ | \\ | ||
+ | |||
+ | === Encode A Coordinate Array To String === | ||
+ | ... | ||
+ | shn_gis_coord_encode($coords, | ||
+ | ... | ||
- | **Extras** | + | given 2 dim array of coords encodes string (see doc in code for more details). |
- | * shn_gis_coord_decode($coords) | + | \\ |
- | * given a coord string decodes values into 2 dim array (see doc in code for more details). | + | |
- | * shn_gis_coord_encode($coords, | + | |
- | * given 2 dim array of coords encodes string (see doc in code for more details). | + | |
- | * \\ | + | |
- | * \\ | + | |