GeoClass.php - Manual


GeoClass.php

GeoClass.php is a collection of Classes to handle georeferenced data. It can connect to databases which contain georeferenced data and handle location as GeoObjects. Follow the links for documentation.
View the source code of GeoClass.php if you want to.
Documentation is available for the GeoClassWebService as well.

Configuration

string $cfgUnit : The default unit. Possible values are:
km = kilometers, miles = miles, in = inch, sm = sea-miles
string $cgfLanguage : The default language. "de" (german) and "en" (english) are available.
boolean $cgfNimaNative : Nima-databases contain names for locations in different languages. This parameter determines wether you only want to get the native names.

Classes

GeoObject : a basic object which handles a locations name and latitude/longitude. It contains methods to determine distance and orientation between two GeoObjects and some methods for converting between degree and dms. This object can return a RDF-representation of itself.
GeoDB : Allows the connection to a MySQL-database which contains entries with gereferenced data. Queries are returned as arrays of GeoObjectDB.
GeoObjectDB : GeoObjectDB is a subclass of GeoObject. It contains all other databaseValues, which are provided by the GeoDB-object.
GeoDBNima : GeoDBNima fits the needs aof a database as provided by Nima. It is an subclass of GeoDB.
GeoObjectDBNima : GeoDBNima returns arrays of GeoObjectDBNima-objects. These objects provide methods which are designed for the layout of Nima-databases. Subclass of GeoObjectDB.

Constants

GEO_UNIT : The configured unit.
GEO_LANGUAGE : The configured language ("de" or "en").
GEO_EARTH_RADIUS : The mean radius of the earth in kilometers: 6371. km
GEO_RETURN_SER : Used by GeoClassWebService Returns serialized array of GeoObjects. (is 0)
GEO_RETURN_RDF Used by GeoClassWebService Returns a RDF-data file string. (is 1)

Globals

You have access to the following globals.

$cfgStrings[GEO_ORIENTATION_SHORT][GEO_LANGUAGE] : Array with the short forms of the orientations:
"N", "NE", "E", "SE", "S", "SW", "W", "NW"