Skip to content
This repository was archived by the owner on Mar 9, 2021. It is now read-only.

Commit

Permalink
start cleaning up doc
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickarlt committed Nov 13, 2013
1 parent 530c615 commit 4afe92a
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 599 deletions.
70 changes: 4 additions & 66 deletions config.rb
Original file line number Diff line number Diff line change
@@ -1,51 +1,3 @@
###
# Compass
###

# Change Compass configuration
# compass_config do |config|
# config.output_style = :compact
# end

###
# Page options, layouts, aliases and proxies
###

# Per-page layout changes:
#
# With no layout
# page "/path/to/file.html", :layout => false
#
# With alternative layout
# page "/path/to/file.html", :layout => :otherlayout
#
# A path which all have the same layout
# with_layout :admin do
# page "/admin/*"
# end

# Proxy pages (http://middlemanapp.com/dynamic-pages/)
# proxy "/this-page-has-no-template.html", "/template-file.html", :locals => {
# :which_fake_page => "Rendering a fake page with a local variable" }

###
# Helpers
###

# Automatic image dimensions on image_tag helper
# activate :automatic_image_sizes

# Reload the browser automatically whenever files change
# activate :livereload

# Methods defined in the helpers block are available in templates
# helpers do
# def table_of_contents
# TableOfContentsRenderer
# current_page.soruce.render()
# end
# end

module CustomRenderers
class SemanticTOC < Redcarpet::Render::HTML_TOC
def preprocess text
Expand Down Expand Up @@ -103,7 +55,6 @@ def preprocess text
def header text, level
if level > 1
id = text.downcase.strip.gsub(' ', '-').gsub(/\(.+\)/, '').gsub(/[^\w-]/, '')
puts id
"<h#{level}>
<a id='#{id}' class='section-link'></a>
<a href='##{id}' class='header-link'>Link</a>
Expand All @@ -130,12 +81,8 @@ def header text, level

set :index_file, "index.html"

# set :http_prefix, 'documentation/'
###
# Markdown
###

set :markdown_engine, :redcarpet

set :markdown,
:renderer => CustomRenderers::Markdown,
:fenced_code_blocks => true,
Expand Down Expand Up @@ -163,18 +110,9 @@ def get_pages

# Build-specific configuration
configure :build do
# For example, change the Compass output style for deployment
# activate :minify_css

# Minify Javascript on build
# activate :minify_javascript

# Enable cache buster
# activate :asset_hash
activate :minify_css

# Use relative URLs
# activate :relative_assets
activate :minify_javascript

# Or use a different image path
# set :http_prefix, "/Content/images/"
activate :asset_hash
end
3 changes: 3 additions & 0 deletions source/assets/css/layout/_docs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
padding-left: $spine;
z-index: 1;
}
li {
@include p12;
}
}

aside.docs {
Expand Down
1 change: 1 addition & 0 deletions source/assets/css/modules/_semantic-toc.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.semantic-toc {
position: absolute;
z-index: 2;
ol {
float: left;
padding-left: 0;
Expand Down
115 changes: 55 additions & 60 deletions source/documentation/Getting-Started.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,100 +3,95 @@ title: Getting Started
layout: documentation
---
# Terraformer

<!-- table_of_contents -->

Terraformer is an open source (MIT licensed) Javascript geo toolkit, built for the server and the browser.

## Getting Started

Terraformer is broken into multiple small packages to give you the functionality that you need while still remaining extremely lightweight.

### Browser

Terraformer can be used in the browser with a simple browser include.
There are currently several packages in the Terraformer ecosystem.

```html
<!-- Load the main terraformer library -->
<script src="terraformer.min.js" type="text/javascript"></script>
* [Terraformer](/documentation/core) - The core library for manipilating GeoJSON and performaing calculations. Most other modules rely on `terraformer`.
* [ArcGIS Parser](/documentation/arcgis-parser) - Parses ArcGIS geometry objects to GeoJSON and vica-versa.
* [WKT Parser](/documentation/wkt-parser) - Parses basic WKT strings to and from GeoJSON.
* [GeoStore](/documentation/geostore) - A JavaScript database for storing and querying collections of GeoJSON Features. GeoStores also need an index module and a backing store which are distributed as seperate modules.

<!-- Load the wkt parser -->
<script src="wkt.min.js" type="text/javascript"></script>
### Browser

<!-- Load the arcgis parserindex -->
<script src="arcgis.min.js" type="text/javascript"></script>
Include the core Terraformer library with a `<script>` tag.

<!-- Load the rtree index -->
<script src="rtree.min.js" type="text/javascript"></script>
```html
<script src="http://cdn.webgeo.io/terraformer/1.0.1/terraformer.min.js"></script>
```

### AMD (Require.js and Dojo)

Terraformer also works with AMD loaders like [RequireJS](http://requirejs.org/) and [Dojo](http://dojotoolkit.org/).

##### RequireJS
### Node.js

First you should register the Terraformer modules with RequireJS
Install the core module with NPM and then require it in your Node program.

```js
requirejs.config({
//In order for proper loading of depenencies in Terraformer modules set the path up in requirejs.config
paths: {
terraformer: "the/path/to/terraformer"
}
});
```

Then you can load Terraformer modules in your `require` statements.
$ npm install terraformer
```

```js
requirejs([
"terraformer/terraformer",
"terraformer/wkt",
"terraformer/rtree",
], function (Terraformer, TerraformerWKT, RTree) {
// Do stuff with terraformer core, wkt parser, and rtree
};
var Terraformer = require('terraformer');
```

### Node.js
## Working with Primitives

Using Terraformer in Node.js is easy.
Most of the core Terraformer libray centers around using [`Primitives`](/documentation/core#primitive) which wrap GeoJSON objects and provide additonal functionality.

```
$ npm install terraformer
$ npm install terraformer-wkt-parser
$ npm install terraformer-arcgis-parser
$ npm install terraformer-rtree
```
Writing code is easy too:
You can create a new [Terraformer.Primitive](/documentation/core#primitive) with any GeoJSON object.

```js
var Terraformer = require('terraformer');

var Polygon = new Terraformer.Polygon();
var polygon = new Terraformer.Primitive({
"type": "Polygon",
"coordinates": [
[
[-122.66589403152467, 45.52290150862236],
[-122.66926288604736, 45.52291654238294],
[-122.67115116119385, 45.518406234030586],
[-122.67325401306151, 45.514000817199715],
[-122.6684260368347, 45.5127377671934],
[-122.66765356063841, 45.51694782364431],
[-122.66589403152467, 45.52290150862236 ]
]
]
});

var point = new Terraformer.Primitive({
"type": "Point",
"coordinates": [-122.66947746276854, 45.51775972687403]
});
```

### WebWorkers
Now that you have a point and a polygon primitive you can use many of the primitive helper methods

Documentation Coming Soon...
```js
// add a new vertex to our polygon
polygon.insertVertex([-122.6708507537842, 45.513188859735436], 2);

## Specifics
// figure out if our point is within our polygon
point.within(polygon); // returns true
```

### Basics
You can also have Terraformer perform many geometric operations like convex hulls and bounding boxes.

* [Primitives](Primitives.md)
```js
var convexHull = polygon.convexHull();

### Parsers
point.within(convexHull); // returns true

* [ArcGIS](ArcGIS.md)
* [Well Known Text](https://github.com/esri/terraformer-wkt-parser)
* [GeoJSON](GeoJSON.md)
var boundingBox = polygon.bbox(); // returns the geojson bounding box for this object.
```

### Indexes
## Whats Next?

* [Indexes](Indexes.md)
Start exploring all the options you have working with [Primitives]() and the core library then start exploring other modules.

### Tools
[Terraformer GeoStore](/documentation/geostore) is a JavaScript database for indexing and querying large amounds of GeoJSON. You can use multuile types of spatial indexes and backing stores for your data.

* [Tools](Tools.md)
* [Geostore](GeoStore.md)
You can also convert data between different formats like [ArcGIS Geometries](/documentation/arcgis-parser) and [Well Known Text](/documentation/wkt-parser). Remember Terraformer is a modular framework use only the pieces you need to complete your applicaiton.
Loading

0 comments on commit 4afe92a

Please sign in to comment.