# geo namespace

The $.geo namespace contains all geometry functions implemented in the plugin and an object having the plugin's four projection functions.

## projection

The $.geo namespace has a property named proj which is a JavaScript object having four functions: fromGeodetic, fromGeodeticPos, toGeodetic, and toGeodeticPos. These four functions allow all $.geo static bbox/geometry functions, geomap widget properties, geomap widget events & geomap widget methods (collectively referred to as plugin functions from now on) to work in geodetic (lon, lat) coordinates.

- $.geo.proj

## geometry operations

Geometry isn't much fun if you can't do anything with it. These functions help you analyze and manipulate bounding boxes and GeoJSON geometry objects. You call them directly from the $.geo namespace:

    $.geo.distance( point1, point2 )

Except for a few name changes and switching from an object-oriented API to a function-based one, jQuery Geo attempts to follow the names and behavior of the Java Topology Suite (JTS), which is the de-facto standard for geometry library APIs. JTS itself is an implementation of the OGC Simple Features specification but has made design decisions that improve the API for developers. The most notable of which is having Envelope (called bbox in jQuery Geo and GeoJSON) be its own class type.

### bbox functions

These functions operate on GeoJSON bounding box array, i.e., a JavaScript array having four values:

- minimum x/longitude
- minimum y/latitude
- maximum x/longitude
- maximum y/latitude

- center
- height
- width
- expandBy
- scaleBy
- include
- reaspect
- recenter
- polygonize

### geometry object functions

These functions operate on GeoJSON geometry objects: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection. They do not operate on Feature or FeatureCollection objects, you have to call these functions on the geometry properties of Feature objects.

The geometry functions allow you to analyze relationships between geometries such as their distance apart as well as obtain information about them such as bounding box and center point, called the centroid. This section will eventually expand to cover all of the important spatial operations available in the Java Topology Suite.

- bbox
- distance
- length
- area
- contains
- centroid
- pointAlong